移除学员的nickname字段

This commit is contained in:
none 2023-03-20 13:44:32 +08:00
parent f57e27783b
commit 48a1597998
7 changed files with 37 additions and 58 deletions

View File

@ -57,7 +57,6 @@ public class UserController {
String name = MapUtils.getString(params, "name");
String email = MapUtils.getString(params, "email");
String nickname = MapUtils.getString(params, "nickname");
String idCard = MapUtils.getString(params, "id_card");
Integer isActive = MapUtils.getInteger(params, "is_active");
Integer isLock = MapUtils.getInteger(params, "is_lock");
@ -68,7 +67,6 @@ public class UserController {
UserPaginateFilter filter = new UserPaginateFilter() {{
setName(name);
setNickname(nickname);
setEmail(email);
setIdCard(idCard);
setIsActive(isActive);
@ -134,7 +132,7 @@ public class UserController {
return JsonResponse.error("邮箱已存在");
}
userService.updateWithDepIds(user, email, req.getNickname(), req.getName(), req.getAvatar(), req.getPassword(), req.getIdCard(), req.getDepIds());
userService.updateWithDepIds(user, email, req.getName(), req.getAvatar(), req.getPassword(), req.getIdCard(), req.getDepIds());
return JsonResponse.success();
}
@ -184,10 +182,9 @@ public class UserController {
for (int i = 0; i < users.length; i++) {
//c0: 部门ids数组
//c1: 邮箱
//c2: 昵称
//c2: 姓名
//c3: 密码
//c4: 姓名
//c5: 身份证号
//c4: 身份证号
String tmpEmail = users[i][1];
if (emailMap.get(tmpEmail) != null) {//存在重复
@ -224,11 +221,10 @@ public class UserController {
String tmpSalt = HelperUtil.randomString(6);
String tmpPassword = HelperUtil.MD5(users[i][3] + tmpSalt);
tmpInsertUser.setEmail(users[i][1]);
tmpInsertUser.setNickname(users[i][2]);
tmpInsertUser.setPassword(tmpPassword);
tmpInsertUser.setSalt(tmpSalt);
tmpInsertUser.setName(users[i][4]);
tmpInsertUser.setIdCard(users[i][5]);
tmpInsertUser.setIdCard(users[i][4]);
tmpInsertUser.setCreateIp(SystemConstant.INTERNAL_IP);
tmpInsertUser.setCreateCity(SystemConstant.INTERNAL_IP_AREA);
tmpInsertUser.setCreatedAt(new Date());

View File

@ -4,7 +4,6 @@ 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 java.io.Serializable;
import java.util.Date;
@ -12,19 +11,19 @@ import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import xyz.playedu.api.bus.BackendBus;
import xyz.playedu.api.constant.BPermissionConstant;
import xyz.playedu.api.constant.BackendConstant;
/**
*
* @TableName users
*/
@TableName(value = "users")
@TableName(value ="users")
@Data
public class User implements Serializable {
/**
*
*
*/
@TableId(type = IdType.AUTO)
private Integer id;
@ -34,11 +33,6 @@ public class User implements Serializable {
*/
private String email;
/**
* 昵称
*/
private String nickname;
/**
* 真实姓名
*/
@ -157,24 +151,23 @@ public class User implements Serializable {
}
User other = (User) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
&& (this.getNickname() == null ? other.getNickname() == null : this.getNickname().equals(other.getNickname()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
&& (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
&& (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard()))
&& (this.getCredit1() == null ? other.getCredit1() == null : this.getCredit1().equals(other.getCredit1()))
&& (this.getCreateIp() == null ? other.getCreateIp() == null : this.getCreateIp().equals(other.getCreateIp()))
&& (this.getCreateCity() == null ? other.getCreateCity() == null : this.getCreateCity().equals(other.getCreateCity()))
&& (this.getIsActive() == null ? other.getIsActive() == null : this.getIsActive().equals(other.getIsActive()))
&& (this.getIsLock() == null ? other.getIsLock() == null : this.getIsLock().equals(other.getIsLock()))
&& (this.getIsVerify() == null ? other.getIsVerify() == null : this.getIsVerify().equals(other.getIsVerify()))
&& (this.getVerifyAt() == null ? other.getVerifyAt() == null : this.getVerifyAt().equals(other.getVerifyAt()))
&& (this.getIsSetPassword() == null ? other.getIsSetPassword() == null : this.getIsSetPassword().equals(other.getIsSetPassword()))
&& (this.getLoginAt() == null ? other.getLoginAt() == null : this.getLoginAt().equals(other.getLoginAt()))
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
&& (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
&& (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar()))
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
&& (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
&& (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard()))
&& (this.getCredit1() == null ? other.getCredit1() == null : this.getCredit1().equals(other.getCredit1()))
&& (this.getCreateIp() == null ? other.getCreateIp() == null : this.getCreateIp().equals(other.getCreateIp()))
&& (this.getCreateCity() == null ? other.getCreateCity() == null : this.getCreateCity().equals(other.getCreateCity()))
&& (this.getIsActive() == null ? other.getIsActive() == null : this.getIsActive().equals(other.getIsActive()))
&& (this.getIsLock() == null ? other.getIsLock() == null : this.getIsLock().equals(other.getIsLock()))
&& (this.getIsVerify() == null ? other.getIsVerify() == null : this.getIsVerify().equals(other.getIsVerify()))
&& (this.getVerifyAt() == null ? other.getVerifyAt() == null : this.getVerifyAt().equals(other.getVerifyAt()))
&& (this.getIsSetPassword() == null ? other.getIsSetPassword() == null : this.getIsSetPassword().equals(other.getIsSetPassword()))
&& (this.getLoginAt() == null ? other.getLoginAt() == null : this.getLoginAt().equals(other.getLoginAt()))
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
&& (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
}
@Override
@ -183,7 +176,6 @@ public class User implements Serializable {
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
result = prime * result + ((getNickname() == null) ? 0 : getNickname().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getAvatar() == null) ? 0 : getAvatar().hashCode());
result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
@ -211,7 +203,6 @@ public class User implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", email=").append(email);
sb.append(", nickname=").append(nickname);
sb.append(", name=").append(name);
sb.append(", avatar=").append(avatar);
sb.append(", password=").append(password);

View File

@ -8,18 +8,17 @@ import xyz.playedu.api.types.paginate.UserPaginateFilter;
import java.util.List;
/**
* @author tengteng
* @description 针对表users的数据库操作Mapper
* @createDate 2023-02-23 14:04:49
* @Entity xyz.playedu.api.domain.User
*/
* @author tengteng
* @description 针对表users的数据库操作Mapper
* @createDate 2023-03-20 13:37:33
* @Entity xyz.playedu.api.domain.User
*/
@Mapper
public interface UserMapper extends BaseMapper<User> {
List<User> paginate(UserPaginateFilter filter);
Long paginateCount(UserPaginateFilter filter);
}

View File

@ -26,9 +26,6 @@ public class UserRequest {
@Length(min = 1, max = 20, message = "姓名长度在1-20个字符之间")
private String name;
@Length(min = 1, max = 20, message = "昵称长度在1-20个字符之间")
private String nickname;
@NotNull(message = "avatar参数不存在")
@NotBlank(message = "请上传头像")
private String avatar;

View File

@ -31,7 +31,7 @@ public interface UserService extends IService<User> {
User createWithDepIds(String email, String name, String avatar, String password, String idCard, Integer[] depIds);
User updateWithDepIds(User user, String email, String nickname, String name, String avatar, String password, String idCard, Integer[] depIds);
User updateWithDepIds(User user, String email, String name, String avatar, String password, String idCard, Integer[] depIds);
List<Integer> getDepIdsByUserId(Integer userId);

View File

@ -76,7 +76,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
User user = new User();
user.setEmail(email);
user.setName(name);
user.setNickname(name);
user.setAvatar(avatar);
user.setPassword(passwordHashed);
user.setSalt(salt);
@ -102,11 +101,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Override
@Transactional
public User updateWithDepIds(User user, String email, String nickname, String name, String avatar, String password, String idCard, Integer[] depIds) {
public User updateWithDepIds(User user, String email, String name, String avatar, String password, String idCard, Integer[] depIds) {
User newUser = new User();
newUser.setId(user.getId());
newUser.setEmail(email);
newUser.setNickname(nickname);
newUser.setName(name);
newUser.setAvatar(avatar);
newUser.setIdCard(idCard);

View File

@ -7,7 +7,6 @@
<resultMap id="BaseResultMap" type="xyz.playedu.api.domain.User">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="email" column="email" jdbcType="VARCHAR"/>
<result property="nickname" column="nickname" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="avatar" column="avatar" jdbcType="VARCHAR"/>
<result property="password" column="password" jdbcType="VARCHAR"/>
@ -27,13 +26,12 @@
</resultMap>
<sql id="Base_Column_List">
id,email,nickname,
name,avatar,password,
salt,id_card,credit1,
create_ip,create_city,is_active,
is_lock,is_verify,verify_at,
is_set_password,login_at,created_at,
updated_at
id,email,name,
avatar,password,salt,
id_card,credit1,create_ip,
create_city,is_active,is_lock,
is_verify,verify_at,is_set_password,
login_at,created_at,updated_at
</sql>
<select id="paginateCount" resultType="java.lang.Long">
SELECT count(1)