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
bfb032ab
Commit
bfb032ab
authored
May 07, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
a2d5c291
8b22b0dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
ResourceApiService.java
...rc/main/java/com/gic/auth/service/ResourceApiService.java
+10
-0
AuditorApiServiceImpl.java
...om/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
+3
-0
ResourceApiServiceImpl.java
...m/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
+16
-0
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/service/ResourceApiService.java
View file @
bfb032ab
...
@@ -101,4 +101,14 @@ public interface ResourceApiService {
...
@@ -101,4 +101,14 @@ public interface ResourceApiService {
* @throws
* @throws
*/
*/
ServiceResponse
<
OrderResourceDTO
>
getOrderResourceByUserId
(
Integer
userId
);
ServiceResponse
<
OrderResourceDTO
>
getOrderResourceByUserId
(
Integer
userId
);
/**
* @Title: getUserResourceByUserId
* @Description:
* @author zhiwj
* @param userId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.OrderResourceDTO> 返回null表示没有授权 返回 -1 表示全部
* @throws
*/
ServiceResponse
<
Long
>
getUserResourceByUserId
(
Integer
userId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/AuditorApiServiceImpl.java
View file @
bfb032ab
...
@@ -85,6 +85,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
...
@@ -85,6 +85,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
if
(
auditedGroupIsNotExist
)
{
if
(
auditedGroupIsNotExist
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
);
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
);
}
}
if
(
auditorDTO
.
getUserId
()
!=
null
)
{
TabSysUser
user
=
userService
.
getUserById
(
auditorDTO
.
getUserId
());
TabSysUser
user
=
userService
.
getUserById
(
auditorDTO
.
getUserId
());
if
(
user
==
null
)
{
if
(
user
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
...
@@ -92,6 +93,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
...
@@ -92,6 +93,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
if
(!
StringUtils
.
equals
(
auditorDTO
.
getPhone
(),
user
.
getPhoneNumber
()))
{
if
(!
StringUtils
.
equals
(
auditorDTO
.
getPhone
(),
user
.
getPhoneNumber
()))
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"关联管理员手机号不一致"
);
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"关联管理员手机号不一致"
);
}
}
}
auditorDTO
.
setIsUse
(
auditorDTO
.
getUserId
()
==
null
?
0
:
1
);
auditorDTO
.
setIsUse
(
auditorDTO
.
getUserId
()
==
null
?
0
:
1
);
// 这里进来的 不会去修改openid,所以把openid设为null
// 这里进来的 不会去修改openid,所以把openid设为null
...
@@ -217,6 +219,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
...
@@ -217,6 +219,7 @@ public class AuditorApiServiceImpl implements AuditorApiService {
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
AuditorDTO
auditorDTO
=
new
AuditorDTO
();
auditorDTO
.
setAuditorId
(
auditorId
);
auditorDTO
.
setAuditorId
(
auditorId
);
auditorDTO
.
setOpenid
(
openid
);
auditorDTO
.
setOpenid
(
openid
);
auditorDTO
.
setIsUse
(
1
);
this
.
auditorService
.
update
(
auditorDTO
);
this
.
auditorService
.
update
(
auditorDTO
);
}
}
}
}
...
...
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
View file @
bfb032ab
...
@@ -342,4 +342,20 @@ public class ResourceApiServiceImpl implements ResourceApiService {
...
@@ -342,4 +342,20 @@ public class ResourceApiServiceImpl implements ResourceApiService {
return
EnterpriseServiceResponse
.
success
(
defaultResource
);
return
EnterpriseServiceResponse
.
success
(
defaultResource
);
}
}
@Override
public
ServiceResponse
<
Long
>
getUserResourceByUserId
(
Integer
userId
)
{
TabSysUser
user
=
userService
.
getUserById
(
userId
);
if
(
user
.
getSuperAdmin
()
==
1
)
{
// 是超管就返回所有
return
EnterpriseServiceResponse
.
success
(-
1L
);
}
List
<
UserResourceDTO
>
resourceDTOList
=
this
.
userResourceService
.
listUserResourceByUserId
(
userId
);
if
(
CollectionUtils
.
isEmpty
(
resourceDTOList
))
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
UserResourceDTO
userResourceDTO
=
resourceDTOList
.
get
(
0
);
TabSysResource
resource
=
this
.
resourceService
.
getResource
(
userResourceDTO
.
getResourceId
());
return
EnterpriseServiceResponse
.
success
(
resource
.
getUserResource
());
}
}
}
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