|
|
|
@ -12,10 +12,13 @@ import com.luoo.user.dto.bank.UserBankAddDto;
|
|
|
|
|
import com.luoo.user.dto.request.LoginReq;
|
|
|
|
|
import com.luoo.user.dto.request.LogoffReq;
|
|
|
|
|
import com.luoo.user.dto.response.UserRespDTO;
|
|
|
|
|
import com.luoo.user.dto.userinfo.UserinfoShippingAddressAddDTO;
|
|
|
|
|
import com.luoo.user.dto.userinfo.UserinfoShippingAddressUpdateDTO;
|
|
|
|
|
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.UserinfoShippingAddressAppVO;
|
|
|
|
|
import constants.Constants;
|
|
|
|
|
import constants.TaskPointIdConstants;
|
|
|
|
|
import controller.BaseController;
|
|
|
|
@ -88,6 +91,9 @@ public class MyController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserPointLogService userPointLogService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserinfoShippingAddressService userinfoShippingAddressService;
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "1.获取个人信息", notes = "游客无法获取个人信息")
|
|
|
|
|
@GetMapping("/userInfo")
|
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
@ -110,7 +116,7 @@ public class MyController extends BaseController {
|
|
|
|
|
userRespDTO.setPoint(user.getPoint());
|
|
|
|
|
|
|
|
|
|
String invitationUserId = user.getInvitationUserId();
|
|
|
|
|
if(StringUtils.isNotEmpty(invitationUserId)) {
|
|
|
|
|
if (StringUtils.isNotEmpty(invitationUserId)) {
|
|
|
|
|
UserInfo myInvitationUser = userInfoService.findById(invitationUserId);
|
|
|
|
|
userRespDTO.setInvitationUserId(myInvitationUser.getId());
|
|
|
|
|
userRespDTO.setInvitationCode(myInvitationUser.getInvitationCode());
|
|
|
|
@ -157,7 +163,7 @@ public class MyController extends BaseController {
|
|
|
|
|
// 修改了性别
|
|
|
|
|
boolean isChangeSex = !Objects.equals(userInfoUpdateDto.getSex(), user.getSex());
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(userInfoUpdateDto.getInvitationCode()) && StringUtils.isBlank(user.getInvitationUserId())) {
|
|
|
|
|
if (StringUtils.isNotBlank(userInfoUpdateDto.getInvitationCode()) && StringUtils.isBlank(user.getInvitationUserId())) {
|
|
|
|
|
// 只有没有被邀请过的才会触发,再次修改无效
|
|
|
|
|
userInfoService.bindInvitationCode(user, userInfoUpdateDto.getInvitationCode());
|
|
|
|
|
}
|
|
|
|
@ -184,22 +190,22 @@ public class MyController extends BaseController {
|
|
|
|
|
userInfoService.update(user);
|
|
|
|
|
|
|
|
|
|
List<String> resultList = new ArrayList<>();
|
|
|
|
|
if(isChangeNickName) {
|
|
|
|
|
if (isChangeNickName) {
|
|
|
|
|
// 修改了昵称
|
|
|
|
|
Integer point = userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_NICKNAME, authorization);
|
|
|
|
|
resultList.add("修改了昵称,积分增加" + point + "分");
|
|
|
|
|
}
|
|
|
|
|
if(isChangeSignature) {
|
|
|
|
|
if (isChangeSignature) {
|
|
|
|
|
// 修改了签名
|
|
|
|
|
Integer point = userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_SIGNATURE, authorization);
|
|
|
|
|
resultList.add("修改了签名,积分增加" + point + "分");
|
|
|
|
|
}
|
|
|
|
|
if(isChangeBirthDay) {
|
|
|
|
|
if (isChangeBirthDay) {
|
|
|
|
|
// 修改了生日
|
|
|
|
|
Integer point = userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_BIRTHDAY, authorization);
|
|
|
|
|
resultList.add("修改了签名,积分增加" + point + "分");
|
|
|
|
|
}
|
|
|
|
|
if(isChangeSex) {
|
|
|
|
|
if (isChangeSex) {
|
|
|
|
|
// 修改了性别
|
|
|
|
|
Integer point = userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_SEX, authorization);
|
|
|
|
|
resultList.add("修改了签名,积分增加" + point + "分");
|
|
|
|
@ -632,7 +638,7 @@ public class MyController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
String userId = userLoginDto.getUserId();
|
|
|
|
|
UserInfo userInfo = userInfoService.findById(userId);
|
|
|
|
|
if(Objects.equals(userInfo.getVipStatus(), UserVipStatusEnum.ACTIVE.getCode()) || Objects.equals(userInfo.getVipStatus(), UserVipStatusEnum.LIFE.getCode())) {
|
|
|
|
|
if (Objects.equals(userInfo.getVipStatus(), UserVipStatusEnum.ACTIVE.getCode()) || Objects.equals(userInfo.getVipStatus(), UserVipStatusEnum.LIFE.getCode())) {
|
|
|
|
|
userInfo.setEnableComment(flag);
|
|
|
|
|
userInfoService.update(userInfo);
|
|
|
|
|
return Result.success();
|
|
|
|
@ -755,5 +761,43 @@ public class MyController extends BaseController {
|
|
|
|
|
return Result.success(userInfoService.createInvitationCode(authorization));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "19.1 获取用户收货地址列表")
|
|
|
|
|
@GetMapping("/address/list")
|
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
|
public Result<List<UserinfoShippingAddressAppVO>> getUserinfoShippingAddressList(
|
|
|
|
|
@ApiParam(value = "用户token", required = true) @RequestHeader(value = "Authorization", required = true) String authorization) {
|
|
|
|
|
return Result.success(userinfoShippingAddressService.getUserinfoShippingAddressList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "19.2 添加用户收货地址")
|
|
|
|
|
@PostMapping("/address/add")
|
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
|
public Result<Void> addUserinfoShippingAddress(
|
|
|
|
|
@ApiParam(value = "用户token", required = true) @RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@ApiParam(value = "添加用户收货地址对象", required = true) @Validated @RequestBody UserinfoShippingAddressAddDTO userinfoShippingAddressAddDTO) {
|
|
|
|
|
userinfoShippingAddressService.add(userinfoShippingAddressAddDTO);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "19.3 删除用户收货地址")
|
|
|
|
|
@PostMapping("/address/del/{id}")
|
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
|
public Result<Void> delUserinfoShippingAddress(
|
|
|
|
|
@ApiParam(value = "用户token", required = true) @RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@ApiParam(value = "用户收货地址id", required = true) @PathVariable String id) {
|
|
|
|
|
userinfoShippingAddressService.delete(id);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "19.4 修改用户收货地址")
|
|
|
|
|
@PostMapping("/address/update")
|
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
|
public Result<Void> updateUserinfoShippingAddress(
|
|
|
|
|
@ApiParam(value = "用户token", required = true) @RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@ApiParam(value = "修改用户收货地址对象", required = true) @Validated @RequestBody UserinfoShippingAddressUpdateDTO userinfoShippingAddressUpdateDTO) {
|
|
|
|
|
userinfoShippingAddressService.update(userinfoShippingAddressUpdateDTO);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|