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
adbcc2e2
Commit
adbcc2e2
authored
Jun 16, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
boolean状态枚举类
parent
38135eb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
TopicStatusEnum.java
...va/com/tanpu/community/api/constants/TopicStatusEnum.java
+30
-0
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+5
-4
No files found.
community-api/src/main/java/com/tanpu/community/api/constants/TopicStatusEnum.java
0 → 100644
View file @
adbcc2e2
package
com
.
tanpu
.
community
.
api
.
constants
;
public
enum
TopicStatusEnum
{
TRUE
(
1
,
true
),
FALSE
(
0
,
false
);
private
Integer
code
;
private
boolean
status
;
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
boolean
isStatus
()
{
return
status
;
}
public
void
setStatus
(
boolean
status
)
{
this
.
status
=
status
;
}
TopicStatusEnum
(
Integer
code
,
boolean
status
)
{
this
.
code
=
code
;
this
.
status
=
status
;
}
}
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
adbcc2e2
...
...
@@ -2,6 +2,7 @@ package com.tanpu.community.service;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.tanpu.community.api.constants.TopicStatusEnum
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.mapper.community.TopicMapper
;
import
org.springframework.cache.annotation.EnableCaching
;
...
...
@@ -30,25 +31,25 @@ public class TopicService {
public
void
updateTopicToTop
(
String
topicId
){
TopicEntity
topicEntity
=
new
TopicEntity
();
topicEntity
.
setIsTop
(
1
);
topicEntity
.
setIsTop
(
TopicStatusEnum
.
TRUE
.
getCode
()
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
topicId
));
}
public
void
updateTopicNotTop
(
String
topicId
){
TopicEntity
topicEntity
=
new
TopicEntity
();
topicEntity
.
setIsTop
(
0
);
topicEntity
.
setIsTop
(
TopicStatusEnum
.
FALSE
.
getCode
()
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
topicId
));
}
public
void
updateTopicToConceal
(
String
topicId
){
TopicEntity
topicEntity
=
new
TopicEntity
();
topicEntity
.
setIsConceal
(
1
);
topicEntity
.
setIsConceal
(
TopicStatusEnum
.
TRUE
.
getCode
()
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
topicId
));
}
public
void
updateTopicNotConceal
(
String
topicId
){
TopicEntity
topicEntity
=
new
TopicEntity
();
topicEntity
.
setIsConceal
(
0
);
topicEntity
.
setIsConceal
(
TopicStatusEnum
.
FALSE
.
getCode
()
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getId
,
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