| | |
| | | |
| | | import com.alibaba.fastjson2.annotation.JSONField; |
| | | import com.alibaba.fastjson2.writer.ObjectWriterImplToString; |
| | | 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.baomidou.mybatisplus.annotation.*; |
| | | import com.dy.common.po.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import lombok.*; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @NotEmpty(message = "密码不能为空") //不能为空也不能为null |
| | | @Length(message = "密码必须{max}位数据", min = 6, max = 6) |
| | | @JSONField(serialize = false) |
| | | public String password; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public Boolean deleted; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(value = "create_dt", fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date createDt; |
| | | |
| | | ////////////////////////////////////// |
| | | // 以下不是数据库实体属性 |
| | | ////////////////////////////////////// |
| | |
| | | |
| | | <sql id="Base_Column_List"> |
| | | <!--@mbg.generated--> |
| | | id, `name`, phone, `password`, supper_admin, disabled, deleted |
| | | id, `name`, phone, `password`, supper_admin, disabled, deleted,create_dt |
| | | </sql> |
| | | <sql id="part_Column_List"> |
| | | ${alias}.id, ${alias}.name, ${alias}.phone, ${alias}.password, ${alias}.disabled |
| | | ${alias}.id, ${alias}.name, ${alias}.phone, ${alias}.password, ${alias}.disabled,${alias}.create_dt |
| | | </sql> |
| | | <sql id="Login_Column_List"> |
| | | id, name, phone, supper_admin |
| | |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess("修改密码成功"); |
| | | return BaseResponseUtils.buildSuccess("重置密码成功"); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return 插入用户与角色关联记录数量 |
| | | */ |
| | | @Transactional |
| | | private int saveUserRoles(Long userId, String[] roleIds) { |
| | | public int saveUserRoles(Long userId, String[] roleIds) { |
| | | this.urDao.deleteByUserId(userId); |
| | | int count = 0; |
| | | if (roleIds != null && roleIds.length > 0) { |