Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
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
姚本章
dm_project
Commits
bb7a4f1d
Commit
bb7a4f1d
authored
Dec 30, 2020
by
zhangc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改dmp组织信息
parent
fdc87eca
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
13 deletions
+26
-13
AuthDmpUserApiReq.java
...ain/java/com/jz/dm/models/req/auth/AuthDmpUserApiReq.java
+7
-3
AuthMallUserApiReq.java
...in/java/com/jz/dm/models/req/auth/AuthMallUserApiReq.java
+3
-3
AuthServiceImpl.java
...src/main/java/com/jz/dm/service/impl/AuthServiceImpl.java
+16
-6
pom.xml
jz-dm-common/pom.xml
+0
-1
No files found.
jz-dm-apigateway/src/main/java/com/jz/dm/models/req/auth/AuthDmpUserApiReq.java
View file @
bb7a4f1d
...
@@ -26,9 +26,13 @@ public class AuthDmpUserApiReq implements Serializable {
...
@@ -26,9 +26,13 @@ public class AuthDmpUserApiReq implements Serializable {
@NotNull
(
message
=
"apiKey唯一标识不能为空"
)
@NotNull
(
message
=
"apiKey唯一标识不能为空"
)
private
String
apiKey
;
private
String
apiKey
;
@ApiModelProperty
(
value
=
"组织id"
,
required
=
true
)
@ApiModelProperty
(
value
=
"组织编码"
,
required
=
true
)
@NotNull
(
message
=
"组织id不能为空"
)
@NotNull
(
message
=
"组织编码不能为空"
)
private
Long
orgId
;
private
String
orgCode
;
@ApiModelProperty
(
value
=
"组织类型: INT 内部, OUT 外部"
,
required
=
true
)
@NotNull
(
message
=
"组织类型不能为空"
)
private
String
orgType
;
@ApiModelProperty
(
value
=
"授权类型:DATA_BANK_AUTH 数据银行 , DMP_AUTH dmp授权"
,
required
=
true
)
@ApiModelProperty
(
value
=
"授权类型:DATA_BANK_AUTH 数据银行 , DMP_AUTH dmp授权"
,
required
=
true
)
@NotNull
(
message
=
"授权类型不能为空"
)
@NotNull
(
message
=
"授权类型不能为空"
)
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/models/req/auth/AuthMallUserApiReq.java
View file @
bb7a4f1d
...
@@ -33,9 +33,9 @@ public class AuthMallUserApiReq implements Serializable {
...
@@ -33,9 +33,9 @@ public class AuthMallUserApiReq implements Serializable {
@ApiModelProperty
(
value
=
"用户id"
,
required
=
false
)
@ApiModelProperty
(
value
=
"用户id"
,
required
=
false
)
private
String
userId
;
private
String
userId
;
@ApiModelProperty
(
value
=
"组织
id
"
,
required
=
true
)
@ApiModelProperty
(
value
=
"组织
编码
"
,
required
=
true
)
@NotNull
(
message
=
"组织
id
不能为空"
)
@NotNull
(
message
=
"组织
编码
不能为空"
)
private
Long
orgId
;
private
String
orgCode
;
@ApiModelProperty
(
value
=
"授权类型:DATA_BANK_AUTH 数据银行 , DMP_AUTHdmp 授权"
,
required
=
true
)
@ApiModelProperty
(
value
=
"授权类型:DATA_BANK_AUTH 数据银行 , DMP_AUTHdmp 授权"
,
required
=
true
)
@NotNull
(
message
=
"授权类型不能为空"
)
@NotNull
(
message
=
"授权类型不能为空"
)
...
...
jz-dm-apigateway/src/main/java/com/jz/dm/service/impl/AuthServiceImpl.java
View file @
bb7a4f1d
...
@@ -87,7 +87,7 @@ public class AuthServiceImpl implements AuthService {
...
@@ -87,7 +87,7 @@ public class AuthServiceImpl implements AuthService {
if
(
null
==
apiInterface
)
{
if
(
null
==
apiInterface
)
{
return
Result
.
of_error
(
"api授权信息不存在!"
);
return
Result
.
of_error
(
"api授权信息不存在!"
);
}
}
ApiOrg
apiOrg
=
apiOrgMapper
.
select
ById
(
req
.
getOrgId
(
));
ApiOrg
apiOrg
=
apiOrgMapper
.
select
One
(
new
QueryWrapper
<
ApiOrg
>().
eq
(
"org_code"
,
req
.
getOrgCode
()
));
if
(
null
==
apiOrg
)
{
if
(
null
==
apiOrg
)
{
return
Result
.
of_error
(
"组织信息不存在!"
);
return
Result
.
of_error
(
"组织信息不存在!"
);
}
}
...
@@ -106,11 +106,21 @@ public class AuthServiceImpl implements AuthService {
...
@@ -106,11 +106,21 @@ public class AuthServiceImpl implements AuthService {
AuthModeEnum
.
POWER_CALL_MODE
.
name
().
equals
(
req
.
getAuthMode
()))
{
AuthModeEnum
.
POWER_CALL_MODE
.
name
().
equals
(
req
.
getAuthMode
()))
{
return
Result
.
of_error
(
"授权类型错误!"
);
return
Result
.
of_error
(
"授权类型错误!"
);
}
}
String
authCode
=
""
;
ApiAuth
apiAuth
=
new
ApiAuth
();
ApiAuth
apiAuth
=
new
ApiAuth
();
BeanUtils
.
copyProperties
(
req
,
apiAuth
);
BeanUtils
.
copyProperties
(
req
,
apiAuth
);
apiAuth
.
setApiInterfaceId
(
apiInterface
.
getId
());
apiAuth
.
setApiInterfaceId
(
apiInterface
.
getId
());
apiAuth
.
setAuthCode
(
""
);
//授权码
if
(
StringUtils
.
isNotBlank
(
req
.
getOrgType
())
//内部组织
apiAuth
.
setSalt
(
""
);
//盐值
&&
Constants
.
AUTH_INT
.
equalsIgnoreCase
(
req
.
getOrgType
()))
{
authCode
=
getAuthCode
(
apiOrg
.
getOrgCode
(),
""
,
Constants
.
AUTH_INT
);
}
/*else if (StringUtils.isNotBlank(req.getOrgType()) //外部组织
&& Constants.AUTH_OUT.equalsIgnoreCase(req.getOrgType())) {
authCode = getAuthCode("", req.getUserId(),Constants.AUTH_OUT);
}*/
apiAuth
.
setAuthCode
(
authCode
);
//授权码
String
salt
=
RandomUtil
.
getStringRandom
(
8
);
apiAuth
.
setSalt
(
salt
);
//盐值
apiAuth
.
setStatus
(
"1"
);
//授权状态
apiAuth
.
setStatus
(
"1"
);
//授权状态
if
(
apiAuthMapper
.
insert
(
apiAuth
)
>
0
)
{
if
(
apiAuthMapper
.
insert
(
apiAuth
)
>
0
)
{
return
Result
.
of_success
(
ResultMsg
.
SUCCESS
);
return
Result
.
of_success
(
ResultMsg
.
SUCCESS
);
...
@@ -131,7 +141,7 @@ public class AuthServiceImpl implements AuthService {
...
@@ -131,7 +141,7 @@ public class AuthServiceImpl implements AuthService {
if
(
null
==
apiInterface
)
{
if
(
null
==
apiInterface
)
{
return
Result
.
of_error
(
"api授权信息不存在!"
);
return
Result
.
of_error
(
"api授权信息不存在!"
);
}
}
ApiOrg
apiOrg
=
apiOrgMapper
.
select
ById
(
req
.
getOrgId
(
));
ApiOrg
apiOrg
=
apiOrgMapper
.
select
One
(
new
QueryWrapper
<
ApiOrg
>().
eq
(
"org_code"
,
req
.
getOrgCode
()
));
if
(
null
==
apiOrg
)
{
if
(
null
==
apiOrg
)
{
return
Result
.
of_error
(
"组织信息不存在!"
);
return
Result
.
of_error
(
"组织信息不存在!"
);
}
}
...
@@ -168,9 +178,9 @@ public class AuthServiceImpl implements AuthService {
...
@@ -168,9 +178,9 @@ public class AuthServiceImpl implements AuthService {
response
.
setAuthCode
(
authCode
);
response
.
setAuthCode
(
authCode
);
response
.
setSalt
(
salt
);
response
.
setSalt
(
salt
);
if
(
apiAuthMapper
.
insert
(
apiAuth
)
>
0
)
{
if
(
apiAuthMapper
.
insert
(
apiAuth
)
>
0
)
{
return
Result
.
of_success
(
response
);
return
Result
.
of_success
(
ResultMsg
.
SUCCESS
,
response
);
}
}
return
Result
.
of_success
(
ResultMsg
.
FAILURE
);
return
Result
.
of_success
(
ResultMsg
.
FAILURE
,
response
);
}
}
/**
/**
...
...
jz-dm-common/pom.xml
View file @
bb7a4f1d
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
...
...
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