提交 3f5e8ecc 作者: zhenjie

论坛审核通过发放积分

上级 f8250c93
package com.mmc.csf.user.vo;
import com.mmc.csf.release.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/10/17 17:24
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ChangeUserPointVO implements Serializable {
private static final long serialVersionUID = -1481188328848093579L;
@ApiModelProperty(value = "用户id", example = "1")
@NotNull(message = "用户id不能为空", groups = {Update.class})
private Integer userAccountId;
@ApiModelProperty(value = "变动类型", example = "1")
private Integer changeType;
@ApiModelProperty(value = "变动积分, 正加负减", example = "1")
@NotNull(message = "变动积分不能为空", groups = {Update.class})
private Integer changePoint;
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest;
@Api(tags = {"后台-论坛管理-模块"})
@RestController
@RequestMapping("/backstage/forum")
public class BackstageForumController {
public class BackstageForumController extends BaseController{
@Autowired
BackstageForumService backstageForumService;
......@@ -58,7 +58,7 @@ public class BackstageForumController {
@ApiOperation(value = "审核动态")
@GetMapping("/checkDynamic")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody checkDynamic(@RequestParam Integer dynamicId, @RequestParam Boolean status) {
return backstageForumService.checkDynamic(dynamicId, status);
public ResultBody checkDynamic(@RequestParam Integer dynamicId, @RequestParam Boolean status, HttpServletRequest request) {
return backstageForumService.checkDynamic(dynamicId, status, this.getUserLoginInfoFromRedis(request).getToken());
}
}
......@@ -6,6 +6,7 @@ import com.mmc.csf.infomation.dto.UserAccountSimpleDTO;
import com.mmc.csf.release.auth.qo.BUserAccountQO;
import com.mmc.csf.release.auth.qo.UserAccountQO;
import com.mmc.csf.release.feign.hystrix.UserAppApiHystrix;
import com.mmc.csf.user.vo.ChangeUserPointVO;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
......@@ -70,4 +71,6 @@ public interface UserAppApi {
@GetMapping(value = "/userapp/pilot/interiorDetailPilot")
public PilotCertificationInteriorDTO feignInteriorDetailPilot(@RequestParam(required = true) Integer userAccountId);
@PostMapping("/userapp/userPoint/change")
void changeUserPoint(@RequestBody ChangeUserPointVO changePoint, @RequestHeader("token") String token);
}
......@@ -19,6 +19,6 @@ public interface BackstageForumService {
ResultBody likeUserInfo(Integer dynamicId, HttpServletRequest request);
ResultBody checkDynamic(Integer dynamicId, Boolean status);
ResultBody checkDynamic(Integer dynamicId, Boolean status, String token);
}
......@@ -19,6 +19,7 @@ import com.mmc.csf.release.forum.dto.DynamicInfoDTO;
import com.mmc.csf.release.forum.qo.DynamicQO;
import com.mmc.csf.release.forum.vo.UserBaseInfoVO;
import com.mmc.csf.release.service.BackstageForumService;
import com.mmc.csf.user.vo.ChangeUserPointVO;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -180,7 +181,7 @@ public class BackstageForumServiceImpl implements BackstageForumService {
@Override
public ResultBody checkDynamic(Integer dynamicId, Boolean status) {
public ResultBody checkDynamic(Integer dynamicId, Boolean status, String token) {
if (status) {
//审核通过
dynamicDao.updateCheckDynamic(dynamicId, 1);
......@@ -200,6 +201,13 @@ public class BackstageForumServiceImpl implements BackstageForumService {
long count = ga.stream().filter(u -> u.getGambitId().equals(gambitDO.getId())).count();
dynamicDao.updateDiscussionCount(gambitDO.getId(),count);
}
ForumDynamicDO dynamicDO = dynamicDao.getDynamicInfoById(dynamicId);
// 论坛通过发积分
ChangeUserPointVO changePoint = new ChangeUserPointVO();
changePoint.setUserAccountId(dynamicDO.getUserAccountId());
changePoint.setChangeType(3);
changePoint.setChangePoint(5);
userAppApi.changeUserPoint(changePoint, token);
} else {
dynamicDao.updateCheckDynamic(dynamicId, 2);
List<DynamicGambitDO> gambitDOList= gambitDao.selectGambitDynamic(dynamicId);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论