package com.ruoyi.info.quicklink.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.info.quicklink.enums.JumpType;
import com.ruoyi.info.quicklink.enums.ResourceModel;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 金刚区业务对象 tb_quick_link
 *
 * @author wuchao
 * @date 2023-12-20
 */
@Data
@ApiModel("金刚区业务对象")
public class QuickLinkBo implements Serializable {

    /**
     * ID
     */
    @ApiModelProperty(value = "ID", required = true)
    @NotNull(message = "ID不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 位置
     */
    @ApiModelProperty(value = "位置", required = true)
    @NotBlank(message = "位置不能为空", groups = {AddGroup.class, EditGroup.class})
    @Length(max = 50, message = "位置不能超过50个字", groups = {AddGroup.class, EditGroup.class})
    private String locationCode;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称", required = true)
    @NotBlank(message = "名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Length(max = 50, message = "名称不能超过50个字", groups = {AddGroup.class, EditGroup.class})
    private String name;

    /**
     * 图标
     */
    @ApiModelProperty(value = "图标", required = true)
    @NotBlank(message = "图标不能为空", groups = {AddGroup.class, EditGroup.class})
    private String icon;

    /**
     * 链接类型：
     * 0：内部链接；
     * 1：外部链接；
     * 2：资源入口；
     */
    @ApiModelProperty(value = "链接类型： 0：内部链接； 1：外部链接； 2：资源入口；", required = true)
    @NotNull(message = "链接类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private JumpType jumpType;

    /**
     * 内部链接（字典）
     */
    @ApiModelProperty(value = "内部链接（字典）")
    private String innerPageCode;

    /**
     * 外部链接
     */
    @ApiModelProperty(value = "外部链接")
    private String outsideAddress;

    /**
     * 资源入口
     */
    @ApiModelProperty(value = "内部资源具体模型（无0，公告1，积分商品2，景区3）")
    private ResourceModel resourceModel;

    /**
     * 资源标题
     */
    @ApiModelProperty(value = "资源标题")
    private String resourceModelTitle;

    /**
     * 资源ID
     */
    @ApiModelProperty(value = "资源ID")
    private Long resourceModelId;

    /**
     * 顺序
     */
    @ApiModelProperty(value = "顺序", required = true)
    @NotNull(message = "顺序不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer sequence;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态", required = true)
    @NotNull(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Boolean status;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注", required = true)
    @Length(max = 250, message = "备注不能超过250个字", groups = {AddGroup.class, EditGroup.class})
    private String remark;

    /** 查询用 **/
    /**
     * 创建时间开始
     */
    @ApiModelProperty(value = "创建时间开始")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTimeStart;

    /**
     * 创建时间结束
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间结束")
    private Date createTimeEnd;

}
