|
@@ -326,4 +326,23 @@ public class CpsPopularizeController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 更新推荐海报状态
|
|
|
|
|
+ */
|
|
|
|
|
+ @PutMapping("/update/recommend/status")
|
|
|
|
|
+ public Result<String> updateRecommendStatus() {
|
|
|
|
|
+ long cpsUserId = StpCpsManageUser.getLoginIdAsLong();
|
|
|
|
|
+
|
|
|
|
|
+ UserDistribute userDistribute = userDistributeMapper.selectOne(Wrappers.lambdaQuery(UserDistribute.class)
|
|
|
|
|
+ .eq(UserDistribute::getUserId, cpsUserId)
|
|
|
|
|
+ .eq(UserDistribute::getDeleted, 1)
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (userDistribute != null) {
|
|
|
|
|
+ Boolean isPoster = userDistribute.getIsPoster();
|
|
|
|
|
+ userDistributeMapper.update(null, Wrappers.lambdaUpdate(UserDistribute.class)
|
|
|
|
|
+ .set(UserDistribute::getIsPoster, !isPoster)
|
|
|
|
|
+ .eq(UserDistribute::getId, userDistribute.getId()));
|
|
|
|
|
+ }
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|