MALL:会员的个人信息,支持 sex 修改和返回

This commit is contained in:
YunaiV 2023-12-17 09:51:24 +08:00
parent e1bb546460
commit b0b6544887
3 changed files with 11 additions and 2 deletions

View File

@ -20,6 +20,9 @@ public class AppMemberUserInfoRespVO {
@Schema(description = "用户手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15601691300")
private String mobile;
@Schema(description = "用户性别", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer sex;
@Schema(description = "积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer point;

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.member.controller.app.user.vo;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.URL;
@ -15,4 +17,7 @@ public class AppMemberUserUpdateReqVO {
@URL(message = "头像必须是 URL 格式")
private String avatar;
@Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer sex;
}

View File

@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserUpdateReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.AppMemberUserResetPasswordReqVO;
@ -128,8 +129,8 @@ public class MemberUserServiceImpl implements MemberUserService {
@Override
public void updateUser(Long userId, AppMemberUserUpdateReqVO reqVO) {
memberUserMapper.updateById(new MemberUserDO().setId(userId)
.setNickname(reqVO.getNickname()).setAvatar(reqVO.getAvatar()));
MemberUserDO updateObj = BeanUtils.toBean(reqVO, MemberUserDO.class).setId(userId);
memberUserMapper.updateById(updateObj);
}
@Override