package com.friday.distributor.po;

import com.friday.operation.api.distributor.dto.BizConfigDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Author YaoYao
 * @Date Created In 17:00 2023/3/9
 * @Description
 * @Modified By
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BizConfigPo {
    /**
     * 主键ID
     */
    private Integer id;
    /**
     * 客户租户
     */
    private String taieTenant;
    /**
     * 业务唯一标志
     */
    private String taskType;
    /**
     * 关联代码包名
     */
    private String handler;
    /**
     * 服务类所在模块
     */
    private String module;
    /**
     * 所在队列
     */
    private String queueKey;
    private String defaultConfig;
    /**
     * 是否有效
     */
    private Boolean valid;
    /**
     * 备注
     */
    private String remark;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    public BizConfigDto transferToDto(){
        return BizConfigDto.builder()
                .taieTenant(taieTenant)
                .taskType(taskType)
                .handler(handler)
                .module(module)
                .queueKey(queueKey)
                .build();
    }
}
