package com.sckw.fleet.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sckw.fleet.model.KwfDriverConductRulesLog;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 司机行为规则返回模型
 *
 * @author Generated
 * @since 2024
 */
@Data
public class KwfDriverConductRulesLogVO implements Serializable {

    @Serial
    private static final long serialVersionUID = -5360767484446805797L;

    /**
     * 主键
     */
    @Schema(description = "主键id")
    private Long id;

    /**
     * 业务id
     */
    @Schema(description = "业务id")

    private Long bizId;

    /**
     * 状态(0-自动派单，1-司机行为规则)
     */
    @Schema(description = "状态(0-自动派单，1-司机行为规则)")
    private int status;

    /**
     * 日志内容
     */
    @Schema(description = "日志内容")
    private String description;

    /**
     * 创建时间
     */
    @Schema(description = "Schema")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 创建人（用户ID，默认-1）
     */
    @Schema(description = "创建人")
    private Long createUser;

    /**
     * 创建人
     */
    @Schema(description = "创建人姓名")
    private String createUserName;


    private static KwfDriverConductRulesLogVO getInstance(){
        return new KwfDriverConductRulesLogVO();
    }

    public static KwfDriverConductRulesLogVO toVO(KwfDriverConductRulesLog rules){
        if (rules == null) {
            return KwfDriverConductRulesLogVO.getInstance();
        }
        KwfDriverConductRulesLogVO rulesVO = KwfDriverConductRulesLogVO.getInstance();
        rulesVO.setId(rules.getId());
        rulesVO.setBizId(rules.getBizId());
        rulesVO.setStatus(rules.getStatus());
        rulesVO.setDescription(rules.getDescription());
        rulesVO.setCreateTime(rules.getCreateTime());
        rulesVO.setCreateUser(rules.getCreateUser());
        rulesVO.setCreateTime(rules.getCreateTime());

        return rulesVO;
    }


}