release: 1.1 根据邀请码获取用户部分信息

release-2024-04-25
huangyw 1 month ago
parent dc05223d61
commit 46e7cf56f8

@ -38,6 +38,7 @@ public class ErrorConstants {
public final static String USER_ALREADY_EXISTS_ARTIST = "用户已发起过音乐人审核";
public final static String USER_STATUS_ERROR = "用户状态错误";
public final static String USER_NAME_ALREADY_EXISTS = "用户名已存在";
public final static String USER_INVITE_CODE_NOT_EXIST = "邀请码不存在";
// 会员部分
public static final String MEMBERSHIP_CODE_NOT_EXISTS = "会员码不存在";

@ -18,8 +18,10 @@ import com.luoo.user.pojo.*;
import com.luoo.user.service.*;
import com.luoo.user.util.EmojiConverterUtil;
import com.luoo.user.util.IpUtil;
import com.luoo.user.vo.userinfo.UserInfoForInviteVO;
import com.luoo.user.vo.userinfo.UserinfoShippingAddressAppVO;
import constants.Constants;
import constants.ErrorConstants;
import constants.TaskPointIdConstants;
import controller.BaseController;
import dto.UserLoginDto;
@ -132,6 +134,17 @@ public class MyController extends BaseController {
return Result.success(userRespDTO);
}
@ApiOperation(value = "1.1 根据邀请码获取用户部分信息", notes = "无认证")
@GetMapping("/userInfo/invite")
public Result<UserInfoForInviteVO> getUserInfoForInvite(String inviteCode) {
UserInfo userInfoByInvitationCode = userInfoService.getUserInfoByInvitationCode(inviteCode);
if(userInfoByInvitationCode != null) {
return Result.success(new UserInfoForInviteVO(userInfoByInvitationCode.getNickName(), userInfoByInvitationCode.getAvatar(), inviteCode));
} else {
return Result.failed(ErrorConstants.USER_INVITE_CODE_NOT_EXIST);
}
}
@ApiOperation(value = "2.更新个人信息", notes = "游客无法编辑个人信息")
@PutMapping("/userInfo")
@GlobalInterceptor(checkAppUserLogin = true)

@ -907,4 +907,14 @@ public class UserInfoService {
public List<UserInfo> getExpireVipList() {
return userInfoDao.getExpireVipList();
}
/**
*
*
* @param invitationCode
* @return
*/
public UserInfo getUserInfoByInvitationCode(String invitationCode) {
return userInfoDao.findByInvitationCode(invitationCode);
}
}

@ -0,0 +1,31 @@
package com.luoo.user.vo.userinfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @program: luoo_parent
* @description: h5
* @author: yawei.huang
* @create: 2024-10-10 08:14
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserInfoForInviteVO implements Serializable {
private static final long serialVersionUID = -3383281434773850094L;
@ApiModelProperty(value = "用户昵称")
private String nickName;
@ApiModelProperty(value = "用户头像")
private String avatar;
@ApiModelProperty(value = "邀请码")
private String inviteCode;
}
Loading…
Cancel
Save