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
e2de8df7
Commit
e2de8df7
authored
Nov 28, 2019
by
lanmw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u
parent
e07a1e41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
74 deletions
+73
-74
TagCtrl.java
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
+73
-74
No files found.
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
View file @
e2de8df7
package
com
.
keymobile
.
tagmanager
.
api
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
value
=
"标签相关"
,
tags
=
"标签相关"
)
@RestController
@RequestMapping
(
value
=
"/tagCtrl"
)
//@PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_operator')].size() > 0")
public
class
TagCtrl
{
@Autowired
private
TagService
tagService
;
@ApiOperation
(
value
=
"新增或更新标签"
,
notes
=
"新增或更新标签"
)
@PostMapping
(
value
=
"/addOrUpdateTag"
)
public
Tag
addTag
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
,
@RequestBody
Tag
tag
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
tag
.
setCreator
(
userName
);
return
tagService
.
addOrUpdateTag
(
parentId
,
tag
);
}
// @PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_admin')].size() > 0")
@ApiOperation
(
value
=
"查询系统标签树"
,
notes
=
"查询系统标签树"
)
@PostMapping
(
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
);
}
@ApiOperation
(
value
=
"查询个人标签树"
,
notes
=
"查询个人标签树"
)
@PostMapping
(
value
=
"/queryPersonalTagAsTree"
)
public
JsonNode
[]
queryPersonalTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
queryTagAsTreeByTagType
(
Constants
.
TAG_PERSONAL_TYPE
,
parentId
,
userName
);
}
@ApiOperation
(
value
=
"搜索系統标签"
,
notes
=
"搜索系統标签"
)
@PostMapping
(
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
));
}
@ApiOperation
(
value
=
"搜索个人标签"
,
notes
=
"搜索个人标签"
)
@PostMapping
(
value
=
"/searchPersonalTagByPage"
)
public
Page
searchPersonalTagByPage
(
@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
.
searchPersonalTagByPage
(
userName
,
keyword
,
domain
,
new
Page
(
pageSize
,
pageNo
));
}
}
package
com
.
keymobile
.
tagmanager
.
api
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
value
=
"标签相关"
,
tags
=
"标签相关"
)
@RestController
//@PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_operator')].size() > 0")
public
class
TagCtrl
{
@Autowired
private
TagService
tagService
;
@ApiOperation
(
value
=
"新增或更新标签"
,
notes
=
"新增或更新标签"
)
@PostMapping
(
value
=
"/addOrUpdateTag"
)
public
Tag
addTag
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
,
@RequestBody
Tag
tag
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
tag
.
setCreator
(
userName
);
return
tagService
.
addOrUpdateTag
(
parentId
,
tag
);
}
// @PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_admin')].size() > 0")
@ApiOperation
(
value
=
"查询系统标签树"
,
notes
=
"查询系统标签树"
)
@PostMapping
(
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
);
}
@ApiOperation
(
value
=
"查询个人标签树"
,
notes
=
"查询个人标签树"
)
@PostMapping
(
value
=
"/queryPersonalTagAsTree"
)
public
JsonNode
[]
queryPersonalTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
Exception
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
queryTagAsTreeByTagType
(
Constants
.
TAG_PERSONAL_TYPE
,
parentId
,
userName
);
}
@ApiOperation
(
value
=
"搜索系統标签"
,
notes
=
"搜索系統标签"
)
@PostMapping
(
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
));
}
@ApiOperation
(
value
=
"搜索个人标签"
,
notes
=
"搜索个人标签"
)
@PostMapping
(
value
=
"/searchPersonalTagByPage"
)
public
Page
searchPersonalTagByPage
(
@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
.
searchPersonalTagByPage
(
userName
,
keyword
,
domain
,
new
Page
(
pageSize
,
pageNo
));
}
}
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