package com.muyu.domain.resp;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.domain.SysCar;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName SysCarResp
 * @Description TODO
 * @Author LiHD
 * @Date 2024/9/25 20:14
 */

/**
 * 车辆类型信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Tag(name = "车辆类型信息", description = "车辆类型")
@TableName(value = "sys_car", autoResultMap = true)
public class SysCarResp {

    /**
     * 自增主键
     */
    @Schema(description = "自增主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 车辆VIN码
     */
    @Schema(description = "车辆VIN码")
    private String carVin;

    /**
     * 车辆车牌号
     */
    @Schema(description = "车辆车牌号")
    private String carPlate;

    /**
     * 车辆品牌
     */
    @Schema(description = "车辆品牌")
    private String carBrand;

    /**
     * 车辆型号
     */
    @Schema(description = "车辆型号")
    private String carModel;

    /**
     * 车辆类型
     */
    @Schema(description = "车辆类型")
    private Integer carType;

    /**
     * 车辆类型名称
     */
    @Schema(description = "车辆类型名称")
    private String sysTypeName;

    /**
     * 策略ID
     */
    @Schema(description = "策略ID")
    private Integer warnStrategy;

    /**
     * 围栏组编码
     */
    @Schema(description = "围栏组编码")
    private String groupCode;

    /**
     * 启用状态
     */
    @Schema(description = "启用状态")
    private Integer state;


    public  static SysCarResp reverseResp(SysCar sysCar){
        return SysCarResp.builder()
                .id(sysCar.getId())
                .carVin(sysCar.getCarVin())
                .carPlate(sysCar.getCarPlate())
                .carBrand(sysCar.getCarBrand())
                .carModel(sysCar.getCarModel())
                .carType(sysCar.getCarType())
                .warnStrategy(sysCar.getWarnStrategy())
                .groupCode(sysCar.getGroupCode())
                .state(sysCar.getState())
                .build();

    }
}
