Commit 5dfa87b8 authored by alex yao's avatar alex yao

feat: 获取用户信息

parent 4adc3ce3
...@@ -2,6 +2,8 @@ package cn.com.poc.user.dto; ...@@ -2,6 +2,8 @@ package cn.com.poc.user.dto;
import cn.com.yict.framemax.data.model.BaseModelClass; import cn.com.yict.framemax.data.model.BaseModelClass;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Date; import java.util.Date;
...@@ -9,6 +11,8 @@ import java.util.Date; ...@@ -9,6 +11,8 @@ import java.util.Date;
* @Author:Roger Wu * @Author:Roger Wu
* @Date:2024-07-25 11:06 * @Date:2024-07-25 11:06
*/ */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class MemberInfoDto extends BaseModelClass { public class MemberInfoDto extends BaseModelClass {
/** /**
......
...@@ -48,5 +48,5 @@ public interface BizMemberInfoRest extends BaseRest { ...@@ -48,5 +48,5 @@ public interface BizMemberInfoRest extends BaseRest {
* 获取用户昵称 * 获取用户昵称
*/ */
@Permission(Access.Anonymous) @Permission(Access.Anonymous)
String getMemberNickName(@RequestParam Long memberId) throws Exception; MemberInfoDto getMemberNickName(@RequestParam Long memberId) throws Exception;
} }
\ No newline at end of file
...@@ -114,11 +114,14 @@ public class BizMemberInfoRestImpl implements BizMemberInfoRest { ...@@ -114,11 +114,14 @@ public class BizMemberInfoRestImpl implements BizMemberInfoRest {
@Override @Override
public String getMemberNickName(Long memberId) throws Exception { public MemberInfoDto getMemberNickName(Long memberId) throws Exception {
MemberInfoEntity memberInfoEntity = bizMemberInfoService.getById(memberId.intValue()); MemberInfoEntity memberInfoEntity = bizMemberInfoService.getById(memberId.intValue());
if (memberInfoEntity == null) { if (memberInfoEntity == null) {
throw new I18nMessageException("exception/user.does.not.exist"); throw new I18nMessageException("exception/user.does.not.exist");
} }
return memberInfoEntity.getNickName(); MemberInfoDto memberInfoDto = new MemberInfoDto();
memberInfoDto.setNickName(memberInfoEntity.getNickName());
memberInfoDto.setAvatarUrl(memberInfoEntity.getAvatarUrl());
return memberInfoDto;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment