Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
38135eb8
Commit
38135eb8
authored
Jun 16, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
service规范fix
parent
2de37d0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
24 deletions
+17
-24
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+2
-2
TopicController.java
.../java/com/tanpu/community/controller/TopicController.java
+2
-5
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+13
-17
No files found.
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
38135eb8
...
@@ -38,14 +38,14 @@ public class ThemeController {
...
@@ -38,14 +38,14 @@ public class ThemeController {
}
}
@ApiOperation
(
"系统推荐主题列表"
)
@ApiOperation
(
"系统推荐主题列表"
)
@RequestMapping
(
value
=
"/
add
"
)
@RequestMapping
(
value
=
"/
recmend_list
"
)
@ResponseBody
@ResponseBody
public
List
<
ThemeEntity
>
selectHotList
(){
public
List
<
ThemeEntity
>
selectHotList
(){
return
null
;
return
null
;
}
}
@ApiOperation
(
"用户关注主题列表"
)
@ApiOperation
(
"用户关注主题列表"
)
@RequestMapping
(
value
=
"/
add
"
)
@RequestMapping
(
value
=
"/
interest_list
"
)
@ResponseBody
@ResponseBody
public
List
<
ThemeEntity
>
selectInterestList
(){
public
List
<
ThemeEntity
>
selectInterestList
(){
String
userId
=
"liujm012"
;
String
userId
=
"liujm012"
;
...
...
community-service/src/main/java/com/tanpu/community/controller/TopicController.java
View file @
38135eb8
package
com
.
tanpu
.
community
.
controller
;
package
com
.
tanpu
.
community
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.gson.JsonObject
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.controller.convert.TopicConverter
;
import
com.tanpu.community.controller.convert.TopicConverter
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.manager.TopicManager
;
import
com.tanpu.community.manager.TopicManager
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Value
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -26,7 +23,7 @@ public class TopicController {
...
@@ -26,7 +23,7 @@ public class TopicController {
@Autowired
@Autowired
private
TopicManager
topicManager
;
private
TopicManager
topicManager
;
@PostMapping
(
value
=
"/queryTopicList"
)
@PostMapping
(
value
=
"/queryTopic
Detail
List"
)
@ApiOperation
(
"查询所有的主题详情"
)
@ApiOperation
(
"查询所有的主题详情"
)
@ResponseBody
@ResponseBody
public
List
<
TopicDTO
>
getAllTopicList
(
@RequestBody
String
content
){
public
List
<
TopicDTO
>
getAllTopicList
(
@RequestBody
String
content
){
...
@@ -37,7 +34,7 @@ public class TopicController {
...
@@ -37,7 +34,7 @@ public class TopicController {
return
topicDTOS
;
return
topicDTOS
;
}
}
@PostMapping
(
value
=
"/queryTopicList"
)
@PostMapping
(
value
=
"/queryTopic
Name
List"
)
@ApiOperation
(
"查询所有的主题名称列表"
)
@ApiOperation
(
"查询所有的主题名称列表"
)
@ResponseBody
@ResponseBody
public
List
<
String
>
getTopicNameList
(
@RequestBody
String
content
){
public
List
<
String
>
getTopicNameList
(
@RequestBody
String
content
){
...
...
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
38135eb8
package
com
.
tanpu
.
community
.
service
;
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.
Lambda
UpdateWrapper
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.mapper.community.TopicMapper
;
import
com.tanpu.community.dao.mapper.community.TopicMapper
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.cache.annotation.EnableCaching
;
...
@@ -29,31 +29,27 @@ public class TopicService {
...
@@ -29,31 +29,27 @@ public class TopicService {
public
void
updateTopicToTop
(
String
topicId
){
public
void
updateTopicToTop
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
TopicEntity
topicEntity
=
new
TopicEntity
();
updateWrapper
.
eq
(
"id"
,
topicId
);
topicEntity
.
setIsTop
(
1
);
updateWrapper
.
set
(
"is_top"
,
1
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
topicId
));
topicMapper
.
update
(
null
,
updateWrapper
);
}
}
public
void
updateTopicNotTop
(
String
topicId
){
public
void
updateTopicNotTop
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
TopicEntity
topicEntity
=
new
TopicEntity
();
updateWrapper
.
eq
(
"id"
,
topicId
);
topicEntity
.
setIsTop
(
0
);
updateWrapper
.
set
(
"is_top"
,
0
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
topicId
));
topicMapper
.
update
(
null
,
updateWrapper
);
}
}
public
void
updateTopicToConceal
(
String
topicId
){
public
void
updateTopicToConceal
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
TopicEntity
topicEntity
=
new
TopicEntity
();
updateWrapper
.
eq
(
"id"
,
topicId
);
topicEntity
.
setIsConceal
(
1
);
updateWrapper
.
set
(
"is_conceal"
,
1
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
topicId
));
topicMapper
.
update
(
null
,
updateWrapper
);
}
}
public
void
updateTopicNotConceal
(
String
topicId
){
public
void
updateTopicNotConceal
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
TopicEntity
topicEntity
=
new
TopicEntity
();
updateWrapper
.
eq
(
"id"
,
topicId
);
topicEntity
.
setIsConceal
(
0
);
updateWrapper
.
set
(
"is_conceal"
,
0
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
topicId
));
topicMapper
.
update
(
null
,
updateWrapper
);
}
}
public
TopicEntity
queryById
(
String
topicId
)
{
public
TopicEntity
queryById
(
String
topicId
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment