ActivityController.java
3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package com.example.client.controller;
import cn.bronet.admin.common.core.domain.AjaxResult;
import com.example.client.domain.bo.CActivityBo;
import com.example.client.service.ActivityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* Created with IDEA
* author: MaDongXu
* Date:2021/9/10
* Time:10:12
* */
@Slf4j
@Validated
@Api(tags = "我的活动,视频,作品,风采,文章")
@RestController
@RequestMapping("/tree/activity")
public class ActivityController {
@Autowired
private ActivityService activityService;
@ApiImplicitParam(name = "type",value = "动态的类型",dataType = "Integer",required = true,paramType = "query")
@ApiOperation("发布动态的初始化页面")
@GetMapping("/sendActivity")
public AjaxResult sendActivity(Integer type){
return activityService.sendActivity(type);
}
@ApiOperation("存储用户发布动态")
@PostMapping("/saveActivity")
public AjaxResult saveActivity(@RequestBody CActivityBo bo){
log.info("CActivityBo::"+bo.toString());
return activityService.saveActivity(bo);
}
@ApiImplicitParam(name="activityId", value="动态ID",dataType="Long",required = true,paramType = "query")
@ApiOperation("删除用户发布的动态和动态下的所有评论")
@DeleteMapping("/deleteActivity")
public AjaxResult deleteActivity(Long activityId){
log.info("<<<<<<<activityId::"+activityId);
return activityService.deleteActivity(activityId);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "type",value = "动态类型",dataType = "Integer",required = true,paramType = "query"),
@ApiImplicitParam(name = "userId",value = "用户ID",dataType = "Long",required = false,paramType = "query")})
@ApiOperation("查询用户的动态")
@PostMapping("/selectActivities")
public AjaxResult selectActivity(Integer type,Long userId){
log.info("<<<<<<<type::"+type+",userId::"+userId);
return activityService.selectActivities(type,userId);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "typeId",value = "动态的种类",required = true,dataType = "Intefer",paramType = "query")
})
@ApiOperation("首页的动态查询")
@PostMapping("/selectAllActivities")
public AjaxResult selectAllActivity(Integer typeId){
log.info("<<<<<<typeId::"+typeId);
return activityService.selectAllActivities(typeId);
}
@ApiOperation("查看单条动态")
@PostMapping("/selectActivity")
public AjaxResult selectActivity(Long activityId){
log.info("<<<接收的参数<<<::"+activityId);
return activityService.selectActivity(activityId);
}
@ApiOperation("查询学校")
@PostMapping("/getSchools")
public AjaxResult getSchools(){
return activityService.getSchool();
}
@ApiOperation("动态的种类")
@PostMapping("/getActivityType")
public AjaxResult getActivityType(){
return activityService.getActivityType();
}
@ApiOperation("模糊查询动态")
@PostMapping("/searchActivities")
public AjaxResult searchActivities(String title){
log.info("<<<接收到的信息<<<::"+title);
return activityService.searchActivities(title);
}
}