From b0b6544887982b8985191982006b9a25758dbd61 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 17 Dec 2023 09:51:24 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20MALL=EF=BC=9A=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E7=9A=84=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20sex=20=E4=BF=AE=E6=94=B9=E5=92=8C=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/user/vo/AppMemberUserInfoRespVO.java | 3 +++ .../controller/app/user/vo/AppMemberUserUpdateReqVO.java | 5 +++++ .../module/member/service/user/MemberUserServiceImpl.java | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java index 25cceedc2..fa05e16d0 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserInfoRespVO.java @@ -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; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserUpdateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserUpdateReqVO.java index a676f6256..cca08e926 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserUpdateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/user/vo/AppMemberUserUpdateReqVO.java @@ -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; + } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index a7466d22c..37b56f001 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -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