package com.jeequan.jeepay.db.entity;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.jeequan.jeepay.core.model.BaseModel;
import com.jeequan.jeepay.core.validate.Add;
import com.jeequan.jeepay.core.validate.Update;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 转账功能接口定义
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2024-04-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "t_transfer_interface_define", autoResultMap = true)
public class TransferInterfaceDefineEntity extends BaseModel implements Serializable {



    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 转账功能接口代码
     */
    @NotEmpty(groups = Add.class, message = "转账功能接口代码不能为空")
    private String transIfCode;

    /**
     * 转账功能接口名称
     */
    @NotEmpty(groups = {Add.class, Update.class}, message = "转账功能接口名称不能为空")
    private String transIfName;

    /**
     * 关联支付接口代码，部分转账功能必须关联支付接口
     */
    private String payIfCode;

    /**
     * 参数配置模板
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String isvParams;

    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONArray wayCodes;

    /**
     * 页面展示：卡片-图标
     */
    @NotEmpty(groups = {Add.class, Update.class}, message = "图标不能为空")
    private String icon;

    /**
     * 页面展示：卡片-背景色
     */
    @NotEmpty(groups = {Add.class, Update.class}, message = "卡片背景色不能为空")
    private String bgColor;

    /**
     * 状态: 0-停用, 1-启用
     */
    private Byte state;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

}
