package cn.fateverse.query.entity.dto;

import cn.fateverse.common.decrypt.annotation.EncryptField;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author Clay
 * @date 2023-07-22
 */
@Data
public class TopoDto {

    @NotNull(message = "查询id不能为空")
    @EncryptField
    private String queryId;

    private Long menuId;

    @NotBlank(message = "json数据不能为空")
    private String topJson;

    @JsonIgnore
    @JSONField(serialize = false)
    public Long getLongQueryId() {
        return Long.parseLong(queryId);
    }
}
