package com.ruoyi.demo.entity; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.alibaba.excel.converters.date.DateStringConverter; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ruoyi.common.annotation.ExcelDictFormat; import com.ruoyi.common.convert.ExcelDictConvert; import com.ruoyi.demo.entity.vo.AppVo; import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDateTime; import java.util.Date; @Data @TableName("dl_app") @NoArgsConstructor public class App { @ExcelProperty(value = "应用ID") @TableId("appkey") private String appkey; @ExcelIgnore @TableField("app_logo") private String appLogo; @ExcelProperty(value = "小程序名称") @TableField("app_name") private String appName; @ExcelIgnore @TableField("app_introduce") private String appIntroduce; @ExcelIgnore @TableField("commercial_id") private String commercialId; @ExcelProperty(value = "所属商户") @TableField("commercial_name") private String commercialName; @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) @ExcelDictFormat(readConverterExp = "0=已禁用,1=已启用") @TableField("state") private Integer state; @ExcelIgnore @TableField("call_back") private String callBack; @ExcelIgnore @TableField("appSecret") private String appSecret; @ExcelIgnore @TableField("prove_1") private String prove1; @ExcelIgnore @TableField("prove_2") private String prove2; @ExcelIgnore @TableField("prove_3") private String prove3; @ExcelIgnore @TableField("prove_4") private String prove4; @ExcelIgnore @TableField("prove_5") private String prove5; @ExcelProperty(value = "创建时间",converter = DateStringConverter.class) @DateTimeFormat("yyyy-MM-dd HH:mm:ss") @TableField("create_time") private Date createTime; @ExcelIgnore @TableField("annotation") private String annotation; @ExcelIgnore @TableField("deleted") private Integer deleted; public App(AppVo appVo) { this.appLogo = appVo.getAppLogo(); this.appName = appVo.getAppName(); this.appIntroduce = appVo.getAppIntroduce(); this.commercialId = appVo.getCommercialId(); this.commercialName = appVo.getCommercialName(); this.state = appVo.getState(); this.callBack = appVo.getCallBack(); this.prove1 = appVo.getProve1(); this.prove2 = appVo.getProve2(); this.prove3 = appVo.getProve3(); this.prove4 = appVo.getProve4(); this.prove5 = appVo.getProve5(); this.annotation = appVo.getAnnotation(); } }