From 9ba5b0d183926a1b9a0f5dabfcae5ff5d3cd35e4 Mon Sep 17 00:00:00 2001 From: DengMin <16679070171@qq.com> Date: Mon, 27 Dec 2021 14:06:59 +0800 Subject: [PATCH] passwordLogin接口字段优化 --- src/main/java/com/subsidy/service/MemberService.java | 3 ++- src/main/java/com/subsidy/service/impl/MemberServiceImpl.java | 7 +++++-- src/main/java/com/subsidy/vo/member/MemberVO.java | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/subsidy/vo/member/MemberVO.java diff --git a/src/main/java/com/subsidy/service/MemberService.java b/src/main/java/com/subsidy/service/MemberService.java index 1bf9cd7..928d371 100644 --- a/src/main/java/com/subsidy/service/MemberService.java +++ b/src/main/java/com/subsidy/service/MemberService.java @@ -16,6 +16,7 @@ import com.subsidy.vo.member.ContentVodNewVO; import com.subsidy.vo.member.GetAllVO; import com.subsidy.vo.member.GetStudyInfoVO; import com.subsidy.vo.member.MemberStudyPageVO; +import com.subsidy.vo.member.MemberVO; import com.subsidy.vo.paper.QueryPapersVO; import java.util.List; @@ -40,7 +41,7 @@ public interface MemberService extends IService { UserRoleVO login(VerifyCodeDTO verifyCodeDTO); - MemberDO passwordLogin(PasswordLoginDTO passwordLoginDTO); + MemberVO passwordLogin(PasswordLoginDTO passwordLoginDTO); String updatePassword(MemberDO memberDO); diff --git a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java index 1a22b6e..6834ee4 100644 --- a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -47,6 +47,7 @@ import com.subsidy.vo.member.ContentVodVO; import com.subsidy.vo.member.GetAllVO; import com.subsidy.vo.member.GetStudyInfoVO; import com.subsidy.vo.member.MemberStudyPageVO; +import com.subsidy.vo.member.MemberVO; import com.subsidy.vo.member.MemberVodVO; import com.subsidy.vo.member.StudyPageVO; import com.subsidy.vo.paper.QueryPapersVO; @@ -300,7 +301,7 @@ public class MemberServiceImpl extends ServiceImpl imple return userRoleVO; } - public MemberDO passwordLogin(PasswordLoginDTO passwordLoginDTO) { + public MemberVO passwordLogin(PasswordLoginDTO passwordLoginDTO) { /** * 先从redis里查 */ @@ -319,13 +320,15 @@ public class MemberServiceImpl extends ServiceImpl imple } if (memberDO.getPassword().equals(passwordLoginDTO.getPassword())&&1==memberDO.getFirstLogin()&&"冻结".equals(memberDO.getStatus())){ + MemberVO memberVO = new MemberVO(); + BeanUtils.copyProperties(memberDO, memberVO); OprMemDictDO oprMemDictDO = new OprMemDictDO(); oprMemDictDO.setUserId(memberDO.getId()); oprMemDictDO.setOprType("登录"); oprMemDictDO.setResult(1); oprMemDictDO.setCreateDate(LocalDateTime.now()); redisUtil.set(RedisPrefixConstant.SUBSIDY_MEMBER_LOGIN_PREFIX + memberDO.getId() + "_" + System.currentTimeMillis(), 1); - return memberDO; + return memberVO; }else { if (!memberDO.getPassword().equals(passwordLoginDTO.getPassword())) { OprMemDictDO oprMemDictDO = new OprMemDictDO(); diff --git a/src/main/java/com/subsidy/vo/member/MemberVO.java b/src/main/java/com/subsidy/vo/member/MemberVO.java new file mode 100644 index 0000000..79ac09c --- /dev/null +++ b/src/main/java/com/subsidy/vo/member/MemberVO.java @@ -0,0 +1,19 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class MemberVO { + + private Long id; + + private String gender; + + private String telephone; + + private String userName; + + private String image; + + private Integer firstLogin; +} -- libgit2 0.25.0