|
@@ -730,7 +730,7 @@ public class CommunityArticleController extends BaseController {
|
|
|
@ApiOperation("获取用户信息")
|
|
|
@GetMapping("/userInfo")
|
|
|
@Anonymous
|
|
|
- public AjaxResult userInfo(@RequestParam(required = false) Long userId,@RequestParam(defaultValue = "true") boolean isToken) {
|
|
|
+ public AjaxResult userInfo(@RequestParam(required = false) Long userId,boolean isToken) {
|
|
|
if (Objects.isNull(userId)) {
|
|
|
userId = SecurityUtils.getLoginUser().getUserId();
|
|
|
|
|
@@ -744,7 +744,7 @@ public class CommunityArticleController extends BaseController {
|
|
|
|
|
|
CommunityUserInfoVo communityUserInfoVo = null;
|
|
|
try {
|
|
|
- communityUserInfoVo = communityArticleService.selectCommunityUserInfoById(userId, isToken);
|
|
|
+ communityUserInfoVo = communityArticleService.selectCommunityUserInfoById(userId,isToken);
|
|
|
} catch (Exception e) {
|
|
|
System.out.println(e.getMessage());
|
|
|
throw new ProjectException();
|
|
@@ -979,27 +979,6 @@ public class CommunityArticleController extends BaseController {
|
|
|
return AjaxResult.success(communityCollection);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 用户删除合集
|
|
|
- *
|
|
|
- * @param collectionId 合集id
|
|
|
- * @return 是否成功
|
|
|
- */
|
|
|
- @ApiOperation("用户删除合集")
|
|
|
- @DeleteMapping("/deleteCollection")
|
|
|
- @Transactional
|
|
|
- public AjaxResult deleteCollection(Long collectionId) {
|
|
|
- if (Objects.isNull(collectionId)) {
|
|
|
- return AjaxResult.error("参数异常!");
|
|
|
- }
|
|
|
- try {
|
|
|
- communityCollectionService.deleteCollectionById(collectionId);
|
|
|
- } catch (Exception e) {
|
|
|
- System.out.println(e.getMessage());
|
|
|
- throw new ProjectException();
|
|
|
- }
|
|
|
- return AjaxResult.success("删除成功!");
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 更新合集信息
|
|
@@ -1027,6 +1006,29 @@ public class CommunityArticleController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 用户删除合集
|
|
|
+ *
|
|
|
+ * @param collectionId 合集id
|
|
|
+ * @return 是否成功
|
|
|
+ */
|
|
|
+ @ApiOperation("用户删除合集")
|
|
|
+ @DeleteMapping("/deleteCollection")
|
|
|
+ @Transactional
|
|
|
+ public AjaxResult deleteCollection(Long collectionId) {
|
|
|
+ if (Objects.isNull(collectionId)) {
|
|
|
+ return AjaxResult.error("参数异常!");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ communityCollectionService.deleteCollectionById(collectionId);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ throw new ProjectException();
|
|
|
+ }
|
|
|
+ return AjaxResult.success("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 合集内新增文章
|
|
|
*
|
|
@@ -1147,7 +1149,7 @@ public class CommunityArticleController extends BaseController {
|
|
|
@ApiOperation("查询用户合集")
|
|
|
@GetMapping("/getCollection")
|
|
|
@Anonymous
|
|
|
- public AjaxResult getCollection(Long collectionId, Long searchType, @RequestParam(required = false) Long userId) {
|
|
|
+ public AjaxResult getCollection(Long collectionId, Long searchType,@RequestParam(required = false) Long userId) {
|
|
|
if (Objects.isNull(collectionId)) {
|
|
|
return AjaxResult.error("合集不存在!");
|
|
|
}
|
|
@@ -1159,7 +1161,7 @@ public class CommunityArticleController extends BaseController {
|
|
|
List<CommunityCollectionArticleVo> collectionArticleVos = null;
|
|
|
JSONArray jsonArray;
|
|
|
try {
|
|
|
- jsonArray = communityCollectionService.selectArticleInfoInCollection(userId, collectionId, searchType);
|
|
|
+ jsonArray = communityCollectionService.selectArticleInfoInCollection(userId,collectionId, searchType);
|
|
|
} catch (Exception e) {
|
|
|
System.out.println(e.getMessage());
|
|
|
throw new ProjectException();
|
|
@@ -1234,6 +1236,25 @@ public class CommunityArticleController extends BaseController {
|
|
|
}
|
|
|
return AjaxResult.success(communityUserPromptVo);
|
|
|
}
|
|
|
+ @ApiOperation("个人未加入集合文章")
|
|
|
+ @GetMapping("/userNoCo")
|
|
|
+ @Anonymous
|
|
|
+ public AjaxResult userNoCo(@RequestParam(required = false) Long userId) {
|
|
|
+ int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
|
|
+ int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
|
|
+ int searchType = Convert.toInt(ServletUtils.getParameter("searchType"), 0);
|
|
|
+ List<CommunityArticleVo> communityArticleVos = null;
|
|
|
+ if (userId == null) {
|
|
|
+ userId = SecurityUtils.getUserId();
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ communityArticleVos = communityArticleService.selectUserNoCo(userId, pageNum, pageSize, searchType);
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ throw new ProjectException();
|
|
|
+ }
|
|
|
+ return AjaxResult.success(communityArticleVos);
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation("个人喜欢文章")
|
|
|
@GetMapping("/userLike")
|