Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tagManager
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanmw
tagManager
Commits
367267a8
Commit
367267a8
authored
Nov 29, 2019
by
lanmw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleteTag
parent
e2de8df7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
TagCtrl.java
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
+24
-12
TagService.java
...ain/java/com/keymobile/tagmanager/service/TagService.java
+0
-0
MongoOperationsUtil.java
...va/com/keymobile/tagmanager/util/MongoOperationsUtil.java
+0
-0
No files found.
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
View file @
367267a8
package
com
.
keymobile
.
tagmanager
.
api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.tagmanager.model.Page
;
import
com.keymobile.tagmanager.model.Tag
;
import
com.keymobile.tagmanager.service.TagService
;
import
com.keymobile.tagmanager.util.Constants
;
import
com.keymobile.tagmanager.util.JsonTreeHelper.JsonNode
;
import
com.keymobile.tagmanager.util.UserInfoUtils
;
...
...
@@ -32,36 +31,49 @@ public class TagCtrl {
@RequestBody
Tag
tag
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
tag
.
setCreator
(
userName
);
return
tagService
.
addOrUpdateTag
(
parentId
,
tag
);
return
tagService
.
addOrUpdateTag
(
parentId
,
tag
,
userName
);
}
@ApiOperation
(
value
=
"删除标签"
,
notes
=
"删除标签"
)
@PostMapping
(
value
=
"/deleteTag"
)
public
void
deleteTag
(
@RequestParam
(
value
=
"tagId"
)
String
tagId
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
tagService
.
deleteTag
(
tagId
,
userName
);
}
@ApiOperation
(
value
=
"存在节点"
,
notes
=
"存在节点"
)
@GetMapping
(
value
=
"/hasChild"
)
public
boolean
hasChild
(
@RequestParam
(
value
=
"tagId"
)
String
tagId
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
hasChild
(
tagId
,
userName
);
}
// @PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_admin')].size() > 0")
@ApiOperation
(
value
=
"查询系统标签树"
,
notes
=
"查询系统标签树"
)
@
Pos
tMapping
(
value
=
"/querySystemTagAsTree"
)
@
Ge
tMapping
(
value
=
"/querySystemTagAsTree"
)
public
JsonNode
[]
querySystemTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
queryTagAsTreeByTagType
(
Constants
.
TAG_SYSTEM_TYPE
,
parentId
,
userName
);
return
tagService
.
querySystemTagAsTree
(
parentId
);
}
@ApiOperation
(
value
=
"查询个人标签树"
,
notes
=
"查询个人标签树"
)
@
Pos
tMapping
(
value
=
"/queryPersonalTagAsTree"
)
@
Ge
tMapping
(
value
=
"/queryPersonalTagAsTree"
)
public
JsonNode
[]
queryPersonalTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
query
TagAsTreeByTagType
(
Constants
.
TAG_PERSONAL_TYPE
,
parentId
,
userName
);
return
tagService
.
query
PersonalTagAsTree
(
parentId
,
userName
);
}
@ApiOperation
(
value
=
"搜索系統标签"
,
notes
=
"搜索系統标签"
)
@
Pos
tMapping
(
value
=
"/searchSystemTagByPage"
)
@
Ge
tMapping
(
value
=
"/searchSystemTagByPage"
)
public
Page
searchSystemTagByPage
(
@RequestParam
(
required
=
false
,
value
=
"keyword"
)
String
keyword
,
@RequestParam
(
required
=
false
,
value
=
"domain"
)
Integer
domain
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
searchSystemTagByPage
(
userName
,
keyword
,
domain
,
new
Page
(
pageSize
,
pageNo
));
return
tagService
.
searchSystemTagByPage
(
keyword
,
domain
,
new
Page
(
pageSize
,
pageNo
));
}
@ApiOperation
(
value
=
"搜索个人标签"
,
notes
=
"搜索个人标签"
)
@
Pos
tMapping
(
value
=
"/searchPersonalTagByPage"
)
@
Ge
tMapping
(
value
=
"/searchPersonalTagByPage"
)
public
Page
searchPersonalTagByPage
(
@RequestParam
(
required
=
false
,
value
=
"keyword"
)
String
keyword
,
@RequestParam
(
required
=
false
,
value
=
"domain"
)
Integer
domain
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
...
...
src/main/java/com/keymobile/tagmanager/service/TagService.java
View file @
367267a8
This diff is collapsed.
Click to expand it.
src/main/java/com/keymobile/tagmanager/util/MongoOperationsUtil.java
View file @
367267a8
This diff is collapsed.
Click to expand it.
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