|
|
@ -4,11 +4,14 @@ import annotation.GlobalInterceptor;
|
|
|
|
import annotation.VerifyParam;
|
|
|
|
import annotation.VerifyParam;
|
|
|
|
import api.Result;
|
|
|
|
import api.Result;
|
|
|
|
import com.luoo.user.service.UserCollectInfoService;
|
|
|
|
import com.luoo.user.service.UserCollectInfoService;
|
|
|
|
|
|
|
|
import com.luoo.user.service.UserPointLogService;
|
|
|
|
|
|
|
|
import constants.TaskPointIdConstants;
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
import dto.UserLoginDto;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import util.JwtUtil;
|
|
|
|
import util.JwtUtil;
|
|
|
@ -17,44 +20,56 @@ import util.JwtUtil;
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/collect")
|
|
|
|
@RequestMapping("/collect")
|
|
|
|
public class UserCollectController {
|
|
|
|
public class UserCollectController {
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private JwtUtil jwtUtil;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private JwtUtil jwtUtil;
|
|
|
|
private UserCollectInfoService userCollectInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
//@ApiOperation(value = "1.喜欢歌曲/收藏期刊/关注/黑名单/点赞")
|
|
|
|
private UserCollectInfoService userCollectInfoService;
|
|
|
|
@ApiOperation(value = "1.喜欢歌曲/收藏期刊/关注/黑名单")
|
|
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@Autowired
|
|
|
|
//@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单/点赞评论的id", required = true),
|
|
|
|
private UserPointLogService userPointLogService;
|
|
|
|
//@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:点赞", required = true) })
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单的id", required = true),
|
|
|
|
//@ApiOperation(value = "1.喜欢歌曲/收藏期刊/关注/黑名单/点赞")
|
|
|
|
@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:粉丝,5:点赞,6:专辑", required = true) })
|
|
|
|
@ApiOperation(value = "1.喜欢歌曲/收藏期刊/关注/黑名单")
|
|
|
|
@PostMapping
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
//@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单/点赞评论的id", required = true),
|
|
|
|
public Result<Void> addCollect(@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
//@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:点赞", required = true) })
|
|
|
|
@VerifyParam(required = true) @RequestParam("objectId") String objectId,
|
|
|
|
@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单的id", required = true),
|
|
|
|
@VerifyParam(required = true) @RequestParam("collectType") Integer collectType) {
|
|
|
|
@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:粉丝,5:点赞,6:专辑", required = true)})
|
|
|
|
UserLoginDto loginDto = jwtUtil.getUserLoginDto(authorization);
|
|
|
|
@PostMapping
|
|
|
|
//userCollectService.saveCollect(loginDto.getUserId(), objectId, collectType);
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
userCollectInfoService.saveCollect(loginDto.getUserId(), objectId, collectType);
|
|
|
|
public Result<Void> addCollect(
|
|
|
|
return Result.success();
|
|
|
|
@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
}
|
|
|
|
@VerifyParam(required = true) @RequestParam("objectId") String objectId,
|
|
|
|
|
|
|
|
@VerifyParam(required = true) @RequestParam("collectType") Integer collectType) {
|
|
|
|
//@ApiOperation(value = "2.取消 喜欢歌曲/收藏期刊/关注/黑名单/点赞")
|
|
|
|
UserLoginDto loginDto = jwtUtil.getUserLoginDto(authorization);
|
|
|
|
@ApiOperation(value = "2.取消 喜欢歌曲/收藏期刊/关注/黑名单/粉丝")
|
|
|
|
//userCollectService.saveCollect(loginDto.getUserId(), objectId, collectType);
|
|
|
|
@ApiImplicitParams({
|
|
|
|
userCollectInfoService.saveCollect(loginDto.getUserId(), objectId, collectType);
|
|
|
|
//@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单/点赞评论的id", required = true),
|
|
|
|
|
|
|
|
//@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:点赞", required = true) })
|
|
|
|
if(Objects.equals(collectType, 2)) {
|
|
|
|
@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单/粉丝的id", required = true),
|
|
|
|
// 初次关注某用户
|
|
|
|
@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:粉丝,5:点赞,6:专辑", required = true) })
|
|
|
|
userPointLogService.addByTaskNew(TaskPointIdConstants.SUCCESS_FOLLOW_ONE_USER, authorization);
|
|
|
|
@DeleteMapping
|
|
|
|
}
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
return Result.success();
|
|
|
|
public Result<Void> cancelCollect(@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
}
|
|
|
|
@VerifyParam(required = true) @RequestParam("objectId") String objectId,
|
|
|
|
|
|
|
|
@VerifyParam(required = true) @RequestParam("collectType") Integer collectType) {
|
|
|
|
//@ApiOperation(value = "2.取消 喜欢歌曲/收藏期刊/关注/黑名单/点赞")
|
|
|
|
UserLoginDto loginDto = jwtUtil.getUserLoginDto(authorization);
|
|
|
|
@ApiOperation(value = "2.取消 喜欢歌曲/收藏期刊/关注/黑名单/粉丝")
|
|
|
|
userCollectInfoService.cancelCollect(loginDto.getUserId(), objectId, collectType);
|
|
|
|
@ApiImplicitParams({
|
|
|
|
//userCollectService.deleteByUserIdAndObjectIdAndCollectType(loginDto.getUserId(), objectId,collectType);
|
|
|
|
//@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单/点赞评论的id", required = true),
|
|
|
|
return Result.success();
|
|
|
|
//@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:点赞", required = true) })
|
|
|
|
}
|
|
|
|
@ApiImplicitParam(name = "objectId", value = "喜欢歌曲/收藏期刊/关注某用户/某用户列入黑名单/粉丝的id", required = true),
|
|
|
|
|
|
|
|
@ApiImplicitParam(name = "collectType", value = "0:歌曲,1:期刊,2:关注,3:黑名单,4:粉丝,5:点赞,6:专辑", required = true)})
|
|
|
|
|
|
|
|
@DeleteMapping
|
|
|
|
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
|
|
|
|
public Result<Void> cancelCollect(
|
|
|
|
|
|
|
|
@RequestHeader(value = "Authorization", required = true) String authorization,
|
|
|
|
|
|
|
|
@VerifyParam(required = true) @RequestParam("objectId") String objectId,
|
|
|
|
|
|
|
|
@VerifyParam(required = true) @RequestParam("collectType") Integer collectType) {
|
|
|
|
|
|
|
|
UserLoginDto loginDto = jwtUtil.getUserLoginDto(authorization);
|
|
|
|
|
|
|
|
userCollectInfoService.cancelCollect(loginDto.getUserId(), objectId, collectType);
|
|
|
|
|
|
|
|
//userCollectService.deleteByUserIdAndObjectIdAndCollectType(loginDto.getUserId(), objectId,collectType);
|
|
|
|
|
|
|
|
return Result.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|