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
package com.tanpu.community.controller;
import com.tanpu.community.api.beans.ThemeDTO;
import com.tanpu.community.controller.convert.ThemeConvert;
import com.tanpu.community.dao.entity.community.ThemeEntity;
import com.tanpu.community.manager.ThemeManager;
import com.tanpu.community.service.FansRelService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Slf4j
@RequestMapping(value = "/api/theme")
public class ThemeController {
@Autowired
private ThemeManager themeManager;
@Autowired
private FansRelService fansRelService;
@ApiOperation("新增主题")
@RequestMapping(value = "/add")
@ResponseBody
public String insertTheme(@RequestBody ThemeDTO themeDTO){
String userId="liujm";
themeDTO.setAuthorId(userId);
themeManager.insert(ThemeConvert.convertToEntity(themeDTO));
return "success";
}
@ApiOperation("系统推荐主题列表")
@RequestMapping(value = "/add")
@ResponseBody
public List<ThemeEntity> selectHotList(){
return null;
}
@ApiOperation("用户关注主题列表")
@RequestMapping(value = "/add")
@ResponseBody
public List<ThemeEntity> selectInterestList(){
String userId="liujm012";
return null;
}
@ApiOperation("评论")
@RequestMapping(value = "/comment")
@ResponseBody
public String commetOnTheme(String themeId,String commet){
String user="liujm";
themeManager.comment(themeId,user,commet);
return "success";
}
@ApiOperation("转发主题")
@RequestMapping(value = "/forward")
@ResponseBody
public String forwardTheme(String themeId){
return "success";
}
@ApiOperation("点赞主题")
@RequestMapping(value = "/like")
@ResponseBody
public String likeOnTheme(String themeId){
String user="liujm";
themeManager.like(themeId,user);
return "success";
}
@ApiOperation("分享主题")
@RequestMapping(value = "/share")
@ResponseBody
public String shareTheme(String themeId){
return "success";
}
@ApiOperation("收藏主题")
@RequestMapping(value = "/book")
@ResponseBody
public String bookTheme(String themeId){
String user="liujm";
themeManager.book(themeId,user);
return "success";
}
@ApiOperation("举报主题")
@RequestMapping(value = "/complaint")
@ResponseBody
public String complaintTheme(String themeId){
return "success";
}
@ApiOperation("屏蔽")
@RequestMapping(value = "/conceal")
@ResponseBody
public String concealTheme(String themeId){
return "success";
}
}