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
b89a6ee4
Commit
b89a6ee4
authored
Nov 29, 2019
by
lanmw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
367267a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
92 deletions
+119
-92
TagCtrl.java
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
+14
-4
Tag.java
src/main/java/com/keymobile/tagmanager/model/Tag.java
+10
-1
TagService.java
...ain/java/com/keymobile/tagmanager/service/TagService.java
+9
-1
Constants.java
src/main/java/com/keymobile/tagmanager/util/Constants.java
+86
-86
No files found.
src/main/java/com/keymobile/tagmanager/api/TagCtrl.java
View file @
b89a6ee4
package
com
.
keymobile
.
tagmanager
.
api
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -6,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.tagmanager.exception.TagNotExistException
;
import
com.keymobile.tagmanager.model.Page
;
import
com.keymobile.tagmanager.model.Tag
;
import
com.keymobile.tagmanager.service.TagService
;
...
...
@@ -52,13 +55,13 @@ public class TagCtrl {
// @PreAuthorize("principal.authorities.?[authority.startsWith('ROLE_tagmanager_admin')].size() > 0")
@ApiOperation
(
value
=
"查询系统标签树"
,
notes
=
"查询系统标签树"
)
@GetMapping
(
value
=
"/querySystemTagAsTree"
)
public
JsonNode
[]
querySystemTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
Exception
{
public
JsonNode
[]
querySystemTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
TagNotExistException
{
return
tagService
.
querySystemTagAsTree
(
parentId
);
}
@ApiOperation
(
value
=
"查询个人标签树"
,
notes
=
"查询个人标签树"
)
@GetMapping
(
value
=
"/queryPersonalTagAsTree"
)
public
JsonNode
[]
queryPersonalTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
Exception
{
public
JsonNode
[]
queryPersonalTagAsTree
(
@RequestParam
(
value
=
"parentId"
,
required
=
false
)
String
parentId
)
throws
TagNotExistException
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
queryPersonalTagAsTree
(
parentId
,
userName
);
}
...
...
@@ -68,7 +71,7 @@ public class TagCtrl {
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
{
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
{
return
tagService
.
searchSystemTagByPage
(
keyword
,
domain
,
new
Page
(
pageSize
,
pageNo
));
}
...
...
@@ -77,9 +80,16 @@ public class TagCtrl {
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
{
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
{
String
userName
=
UserInfoUtils
.
getUserName
();
return
tagService
.
searchPersonalTagByPage
(
userName
,
keyword
,
domain
,
new
Page
(
pageSize
,
pageNo
));
}
@ApiOperation
(
value
=
"分享标签"
,
notes
=
"分享标签"
)
@PostMapping
(
value
=
"/shareTags"
)
public
void
shareTags
(
@RequestBody
List
<
String
>
tagIds
)
throws
Exception
{
tagService
.
shareTags
(
tagIds
);
}
}
src/main/java/com/keymobile/tagmanager/model/Tag.java
View file @
b89a6ee4
...
...
@@ -29,6 +29,7 @@ public class Tag implements Serializable{
private
String
creator
;
private
String
isOpen
=
Constants
.
TAG_CLOSE_STATUS
;
//0 不公开, 1, 公开
private
Integer
domain
;
private
boolean
dimension
=
false
;
//是否维度标签
public
Tag
()
{}
...
...
@@ -149,6 +150,14 @@ public class Tag implements Serializable{
public
void
setDomain
(
Integer
domain
)
{
this
.
domain
=
domain
;
}
public
boolean
isDimension
()
{
return
dimension
;
}
public
void
setDimension
(
boolean
dimension
)
{
this
.
dimension
=
dimension
;
}
}
src/main/java/com/keymobile/tagmanager/service/TagService.java
View file @
b89a6ee4
...
...
@@ -75,7 +75,7 @@ public class TagService {
Tag
t
=
mongoOperations
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"path"
).
is
(
tag
.
getPath
())
.
and
(
"creator"
).
is
(
userName
)),
Tag
.
class
);
if
(
t
!=
null
&&
!
t
.
getId
().
equals
(
tag
.
getId
()))
throw
new
TagDuplicateException
(
"tag ["
+
tag
.
getName
()
+
"] is already exist in target!"
);
throw
new
TagDuplicateException
(
"tag ["
+
tag
.
getName
()
+
"] is already exist in target!
, userName is ["
+
userName
+
"]
"
);
}
...
...
@@ -222,5 +222,13 @@ public class TagService {
}
return
false
;
}
public
void
shareTags
(
List
<
String
>
tagIds
)
{
Iterable
<
Tag
>
tags
=
tagRepository
.
findAllById
(
tagIds
);
tags
.
forEach
(
t
->
{
t
.
setIsOpen
(
Constants
.
TAG_OPEN_STATUS
);
});
tagRepository
.
saveAll
(
tags
);
}
}
src/main/java/com/keymobile/tagmanager/util/Constants.java
View file @
b89a6ee4
package
com
.
keymobile
.
tagmanager
.
util
;
public
final
class
Constants
{
private
Constants
()
{};
public
static
final
Integer
TABLEMODEL_PUBLISH_TYPE_ENABLE
=
1
;
public
static
final
Integer
TABLEMODEL_PUBLISH_TYPE_DISABLE
=
2
;
public
static
final
Integer
TABLEMODEL_PUBLISH_TYPE_INIT
=
0
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_INIT
=
0
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_SUCCESS
=
1
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_RUNNING
=
2
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_FAIL
=
3
;
public
static
final
Integer
TABLEMODEL_PREVIEW_SAMPLE_COUNT
=
20
;
public
static
final
String
TABLEMODEL_REDIS_KEY
=
"tableModel"
;
public
static
final
String
TABLEMODEL_HOTWORD_REDIS_TIME
=
"tableModel_hotword_time"
;
public
static
final
String
TABLEMODEL_HOTWORD_REDIS_KEY
=
"tableModel_hotword_key"
;
public
static
final
String
TABLEMODEL_DATABASE_REDIS_KEY
=
"database_key"
;
public
static
final
String
TABLEMODEL_USERDOMAIN_REDIS_KEY
=
"userDomain_key"
;
public
static
final
String
TABLEMODEL_USERROLE_REDIS_KEY
=
"userRole_key"
;
public
static
final
long
TABLEMODEL_REDIS_EXPIRE_TIME
=
1000
*
60
*
60
*
24
*
1
l
;
// 1 day
public
static
final
long
DATABASE_REDIS_EXPIRE_TIME
=
1000
*
60
*
5
l
;
//5 minute
public
static
final
long
USERDOMAIN_REDIS_EXPIRE_TIME
=
1000
*
60
*
3
l
;
//3 minute
public
static
final
long
USERROLE_REDIS_EXPIRE_TIME
=
1000
*
60
*
3
l
;
//3 minute
public
static
final
String
TABLEMODEL_INNERTYPE_SIMPLE
=
"simple"
;
public
static
final
String
TABLEMODEL_INNERTYPE_VIEW
=
"view"
;
public
static
final
String
TABLEMODEL_INNERTYPE_QUICK
=
"quick"
;
public
static
final
String
TABLEMODEL_DBTYPE_HANAVIEW
=
"HanaView"
;
public
static
final
String
TABLEMODEL_DBTYPE_TABLE
=
"Table"
;
public
static
final
String
DIR_ROOT_NODE_ID
=
"002c4155d13149a092129382e89a413f"
;
public
static
final
String
TAG_PERSONAL_TYPE
=
"1"
;
public
static
final
String
TAG_SYSTEM_TYPE
=
"0"
;
public
static
final
String
TAG_PATH_SEPARATOR
=
","
;
public
static
final
String
TAG_OPEN_STATUS
=
"1"
;
public
static
final
String
TAG_CLOSE_STATUS
=
"0"
;
public
static
final
String
PROCESS_AUDITSTATUS_APPLYING
=
"applying"
;
public
static
final
String
PROCESS_AUDITSTATUS_APPROVE
=
"approve"
;
public
static
final
String
PROCESS_AUDITSTATUS_REJECT
=
"reject"
;
public
static
final
String
PRIVILEGE_EXPIRE_TIME_STR
=
"3000-01-01"
;
public
static
final
String
REDIS_OPERATYPE_ADD
=
"add"
;
public
static
final
String
REDIS_OPERATYPE_DELETE
=
"delete"
;
public
static
final
String
REDIS_OPERATYPE_UPDATE
=
"update"
;
public
static
final
String
REDIS_OPERATYPE_FIND
=
"find"
;
public
static
final
String
MQ_METADATA_CREATE
=
"metadataCreate"
;
public
static
final
String
MQ_METADATA_UPDATE
=
"metadataUpdate"
;
public
static
final
String
MQ_METADATA_DELETE
=
"metadataDelete"
;
public
static
final
String
MQ_DATACATALOG_CREATE
=
"dataCatalogCreate"
;
public
static
final
String
MQ_DATACATALOG_DELETE
=
"dataCatalogDelete"
;
public
static
final
String
MQ_DATACATALOG_SAMPLE_CREATE
=
"dataCatalogSampleCreate"
;
public
static
final
String
MQ_DATACATALOG_ONCATALOG
=
"dataCatalogOnCatalog"
;
public
static
final
String
MQ_DATACATALOG_OFFCATALOG
=
"dataCatalogOffCatalog"
;
public
static
final
String
MQ_DATACATALOG_MODIFY
=
"dataCatalogModify"
;
public
static
final
String
MQ_DATACATALOG_TYPE_KEY
=
"type"
;
public
static
final
String
MQ_DATACATALOG_TIMESTAMP_KEY
=
"timestamp"
;
public
static
final
String
MQ_DATACATALOG_CONTENT_KEY
=
"content"
;
public
static
final
String
OPELOG_DAY_RESOURCE_VISIT_REDIS_KEY
=
"dailyResourceVisitState"
;
public
static
final
String
OPELOG_MONTH_RESOUCE_VISIT_REDIS_KEY
=
"monthlyResourceVisitState"
;
public
static
final
String
OPELOG_DAY_USER_VISIT_REDIS_KEY
=
"dailyUserVisitState"
;
public
static
final
String
OPELOG_MONTH_TOPVISIT_USER_REDIS_KEY
=
"monthlyTopVisitUserState"
;
public
static
final
String
ORG_QUERY_SQL
=
"select SPP_ID, SUBSPP_TYPE, SUBSPP_NAM, SUBSPP_ID FROM DIM_SUBSPP"
;
}
package
com
.
keymobile
.
tagmanager
.
util
;
public
final
class
Constants
{
private
Constants
()
{};
public
static
final
Integer
TABLEMODEL_PUBLISH_TYPE_ENABLE
=
1
;
public
static
final
Integer
TABLEMODEL_PUBLISH_TYPE_DISABLE
=
2
;
public
static
final
Integer
TABLEMODEL_PUBLISH_TYPE_INIT
=
0
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_INIT
=
0
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_SUCCESS
=
1
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_RUNNING
=
2
;
public
static
final
Integer
TABLEMODEL_PREVIEW_STATUS_FAIL
=
3
;
public
static
final
Integer
TABLEMODEL_PREVIEW_SAMPLE_COUNT
=
20
;
public
static
final
String
TABLEMODEL_REDIS_KEY
=
"tableModel"
;
public
static
final
String
TABLEMODEL_HOTWORD_REDIS_TIME
=
"tableModel_hotword_time"
;
public
static
final
String
TABLEMODEL_HOTWORD_REDIS_KEY
=
"tableModel_hotword_key"
;
public
static
final
String
TABLEMODEL_DATABASE_REDIS_KEY
=
"database_key"
;
public
static
final
String
TABLEMODEL_USERDOMAIN_REDIS_KEY
=
"userDomain_key"
;
public
static
final
String
TABLEMODEL_USERROLE_REDIS_KEY
=
"userRole_key"
;
public
static
final
long
TABLEMODEL_REDIS_EXPIRE_TIME
=
1000
*
60
*
60
*
24
*
1
l
;
// 1 day
public
static
final
long
DATABASE_REDIS_EXPIRE_TIME
=
1000
*
60
*
5
l
;
//5 minute
public
static
final
long
USERDOMAIN_REDIS_EXPIRE_TIME
=
1000
*
60
*
3
l
;
//3 minute
public
static
final
long
USERROLE_REDIS_EXPIRE_TIME
=
1000
*
60
*
3
l
;
//3 minute
public
static
final
String
TABLEMODEL_INNERTYPE_SIMPLE
=
"simple"
;
public
static
final
String
TABLEMODEL_INNERTYPE_VIEW
=
"view"
;
public
static
final
String
TABLEMODEL_INNERTYPE_QUICK
=
"quick"
;
public
static
final
String
TABLEMODEL_DBTYPE_HANAVIEW
=
"HanaView"
;
public
static
final
String
TABLEMODEL_DBTYPE_TABLE
=
"Table"
;
public
static
final
String
DIR_ROOT_NODE_ID
=
"002c4155d13149a092129382e89a413f"
;
public
static
final
String
TAG_PERSONAL_TYPE
=
"1"
;
public
static
final
String
TAG_SYSTEM_TYPE
=
"0"
;
public
static
final
String
TAG_PATH_SEPARATOR
=
","
;
public
static
final
String
TAG_OPEN_STATUS
=
"1"
;
public
static
final
String
TAG_CLOSE_STATUS
=
"0"
;
public
static
final
String
PROCESS_AUDITSTATUS_APPLYING
=
"applying"
;
public
static
final
String
PROCESS_AUDITSTATUS_APPROVE
=
"approve"
;
public
static
final
String
PROCESS_AUDITSTATUS_REJECT
=
"reject"
;
public
static
final
String
PRIVILEGE_EXPIRE_TIME_STR
=
"3000-01-01"
;
public
static
final
String
REDIS_OPERATYPE_ADD
=
"add"
;
public
static
final
String
REDIS_OPERATYPE_DELETE
=
"delete"
;
public
static
final
String
REDIS_OPERATYPE_UPDATE
=
"update"
;
public
static
final
String
REDIS_OPERATYPE_FIND
=
"find"
;
public
static
final
String
MQ_METADATA_CREATE
=
"metadataCreate"
;
public
static
final
String
MQ_METADATA_UPDATE
=
"metadataUpdate"
;
public
static
final
String
MQ_METADATA_DELETE
=
"metadataDelete"
;
public
static
final
String
MQ_DATACATALOG_CREATE
=
"dataCatalogCreate"
;
public
static
final
String
MQ_DATACATALOG_DELETE
=
"dataCatalogDelete"
;
public
static
final
String
MQ_DATACATALOG_SAMPLE_CREATE
=
"dataCatalogSampleCreate"
;
public
static
final
String
MQ_DATACATALOG_ONCATALOG
=
"dataCatalogOnCatalog"
;
public
static
final
String
MQ_DATACATALOG_OFFCATALOG
=
"dataCatalogOffCatalog"
;
public
static
final
String
MQ_DATACATALOG_MODIFY
=
"dataCatalogModify"
;
public
static
final
String
MQ_DATACATALOG_TYPE_KEY
=
"type"
;
public
static
final
String
MQ_DATACATALOG_TIMESTAMP_KEY
=
"timestamp"
;
public
static
final
String
MQ_DATACATALOG_CONTENT_KEY
=
"content"
;
public
static
final
String
OPELOG_DAY_RESOURCE_VISIT_REDIS_KEY
=
"dailyResourceVisitState"
;
public
static
final
String
OPELOG_MONTH_RESOUCE_VISIT_REDIS_KEY
=
"monthlyResourceVisitState"
;
public
static
final
String
OPELOG_DAY_USER_VISIT_REDIS_KEY
=
"dailyUserVisitState"
;
public
static
final
String
OPELOG_MONTH_TOPVISIT_USER_REDIS_KEY
=
"monthlyTopVisitUserState"
;
public
static
final
String
ORG_QUERY_SQL
=
"select SPP_ID, SUBSPP_TYPE, SUBSPP_NAM, SUBSPP_ID FROM DIM_SUBSPP"
;
}
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