package cn.stylefeng.team.meta.api.pojo.db.request;

import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

    @NotNull(message = "数据库id不能为空", groups = {edit.class, delete.class})
    private Long databaseId;

    @NotBlank(message = "数据库名称不能为空", groups = {add.class, edit.class})
    private String databaseName;

    @NotNull(message = "数据库类型不能为空", groups = {add.class, edit.class})
    private Integer databaseType;

    @NotNull(message = "所属用户id不能为空", groups = {add.class, edit.class})
    private Long userId;

    private String description;

    @NotNull(message = "dbId不能为空", groups = getDataSourceTables.class)
    private Long dbId;

    public @interface getDataSourceTables {
    }

}
