package com.ruoyi.system.domain; import cn.afterturn.easypoi.excel.annotation.Excel; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; /** *

* 用户表 *

* * @author luodangjia * @since 2024-09-19 */ @Data @EqualsAndHashCode(callSuper = false) @TableName("t_app_user") @ApiModel(value="TAppUser对象", description="用户表") public class TAppUser implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键") @TableId(value = "id", type = IdType.AUTO) private Long id; @Excel(width = 30,name = "用户ID") private String code; @ApiModelProperty(value = "用户") @TableField("name") @Excel(width = 30,name = "用户昵称") private String name; @ApiModelProperty(value = "密码") @TableField("password") private String password; @ApiModelProperty(value = "手机号") @TableField("phone") @Excel(width = 30,name = "手机号") private String phone; @ApiModelProperty(value = "头像") @TableField("avatar") private String avatar; @ApiModelProperty(value = "微信openid") @TableField("wx_openid") private String wxOpenid; @ApiModelProperty(value = "支付宝openid") @TableField("ali_openid") private String aliOpenid; @ApiModelProperty(value = "省名称") @TableField("province") private String province; @ApiModelProperty(value = "省区划代码") @TableField("province_code") private String provinceCode; @ApiModelProperty(value = "市名称") @TableField("city") private String city; @ApiModelProperty(value = "市区划代码") @TableField("city_code") private String cityCode; @ApiModelProperty(value = "国家") @TableField("country") private String country; @ApiModelProperty(value = "邮箱") @TableField("email") private String email; @ApiModelProperty(value = "地址") @TableField("address") private String address; @ApiModelProperty(value = "个人简介") @TableField("info") private String info; @ApiModelProperty(value = "备注") @TableField("remark") private String remark; @ApiModelProperty(value = "最后一次登录时间") @TableField("last_login_time") private LocalDateTime lastLoginTime; @TableField("edit_name") private String editName; @TableField("edit_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private LocalDateTime editTime; @ApiModelProperty(value = "删除(0=否,1=是)") @TableField("is_delete") private Boolean isDelete; @ApiModelProperty(value = "是否设置偏好 1是 0否") @TableField("is_set_preference") private Integer isSetPreference; @ApiModelProperty(value = "初次偏好设置") @Excel(width = 30,name = "初次偏好设置") @TableField(exist = false) private String lateString; @ApiModelProperty(value = "最新偏好设置") @Excel(width = 30,name = "最新偏好设置") @TableField(exist = false) private String newString; @TableField(exist = false) private Object cityStr; @ApiModelProperty(value = "添加时间") @TableField("create_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private LocalDateTime createTime; @ApiModelProperty(value = "状态(1=正常,2=冻结,3=注销)") @Excel(width = 30,name = "用户状态", replace = {"正常_1", "冻结_2","注销_3"}) @TableField("status") private Integer status; @TableField(exist = false) @Excel(width = 30,name = "注册时间") private String createTimeStr; @ApiModelProperty(value = "偏好设置数组") @TableField(exist = false) private List changes; public String getStatusText() { if (status == 1) { return "正常"; } else if (status == 2) { return "冻结"; } else if (status == 3) { return "注销"; } else { return "未知"; } } public void getFormattedCreateTime() { if (createTime != null) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); createTimeStr = createTime.format(formatter); } } }