|
@@ -20,7 +20,6 @@ import com.ruoyi.generator.vo.*;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.logging.log4j.util.Strings;
|
|
import org.apache.logging.log4j.util.Strings;
|
|
-import org.apache.poi.xssf.usermodel.XSSFPivotTable;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -85,7 +84,7 @@ public class CommunityArticleController extends BaseController {
|
|
private CommunityCollectionMapper communityCollectionMapper;
|
|
private CommunityCollectionMapper communityCollectionMapper;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- private CommunityTagMapper communityTagMapper;
|
|
|
|
|
|
+ private CommunityTagMapper communityTagMapper;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private CommunityCircleExpandMapper communityCircleExpandMapper;
|
|
private CommunityCircleExpandMapper communityCircleExpandMapper;
|
|
@@ -118,6 +117,7 @@ public class CommunityArticleController extends BaseController {
|
|
rspData.setMsg("查询成功");
|
|
rspData.setMsg("查询成功");
|
|
rspData.setRows(list);
|
|
rspData.setRows(list);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return rspData;
|
|
return rspData;
|
|
@@ -137,6 +137,7 @@ public class CommunityArticleController extends BaseController {
|
|
}
|
|
}
|
|
communityArticleService.insertCommunityArticle(communityArticle);
|
|
communityArticleService.insertCommunityArticle(communityArticle);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success("文章发布成功!");
|
|
return AjaxResult.success("文章发布成功!");
|
|
@@ -161,6 +162,7 @@ public class CommunityArticleController extends BaseController {
|
|
return success("删除成功!");
|
|
return success("删除成功!");
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return error("删除失败!");
|
|
return error("删除失败!");
|
|
@@ -175,6 +177,7 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityClasses = communityClassMapper.selectList(new QueryWrapper<CommunityClass>());
|
|
communityClasses = communityClassMapper.selectList(new QueryWrapper<CommunityClass>());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success(communityClasses);
|
|
return AjaxResult.success(communityClasses);
|
|
@@ -196,22 +199,23 @@ public class CommunityArticleController extends BaseController {
|
|
oneObject.put("oneName", circleName);
|
|
oneObject.put("oneName", circleName);
|
|
oneObject.put("oneId", communityCircleExpand.getId());
|
|
oneObject.put("oneId", communityCircleExpand.getId());
|
|
JSONArray twoArray = new JSONArray();
|
|
JSONArray twoArray = new JSONArray();
|
|
- List<CommunityCircle> classNameByCircleId = communityClassCircleMapper.getClassNameByCircleId(userId,id);
|
|
|
|
|
|
+ List<CommunityCircle> classNameByCircleId = communityClassCircleMapper.getClassNameByCircleId(userId, id);
|
|
// 将 List<CommunityCircle> 转换为 JSONArray
|
|
// 将 List<CommunityCircle> 转换为 JSONArray
|
|
for (CommunityCircle communityCircle : classNameByCircleId) {
|
|
for (CommunityCircle communityCircle : classNameByCircleId) {
|
|
JSONObject twoObject = new JSONObject();
|
|
JSONObject twoObject = new JSONObject();
|
|
twoObject.put("twoId", communityCircle.getId());
|
|
twoObject.put("twoId", communityCircle.getId());
|
|
twoObject.put("twoName", communityCircle.getCircleName());
|
|
twoObject.put("twoName", communityCircle.getCircleName());
|
|
twoObject.put("twoImg", communityCircle.getImageUrl());
|
|
twoObject.put("twoImg", communityCircle.getImageUrl());
|
|
- twoObject.put("isCare",communityCircle.getIsCare());
|
|
|
|
- twoObject.put("heat",communityCircle.getHeat());
|
|
|
|
|
|
+ twoObject.put("isCare", communityCircle.getIsCare());
|
|
|
|
+ twoObject.put("heat", communityCircle.getHeat());
|
|
twoArray.add(twoObject);
|
|
twoArray.add(twoObject);
|
|
}
|
|
}
|
|
oneObject.put("one", twoArray);
|
|
oneObject.put("one", twoArray);
|
|
sumArray.add(oneObject); // 添加到 sumArray
|
|
sumArray.add(oneObject); // 添加到 sumArray
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new ProjectException();
|
|
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
return AjaxResult.success(sumArray);
|
|
return AjaxResult.success(sumArray);
|
|
@@ -236,6 +240,7 @@ public class CommunityArticleController extends BaseController {
|
|
//新增评论
|
|
//新增评论
|
|
communityArticleService.sendComment(communityArticleComment);
|
|
communityArticleService.sendComment(communityArticleComment);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
@@ -254,6 +259,7 @@ public class CommunityArticleController extends BaseController {
|
|
//删除评论
|
|
//删除评论
|
|
communityArticleService.deleteComment(articleComment);
|
|
communityArticleService.deleteComment(articleComment);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
@@ -293,6 +299,7 @@ public class CommunityArticleController extends BaseController {
|
|
return AjaxResult.error(message);
|
|
return AjaxResult.error(message);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -343,6 +350,7 @@ public class CommunityArticleController extends BaseController {
|
|
return AjaxResult.error(message);
|
|
return AjaxResult.error(message);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -381,6 +389,7 @@ public class CommunityArticleController extends BaseController {
|
|
return AjaxResult.error(message);
|
|
return AjaxResult.error(message);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -434,6 +443,7 @@ public class CommunityArticleController extends BaseController {
|
|
message = "取消点赞";
|
|
message = "取消点赞";
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -452,6 +462,7 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityCircles = communityArticleService.selectCommunityCircleList(classId);
|
|
communityCircles = communityArticleService.selectCommunityCircleList(classId);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success(communityCircles);
|
|
return AjaxResult.success(communityCircles);
|
|
@@ -484,7 +495,7 @@ public class CommunityArticleController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
//为空返回空值
|
|
//为空返回空值
|
|
- if (communityCircles == null){
|
|
|
|
|
|
+ if (communityCircles == null) {
|
|
return AjaxResult.success("圈子为空");
|
|
return AjaxResult.success("圈子为空");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -500,6 +511,7 @@ public class CommunityArticleController extends BaseController {
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -546,6 +558,7 @@ public class CommunityArticleController extends BaseController {
|
|
msg = "已取关";
|
|
msg = "已取关";
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -575,6 +588,7 @@ public class CommunityArticleController extends BaseController {
|
|
msg = "已关注";
|
|
msg = "已关注";
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -591,6 +605,7 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityUserInfoVo = communityArticleService.selectCommunityUserInfoById(userId);
|
|
communityUserInfoVo = communityArticleService.selectCommunityUserInfoById(userId);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success(communityUserInfoVo);
|
|
return AjaxResult.success(communityUserInfoVo);
|
|
@@ -623,6 +638,7 @@ public class CommunityArticleController extends BaseController {
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
// e.printStackTrace();
|
|
// e.printStackTrace();
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -669,6 +685,7 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityUserLikeVos = communityArticleService.selectUserFansList(SecurityUtils.getLoginUser().getUserId());
|
|
communityUserLikeVos = communityArticleService.selectUserFansList(SecurityUtils.getLoginUser().getUserId());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -682,6 +699,7 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityUserLikeVos = communityArticleService.selectMutualAttention(SecurityUtils.getLoginUser().getUserId());
|
|
communityUserLikeVos = communityArticleService.selectMutualAttention(SecurityUtils.getLoginUser().getUserId());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -717,6 +735,7 @@ public class CommunityArticleController extends BaseController {
|
|
communityUserInfo.setBackImage(backImage);
|
|
communityUserInfo.setBackImage(backImage);
|
|
communityUserInfoMapper.updateById(communityUserInfo);
|
|
communityUserInfoMapper.updateById(communityUserInfo);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success("背景图片上传成功!");
|
|
return AjaxResult.success("背景图片上传成功!");
|
|
@@ -742,13 +761,11 @@ public class CommunityArticleController extends BaseController {
|
|
|
|
|
|
List<CommunityCollectionVo> communityCollectionVos = null;
|
|
List<CommunityCollectionVo> communityCollectionVos = null;
|
|
try {
|
|
try {
|
|
- communityCollectionVos = communityCollectionService.selectUserCollection(userId, articleId);
|
|
|
|
|
|
+ communityCollectionVos = communityCollectionService.selectUserCollection(userId, articleId);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
return AjaxResult.success(communityCollectionVos);
|
|
return AjaxResult.success(communityCollectionVos);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -792,6 +809,7 @@ public class CommunityArticleController extends BaseController {
|
|
communityCollection.setDelete(false);
|
|
communityCollection.setDelete(false);
|
|
communityCollectionService.save(communityCollection);
|
|
communityCollectionService.save(communityCollection);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -814,6 +832,7 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityCollectionService.deleteCollectionById(collectionId);
|
|
communityCollectionService.deleteCollectionById(collectionId);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success("删除成功!");
|
|
return AjaxResult.success("删除成功!");
|
|
@@ -900,6 +919,7 @@ public class CommunityArticleController extends BaseController {
|
|
collectionArticle.setCreateTime(DateUtils.parseDate(DateUtils.getTime()));
|
|
collectionArticle.setCreateTime(DateUtils.parseDate(DateUtils.getTime()));
|
|
communityCollectionService.addArticleToCollection(collectionArticle);
|
|
communityCollectionService.addArticleToCollection(collectionArticle);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -923,6 +943,7 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityCollectionService.deleteArticleToCollection(collectionId, articleId);
|
|
communityCollectionService.deleteArticleToCollection(collectionId, articleId);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success("文章删除成功!");
|
|
return AjaxResult.success("文章删除成功!");
|
|
@@ -936,15 +957,16 @@ public class CommunityArticleController extends BaseController {
|
|
*/
|
|
*/
|
|
@ApiOperation("查询用户合集")
|
|
@ApiOperation("查询用户合集")
|
|
@GetMapping("/getCollection")
|
|
@GetMapping("/getCollection")
|
|
- public AjaxResult getCollection(Long collectionId,Long searchType) {
|
|
|
|
|
|
+ public AjaxResult getCollection(Long collectionId, Long searchType) {
|
|
if (Objects.isNull(collectionId)) {
|
|
if (Objects.isNull(collectionId)) {
|
|
return AjaxResult.error("合集不存在!");
|
|
return AjaxResult.error("合集不存在!");
|
|
}
|
|
}
|
|
List<CommunityCollectionArticleVo> collectionArticleVos = null;
|
|
List<CommunityCollectionArticleVo> collectionArticleVos = null;
|
|
JSONArray jsonArray;
|
|
JSONArray jsonArray;
|
|
try {
|
|
try {
|
|
- jsonArray = communityCollectionService.selectArticleInfoInCollection(collectionId,searchType);
|
|
|
|
|
|
+ jsonArray = communityCollectionService.selectArticleInfoInCollection(collectionId, searchType);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
return AjaxResult.success(jsonArray);
|
|
return AjaxResult.success(jsonArray);
|
|
@@ -952,6 +974,7 @@ public class CommunityArticleController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 搜索关键字
|
|
* 搜索关键字
|
|
|
|
+ *
|
|
* @param content
|
|
* @param content
|
|
* @return 内容
|
|
* @return 内容
|
|
* fangqing
|
|
* fangqing
|
|
@@ -964,13 +987,15 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
trendingTops = communityArticleMapper.selectTrendingTopByContent(content);
|
|
trendingTops = communityArticleMapper.selectTrendingTopByContent(content);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
- return AjaxResult.success("获取成功!",trendingTops);
|
|
|
|
|
|
+ return AjaxResult.success("获取成功!", trendingTops);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 订阅/取订合集
|
|
* 订阅/取订合集
|
|
|
|
+ *
|
|
* @param collectionUser
|
|
* @param collectionUser
|
|
* @return 内容
|
|
* @return 内容
|
|
* fangqing
|
|
* fangqing
|
|
@@ -980,7 +1005,7 @@ public class CommunityArticleController extends BaseController {
|
|
@Transactional
|
|
@Transactional
|
|
//@Anonymous
|
|
//@Anonymous
|
|
public AjaxResult subscribeCollection(@RequestBody CommunityCollectionUser collectionUser) {
|
|
public AjaxResult subscribeCollection(@RequestBody CommunityCollectionUser collectionUser) {
|
|
- if (Objects.isNull(collectionUser.getCollectionId()) ) {
|
|
|
|
|
|
+ if (Objects.isNull(collectionUser.getCollectionId())) {
|
|
return AjaxResult.error("参数异常!");
|
|
return AjaxResult.error("参数异常!");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -988,10 +1013,11 @@ public class CommunityArticleController extends BaseController {
|
|
try {
|
|
try {
|
|
communityCollectionUser = communityCollectionUserService.subscribeCollection(collectionUser);
|
|
communityCollectionUser = communityCollectionUserService.subscribeCollection(collectionUser);
|
|
|
|
|
|
- if (communityCollectionUser == null){
|
|
|
|
|
|
+ if (communityCollectionUser == null) {
|
|
return AjaxResult.success("不能关注自己创建的合集/传参有误");
|
|
return AjaxResult.success("不能关注自己创建的合集/传参有误");
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1001,23 +1027,17 @@ public class CommunityArticleController extends BaseController {
|
|
|
|
|
|
@ApiOperation("获取个人中心信息")
|
|
@ApiOperation("获取个人中心信息")
|
|
@GetMapping("/userPrompt")
|
|
@GetMapping("/userPrompt")
|
|
- public AjaxResult userPrompt() {
|
|
|
|
|
|
+ public AjaxResult userPrompt(Long userId) {
|
|
|
|
|
|
- Long userId = SecurityUtils.getLoginUser().getUserId();
|
|
|
|
|
|
|
|
- CommunityUserPrompt communityUserPrompt = null;
|
|
|
|
|
|
+ List<CommunityUserPromptVo> communityUserPromptVo = null;
|
|
try {
|
|
try {
|
|
- communityUserPrompt = communityUserPromptMapper.selectOne(new QueryWrapper<CommunityUserPrompt>()
|
|
|
|
- .eq("create_by",userId));
|
|
|
|
-
|
|
|
|
- System.out.println(communityUserPrompt);
|
|
|
|
|
|
+ communityUserPromptVo = communityArticleService.selectCommunityUserPrompt(userId);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- e.printStackTrace();
|
|
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ throw new ProjectException();
|
|
}
|
|
}
|
|
- return AjaxResult.success(communityUserPrompt);
|
|
|
|
|
|
+ return AjaxResult.success(communityUserPromptVo);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|