|
|
@@ -1,8 +1,10 @@
|
|
|
package cn.seecoder.seecoderportalserver.web.rest;
|
|
|
-
|
|
|
+import cn.seecoder.seecoderportalcommon.enums.CommunicationSortStrategyEnum;
|
|
|
import cn.seecoder.seecoderportalcommon.vo.CommunicationVO;
|
|
|
+import cn.seecoder.seecoderportalcommon.vo.PageVO;
|
|
|
import cn.seecoder.seecoderportalcommon.vo.UserVO;
|
|
|
import cn.seecoder.seecoderportalserver.utility.OkResponse;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
@@ -16,53 +18,63 @@ import java.util.List;
|
|
|
@RequestMapping("/api/communication")
|
|
|
public class CommunicationController {
|
|
|
|
|
|
+ @ApiOperation("上传交流文件")
|
|
|
@PostMapping("/upload")
|
|
|
public OkResponse<UserVO> uploadCommunicationFile(@RequestParam MultipartFile file) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @GetMapping
|
|
|
- public OkResponse<List<CommunicationVO>> getAllCommunications(@RequestParam(value = "userId")Integer userId,
|
|
|
- @RequestParam(value = "page")Integer page,
|
|
|
- @RequestParam(value = "size")Integer size,
|
|
|
- @RequestParam(value = "sort")String sort){
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
+ @ApiOperation("发布交流")
|
|
|
@PostMapping
|
|
|
public OkResponse<CommunicationVO> postCommunication(@RequestBody CommunicationVO communicationVO){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/detail/{communicationId}")
|
|
|
+ @ApiOperation("获得单个交流详情")
|
|
|
+ @GetMapping("/{communicationId}")
|
|
|
public OkResponse<CommunicationVO> getCommunicationDetail(@PathVariable(value = "communicationId")Integer communicationId){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/{userId}")
|
|
|
- public OkResponse<List<CommunicationVO>> getUserCommunications(@PathVariable(value = "userId")Integer userId){
|
|
|
+ @ApiOperation("分页获取用户发布的交流")
|
|
|
+ @GetMapping("/users/{userId}")
|
|
|
+ public OkResponse<PageVO<CommunicationVO>> getCommunicationPageByUserId(@PathVariable(value = "userId")String userId,
|
|
|
+ @RequestParam(value = "page") Integer page,
|
|
|
+ @RequestParam(value = "size")Integer size){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/star")
|
|
|
- public OkResponse<Boolean> starCommunication(@RequestParam(value = "userId")Integer userId,
|
|
|
- @RequestParam(value = "communicationId")Integer communicationId){
|
|
|
+ @ApiOperation("分页获取交流列表")
|
|
|
+ @GetMapping
|
|
|
+ public OkResponse<PageVO<CommunicationVO>> getCommunicationPage(@RequestParam(value = "page") Integer page,
|
|
|
+ @RequestParam(value = "size")Integer size,
|
|
|
+ @RequestParam(value = "sort") CommunicationSortStrategyEnum sort){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/star")
|
|
|
- public OkResponse<List<CommunicationVO>> getStarCommunications(@RequestParam(value = "userId")Integer userId){
|
|
|
+
|
|
|
+ @ApiOperation("用户收藏交流")
|
|
|
+ @PostMapping("/{communicationId}/stars")
|
|
|
+ public OkResponse<Boolean> starCommunication(@PathVariable(value = "communicationId")Integer communicationId){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/star/cancel")
|
|
|
- public OkResponse<Boolean> cancelStarCommunication(@RequestParam(value = "userId")Integer userId,
|
|
|
- @RequestParam(value = "communicationId")Integer communicationId){
|
|
|
+ @ApiOperation("取消收藏交流")
|
|
|
+ @DeleteMapping("/{communicationId}/stars")
|
|
|
+ public OkResponse<Boolean> cancelStarCommunication(@PathVariable(value = "communicationId")Integer communicationId){
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/watchStarMan/{communicationId}")
|
|
|
- public OkResponse<List<UserVO>> watchStarMan(@PathVariable(value = "communicationId")Integer communicationId){
|
|
|
+ @ApiOperation("分页查看个人收藏夹")
|
|
|
+ @GetMapping("/stars/users/{userId}")
|
|
|
+ public OkResponse<PageVO<CommunicationVO>> getStarredCommunicationPage(@PathVariable(value = "userId") String userId){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("查看交流的收藏者")
|
|
|
+ @GetMapping("/{communicationId}/stars/users")
|
|
|
+ public OkResponse<List<UserVO>> starredUsers(@PathVariable(value = "communicationId")Integer communicationId){
|
|
|
return null;
|
|
|
}
|
|
|
}
|