package com.ruoyi.business.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 对外服务基础信息对象 b_service_base
 * 
 * @author gx
 * @date 2024-02-04
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@TableName("b_service_base")
public class ServiceBase implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;

    /**
     * 上级主键
     */
    @TableField("parent_id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long parentId;

    /**
     * 所属系统
     */
    @TableField("belong_system")
    private String belongSystem;

    /**
     * 目录或内容 (字典:sys_dir_classify)
     */
    @TableField("dir_or_content")
    private String dirOrContent;

    /**
     * 名称
     */
    @TableField("name")
    private String name;

    /**
     * 业务类型
     */
    @TableField("business_type")
    private String businessType;

    /**
     * 排序
     */
    @TableField("order_num")
    private Integer orderNum;

    /**
     * 部门路径
     */
    @TableField("dept_id_path")
    private String deptIdPath;

    /**
     * 部门名称
     */
    @TableField("dept_name")
    private String deptName;

    /**
     * 创建人
     */
    @TableField("create_by")
    private String createBy;

    /**
     * 创建人ID
     */
    @TableField("create_user_id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long createUserId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField("update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private Date updateTime;

    /**
     * 删除人
     */
    @TableField("delete_by")
    private String deleteBy;

    /**
     * 删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("delete_time")
    private Date deleteTime;

    /**
     * 删除标志 0未删除，1 删除
     */
    @TableField("delete_flag")
    @TableLogic
    private String deleteFlag;

    @TableField(exist = false)
    private List<ServiceBase> children = new ArrayList<>();
}
