package cn.stylefeng.team.portal.modular.management.pojo.request;

import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import cn.stylefeng.roses.kernel.validator.api.validators.unique.TableUniqueValue;
import com.alibaba.fastjson.JSONObject;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class PortalDesignRequest extends BaseRequest {

    @NotNull(message = "门户设计id不能为空", groups = {edit.class, delete.class, updateDesign.class})
    @ChineseDescription("门户设计id")
    private Long designId;

    @NotBlank(message = "门户设计名称不能为空", groups = {add.class, edit.class})
    @ChineseDescription("门户设计名称")
    @TableUniqueValue(message = "门户设计名称不能重复",
            groups = {add.class, edit.class},
            tableName = "portal_design",
            columnName = "design_name",
            idFieldName = "design_id",
            excludeLogicDeleteItems = true)
    private String designName;

    @ChineseDescription("封面图logo，存前端图标的编码")
    @NotBlank(message = "封面图logo不能为空", groups = {add.class, edit.class})
    private String designLogo;

    @ChineseDescription("描述")
    private String description;

    @NotNull(message = "门户设计的状态：10-启用，20-下架不能为空", groups = {add.class, edit.class})
    @ChineseDescription("门户设计的状态：10-启用，20-下架")
    private Integer designStatus;

    @ChineseDescription("门户拖拽设计的布局，json结构")
    @NotNull(message = "门户设计不能为空", groups = updateDesign.class)
    private JSONObject designLayoutJson;

    @ChineseDescription("门户的排序")
    private BigDecimal fldSort;

    @ChineseDescription("乐观锁")
    private Long versionFlag;

    @ChineseDescription("租户id")
    private Long tenantId;

    @NotNull(message = "批量删除id集合不能为空", groups = batchDelete.class)
    @ChineseDescription("批量删除用的id集合")
    private List<Long> batchDeleteIdList;

    public @interface updateDesign {

    }

}