Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
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
base_platform_enterprise
gic-platform-auth
Commits
ecede8d0
Commit
ecede8d0
authored
Nov 08, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加日志操作
parent
368e5a1f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
19 deletions
+34
-19
CollaboratorApiServiceImpl.java
...c/auth/service/outer/impl/CollaboratorApiServiceImpl.java
+2
-2
RoleApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/RoleApiServiceImpl.java
+2
-2
UserApiServiceImpl.java
...a/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
+4
-4
CollaboratorController.java
...a/com/gic/auth/web/controller/CollaboratorController.java
+3
-2
RoleController.java
...main/java/com/gic/auth/web/controller/RoleController.java
+11
-7
UserController.java
...main/java/com/gic/auth/web/controller/UserController.java
+12
-2
No files found.
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/CollaboratorApiServiceImpl.java
View file @
ecede8d0
...
...
@@ -158,7 +158,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
ServiceResponse
<
Void
>
auth
(
String
subAppIds
,
String
menuIds
,
String
resourcesIds
,
Integer
collaboratorId
)
{
public
ServiceResponse
<
String
>
auth
(
String
subAppIds
,
String
menuIds
,
String
resourcesIds
,
Integer
collaboratorId
)
{
TabSysCollaborator
record
=
collaboratorService
.
getById
(
collaboratorId
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"协作人ID有误,查无数据"
);
...
...
@@ -190,7 +190,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
collaboratorRoleRelService
.
deleteByCollaboratorId
(
collaboratorId
);
collaboratorRoleRelService
.
saveFetch
(
list
);
}
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
record
.
getCollaboratorName
()
);
}
@Override
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/RoleApiServiceImpl.java
View file @
ecede8d0
...
...
@@ -112,7 +112,7 @@ public class RoleApiServiceImpl implements RoleApiService{
}
@Override
public
ServiceResponse
<
Void
>
delete
(
Integer
id
)
{
public
ServiceResponse
<
String
>
delete
(
Integer
id
)
{
TabSysRole
record
=
roleService
.
getById
(
id
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"角色数据有误,查无数据"
);
...
...
@@ -123,7 +123,7 @@ public class RoleApiServiceImpl implements RoleApiService{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"无法删除,正在被使用"
);
}
roleService
.
deleteById
(
id
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
record
.
getRoleName
()
);
}
@Override
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/UserApiServiceImpl.java
View file @
ecede8d0
...
...
@@ -262,7 +262,7 @@ public class UserApiServiceImpl implements UserApiService {
}
@Override
public
ServiceResponse
<
Void
>
delete
(
Integer
userId
)
{
public
ServiceResponse
<
String
>
delete
(
Integer
userId
)
{
TabSysUser
tabUser
=
userService
.
getUserById
(
userId
);
if
(
tabUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"用户ID输入有误,无此数据"
);
...
...
@@ -274,7 +274,7 @@ public class UserApiServiceImpl implements UserApiService {
//删除账号分组关联
accountGroupRelService
.
deleteByUserId
(
userId
,
AccountGroupMemberTypeEnum
.
ADMIN
.
getCode
());
userService
.
delete
(
userId
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
tabUser
.
getUserName
()
);
}
@Override
...
...
@@ -367,7 +367,7 @@ public class UserApiServiceImpl implements UserApiService {
}
@Override
public
ServiceResponse
<
Void
>
removeAccountGroup
(
Integer
accountGroupId
,
Integer
userId
,
Integer
type
)
{
public
ServiceResponse
<
String
>
removeAccountGroup
(
Integer
accountGroupId
,
Integer
userId
,
Integer
type
)
{
TabSysUser
tabUser
=
userService
.
getUserById
(
userId
);
if
(
tabUser
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"用户ID输入有误,无此数据"
);
...
...
@@ -377,7 +377,7 @@ public class UserApiServiceImpl implements UserApiService {
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"账号分组ID输入有误,无此数据"
);
}
accountGroupRelService
.
deleteByAccountGroupIdAndUserId
(
userId
,
accountGroupId
,
type
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
(
tabUser
.
getUserName
()
);
}
/**
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/CollaboratorController.java
View file @
ecede8d0
...
...
@@ -123,8 +123,9 @@ public class CollaboratorController extends DownloadUtils{
*/
@RequestMapping
(
"/auth"
)
public
RestResponse
auth
(
String
subAppIds
,
String
menuIds
,
String
resourceIds
,
Integer
collaboratorId
)
{
return
ResultControllerUtils
.
commonResult
(
collaboratorApiService
.
auth
(
subAppIds
,
menuIds
,
resourceIds
,
collaboratorId
));
ServiceResponse
<
String
>
result
=
collaboratorApiService
.
auth
(
subAppIds
,
menuIds
,
resourceIds
,
collaboratorId
);
String
operationObject
=
result
.
isSuccess
()
?
result
.
getResult
()
:
null
;
return
ResultControllerUtils
.
operationResult
(
result
,
"协作人授权"
,
operationObject
);
}
@RequestMapping
(
"/app-menu-tree"
)
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/RoleController.java
View file @
ecede8d0
...
...
@@ -65,15 +65,15 @@ public class RoleController {
ServiceResponse
<
List
<
MenuDTO
>>
gicResult
=
menuApiService
.
listMenuTreeForRole
(
MenuProjectConstants
.
DEFAULT_PROJECT
);
vo
.
setGicMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
gicResult
.
getResult
(),
gicMap
));
vo
.
setGicMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
gicResult
.
getResult
(),
gicMap
));
//app已购买应用
ServiceResponse
<
List
<
MenuDTO
>>
appResult
=
menuApiService
.
listAppPageOfHasBuy
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
vo
.
setAppMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
appResult
.
getResult
(),
gicMap
));
vo
.
setAppMap
(
changeListToSelectTree
(
MenuLevelConstants
.
FIRST_LEVEL_PARENT_ID
,
appResult
.
getResult
(),
gicMap
));
return
RestResponse
.
success
(
vo
);
}
return
EnterpriseRestResponse
.
failure
(
roleResult
);
...
...
@@ -82,18 +82,22 @@ public class RoleController {
@RequestMapping
(
"/save"
)
public
RestResponse
save
(
RoleDTO
dto
)
{
dto
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
return
ResultControllerUtils
.
commonResult
(
roleApiService
.
save
(
dto
));
return
ResultControllerUtils
.
operationResult
(
roleApiService
.
save
(
dto
),
ResultControllerUtils
.
LOG_NEW
+
"角色"
,
dto
.
getRoleName
());
}
@RequestMapping
(
"/update"
)
public
RestResponse
update
(
RoleDTO
dto
)
{
dto
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
return
ResultControllerUtils
.
commonResult
(
roleApiService
.
update
(
dto
));
return
ResultControllerUtils
.
operationResult
(
roleApiService
.
update
(
dto
),
ResultControllerUtils
.
LOG_EDIT
+
"角色"
,
dto
.
getRoleName
());
}
@RequestMapping
(
"/delete"
)
public
RestResponse
delete
(
Integer
id
)
{
return
ResultControllerUtils
.
commonResult
(
roleApiService
.
delete
(
id
));
ServiceResponse
<
String
>
result
=
roleApiService
.
delete
(
id
);
String
operationObject
=
result
.
isSuccess
()
?
result
.
getResult
()
:
null
;
return
ResultControllerUtils
.
operationResult
(
result
,
ResultControllerUtils
.
LOG_DELETE
+
"角色"
,
operationObject
);
}
@RequestMapping
(
"/list-role"
)
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UserController.java
View file @
ecede8d0
package
com
.
gic
.
auth
.
web
.
controller
;
import
com.gic.download.utils.log.LogUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
org.apache.log4j.LogManager
;
import
org.apache.log4j.Logger
;
...
...
@@ -51,6 +52,11 @@ public class UserController {
userResult
=
userApiService
.
editUser
(
userDTO
);
}
if
(
userResult
.
isSuccess
())
{
if
(
userDTO
.
getUserId
()
==
null
)
{
LogUtils
.
createLog
(
ResultControllerUtils
.
LOG_NEW
+
"管理员"
,
userDTO
.
getUserName
());
}
else
{
LogUtils
.
createLog
(
ResultControllerUtils
.
LOG_EDIT
+
"管理员"
,
userDTO
.
getUserName
());
}
return
RestResponse
.
success
();
}
else
{
return
EnterpriseRestResponse
.
failure
(
userResult
);
...
...
@@ -72,7 +78,9 @@ public class UserController {
@RequestMapping
(
"/delete-user-by-id"
)
public
RestResponse
delete
(
Integer
userId
)
{
return
ResultControllerUtils
.
commonResult
(
userApiService
.
delete
(
userId
));
ServiceResponse
<
String
>
result
=
userApiService
.
delete
(
userId
);
return
ResultControllerUtils
.
operationResult
(
result
,
ResultControllerUtils
.
LOG_DELETE
+
"管理员"
,
ResultControllerUtils
.
getOperationObject
(
result
));
}
@RequestMapping
(
"/list-user"
)
...
...
@@ -99,7 +107,9 @@ public class UserController {
*/
@RequestMapping
(
"/remove-user-account-group"
)
public
RestResponse
removeUserAccountGroup
(
Integer
type
,
Integer
accountGroupId
,
Integer
userId
)
{
return
ResultControllerUtils
.
commonResult
(
userApiService
.
removeAccountGroup
(
accountGroupId
,
userId
,
type
));
ServiceResponse
<
String
>
result
=
userApiService
.
removeAccountGroup
(
accountGroupId
,
userId
,
type
);
return
ResultControllerUtils
.
operationResult
(
result
,
"移除账号分组"
,
ResultControllerUtils
.
getOperationObject
(
result
));
}
}
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