package com.ag.log.entity;

import com.ag.util.StrUtil;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.List;

/**
 * Created by yangxh on 2022/3/9.
 */
public class LogParam {
    private JSONObject reqParam;
    private String cudType;
    private String bizType;
    private String keyword;
    private String wbName;
    private String defineInfo;
    private String menuName;
    private String createDataId;
    private String primaryKeyColName;
    private List<Serializable> create;
    private List<Serializable> update;
    private List<Serializable> destroy;

    public LogParam(){
    }

    /**
     * @param reqParam requestAg请求发送到后台组装的参数
     * @param keyword 关键字，方便日志查询的筛选条件（可以是提单号、箱号、船名等常用数据）
     * @param bizType 业务类型，方便日志查询的筛选条件
     * @param cudType 增删改类型，主要针对panel提交，grid提交传null，
     * @param wbName 控件的参数名称
     */
    public LogParam(JSONObject reqParam, String keyword, String bizType, String cudType, String wbName){
        this.reqParam = reqParam;
        this.keyword = keyword;
        this.bizType = bizType;
        this.cudType = cudType;
        this.wbName = wbName;

    }

    public LogParam(JSONObject reqParam, String keyword, String bizType, String defineInfo){
        this.reqParam = reqParam;
        this.keyword = keyword;
        this.bizType = bizType;
        this.defineInfo = defineInfo;
    }


    public JSONObject getReqParam() {
        return reqParam;
    }

    public void setReqParam(JSONObject reqParam) {
        this.reqParam = reqParam;
    }

    public String getCudType() {
        return cudType;
    }

    public void setCudType(String cudType) {
        this.cudType = cudType;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getWbName() {
        return wbName;
    }

    public void setWbName(String wbName) {
        this.wbName = wbName;
    }

    public String getDefineInfo() {
        return defineInfo;
    }

    public void setDefineInfo(String defineInfo) {
        this.defineInfo = defineInfo;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getCreateDataId() {
        return createDataId;
    }

    public void setCreateDataId(String createDataId) {
        this.createDataId = createDataId;
    }

    public List<Serializable> getCreate() {
        return create;
    }

    public void setCreate(List<Serializable> create) {
        this.create = create;
    }

    public List<Serializable> getUpdate() {
        return update;
    }

    public void setUpdate(List<Serializable> update) {
        this.update = update;
    }

    public List<Serializable> getDestroy() {
        return destroy;
    }

    public void setDestroy(List<Serializable> destroy) {
        this.destroy = destroy;
    }

    public String getPrimaryKeyColName() {
        if (StrUtil.isEmpty(primaryKeyColName)){
            primaryKeyColName = "ID";
        }
        return primaryKeyColName;
    }

    public void setPrimaryKeyColName(String primaryKeyColName) {
        this.primaryKeyColName = primaryKeyColName;
    }
}
