|
|
|
@ -1,18 +1,25 @@
|
|
|
|
|
package com.luoo.user.controller;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import annotation.GlobalInterceptor;
|
|
|
|
|
import annotation.VerifyParam;
|
|
|
|
|
import api.PageResult;
|
|
|
|
|
import api.Result;
|
|
|
|
|
import api.StatusCode;
|
|
|
|
|
import com.github.houbb.sensitive.word.bs.SensitiveWordBs;
|
|
|
|
|
import com.luoo.user.dao.UserMessageDao;
|
|
|
|
|
import com.luoo.user.dto.FeedbackImage;
|
|
|
|
|
import com.luoo.user.dto.TotalCommentVo;
|
|
|
|
|
import com.luoo.user.dto.*;
|
|
|
|
|
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.pojo.*;
|
|
|
|
|
import com.luoo.user.service.*;
|
|
|
|
|
import com.luoo.user.util.EmojiConverterUtil;
|
|
|
|
|
import com.luoo.user.util.IpUtil;
|
|
|
|
|
import constants.Constants;
|
|
|
|
|
import controller.BaseController;
|
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
|
import enums.*;
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
@ -26,46 +33,19 @@ import org.springframework.data.mongodb.core.aggregation.AggregationResults;
|
|
|
|
|
import org.springframework.data.mongodb.core.query.Criteria;
|
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import constants.Constants;
|
|
|
|
|
import controller.BaseController;
|
|
|
|
|
|
|
|
|
|
import com.luoo.user.dto.UserInfoUpdateDto;
|
|
|
|
|
import com.luoo.user.dto.response.UserRespDTO;
|
|
|
|
|
import com.luoo.user.util.EmojiConverterUtil;
|
|
|
|
|
import com.luoo.user.util.IpUtil;
|
|
|
|
|
|
|
|
|
|
import annotation.GlobalInterceptor;
|
|
|
|
|
import annotation.VerifyParam;
|
|
|
|
|
import api.PageResult;
|
|
|
|
|
import api.Result;
|
|
|
|
|
import api.StatusCode;
|
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
|
import enums.CollectTypeEnum;
|
|
|
|
|
import enums.DateTimePatternEnum;
|
|
|
|
|
import enums.RequestFrequencyTypeEnum;
|
|
|
|
|
import enums.UserBadgeEnum;
|
|
|
|
|
import enums.UserRelationEnum;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
import util.DateUtil;
|
|
|
|
|
import util.IdWorker;
|
|
|
|
|
import util.ScaleFilter;
|
|
|
|
|
import util.StringTools;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@CrossOrigin
|
|
|
|
|
@RequestMapping("/my")
|
|
|
|
@ -293,6 +273,7 @@ public class MyController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
return files.stream().map(this::getFeedbackImage).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private FeedbackImage getFeedbackImage(MultipartFile multipartFile) {
|
|
|
|
|
FeedbackImage feedbackImage = new FeedbackImage();
|
|
|
|
|
try {
|
|
|
|
@ -403,7 +384,6 @@ public class MyController extends BaseController {
|
|
|
|
|
List<PublicationLike> list = pageList.stream().parallel().map(x -> getPublicationLike(x)).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Result.success(new PageResult<PublicationLike>(Long.valueOf(list.size()), list));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -418,6 +398,7 @@ public class MyController extends BaseController {
|
|
|
|
|
|
|
|
|
|
return publicationLike;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询我收到的评论
|
|
|
|
|
@ApiOperation(value = "10.查询我收到的评论分页列表", notes = "游客无法获取")
|
|
|
|
|
@GetMapping("/myCommentReplyList/{page}/{size}")
|
|
|
|
@ -565,7 +546,34 @@ public class MyController extends BaseController {
|
|
|
|
|
userInfoService.update(userInfo);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Integer getIndex(UserInfo u) {
|
|
|
|
|
return Integer.valueOf(Arrays.stream(u.getBadges().split(",")).filter(s -> s.startsWith(String.valueOf(UserBadgeEnum.CONTRIBUTOR.getCode()))).findFirst().get().split("_")[1]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "15.1 提交实名认证")
|
|
|
|
|
@PostMapping("/approve/real/name")
|
|
|
|
|
public Result<Void> approveRealName(@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@Validated @RequestBody UserRealNameFormDto userRealNameFormDto) {
|
|
|
|
|
userInfoService.approveRealName(authorization, userRealNameFormDto);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "15.2 审核实名认证")
|
|
|
|
|
@PostMapping("/check/real/name")
|
|
|
|
|
public Result<Void> checkRealName(@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@Validated @RequestBody UserRealNameCheckDto userRealNameCheckDto) {
|
|
|
|
|
userInfoService.checkRealName(authorization, userRealNameCheckDto);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "15.3 审核实名解绑")
|
|
|
|
|
@PostMapping("/unbind/real/name/{id}")
|
|
|
|
|
public Result<Void> realNameCheck(@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
@PathVariable String id) {
|
|
|
|
|
userInfoService.unBindRealName(authorization, id);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|