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
281e8074
Commit
281e8074
authored
Dec 17, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加查询短信签名的接口
parent
0635a37e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
126 additions
and
7 deletions
+126
-7
SmsSignResourceDTO.java
...pi/src/main/java/com/gic/auth/dto/SmsSignResourceDTO.java
+34
-0
ResourceApiService.java
...rc/main/java/com/gic/auth/service/ResourceApiService.java
+8
-0
TabSysOrderAppResourceMapper.java
...com/gic/auth/dao/mapper/TabSysOrderAppResourceMapper.java
+6
-0
OrderAppResourceService.java
...in/java/com/gic/auth/service/OrderAppResourceService.java
+4
-0
OrderAppResourceServiceImpl.java
...om/gic/auth/service/impl/OrderAppResourceServiceImpl.java
+6
-0
ResourceApiServiceImpl.java
...m/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
+44
-0
TabSysOrderAppResourceMapper.xml
...rc/main/resources/mapper/TabSysOrderAppResourceMapper.xml
+17
-0
ResourceController.java
.../java/com/gic/auth/web/controller/ResourceController.java
+2
-2
ResourceQO.java
...uth-web/src/main/java/com/gic/auth/web/qo/ResourceQO.java
+5
-5
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/dto/SmsSignResourceDTO.java
0 → 100644
View file @
281e8074
package
com
.
gic
.
auth
.
dto
;
import
java.io.Serializable
;
import
java.util.List
;
/**
*
* @Description:
* @author zhiwj
* @date 2019-12-17 16:46
*/
public
class
SmsSignResourceDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6009818220117316815L
;
//
private
List
<
Long
>
ids
;
// 1:全部 2:部分
private
Integer
type
;
public
List
<
Long
>
getIds
()
{
return
ids
;
}
public
void
setIds
(
List
<
Long
>
ids
)
{
this
.
ids
=
ids
;
}
public
Integer
getType
()
{
return
type
;
}
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
}
gic-platform-auth-api/src/main/java/com/gic/auth/service/ResourceApiService.java
View file @
281e8074
...
@@ -3,6 +3,9 @@ package com.gic.auth.service;
...
@@ -3,6 +3,9 @@ package com.gic.auth.service;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.ResourceDTO
;
import
com.gic.auth.dto.ResourceDTO
;
import
com.gic.auth.dto.SmsSignResourceDTO
;
import
java.util.List
;
/**
/**
*
*
...
@@ -58,4 +61,9 @@ public interface ResourceApiService {
...
@@ -58,4 +61,9 @@ public interface ResourceApiService {
* @throws
* @throws
*/
*/
ServiceResponse
<
ResourceDTO
>
getResource
(
Integer
resourceId
);
ServiceResponse
<
ResourceDTO
>
getResource
(
Integer
resourceId
);
/**
* 查询短信签名
*/
ServiceResponse
<
SmsSignResourceDTO
>
getSmsResourceByUserId
(
Integer
userId
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/dao/mapper/TabSysOrderAppResourceMapper.java
View file @
281e8074
package
com
.
gic
.
auth
.
dao
.
mapper
;
package
com
.
gic
.
auth
.
dao
.
mapper
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabSysOrderAppResourceMapper
{
public
interface
TabSysOrderAppResourceMapper
{
/**
/**
...
@@ -50,4 +53,6 @@ public interface TabSysOrderAppResourceMapper {
...
@@ -50,4 +53,6 @@ public interface TabSysOrderAppResourceMapper {
* @return 更新条目数
* @return 更新条目数
*/
*/
int
updateByPrimaryKey
(
TabSysOrderAppResource
record
);
int
updateByPrimaryKey
(
TabSysOrderAppResource
record
);
List
<
TabSysOrderAppResource
>
listByIds
(
@Param
(
"ids"
)
List
<
Integer
>
smsSignList
,
@Param
(
"type"
)
Integer
type
);
}
}
\ No newline at end of file
gic-platform-auth-service/src/main/java/com/gic/auth/service/OrderAppResourceService.java
View file @
281e8074
...
@@ -3,6 +3,8 @@ package com.gic.auth.service;
...
@@ -3,6 +3,8 @@ package com.gic.auth.service;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
java.util.List
;
/**
/**
*
*
* @Description:
* @Description:
...
@@ -18,4 +20,6 @@ public interface OrderAppResourceService {
...
@@ -18,4 +20,6 @@ public interface OrderAppResourceService {
Integer
del
(
Integer
orderAppResourceId
);
Integer
del
(
Integer
orderAppResourceId
);
TabSysOrderAppResource
getById
(
Integer
orderAppResourceId
);
TabSysOrderAppResource
getById
(
Integer
orderAppResourceId
);
List
<
TabSysOrderAppResource
>
listByIds
(
List
<
Integer
>
smsSignList
,
Integer
type
);
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/impl/OrderAppResourceServiceImpl.java
View file @
281e8074
...
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
*
*
...
@@ -52,4 +53,9 @@ public class OrderAppResourceServiceImpl implements OrderAppResourceService {
...
@@ -52,4 +53,9 @@ public class OrderAppResourceServiceImpl implements OrderAppResourceService {
public
TabSysOrderAppResource
getById
(
Integer
orderAppResourceId
)
{
public
TabSysOrderAppResource
getById
(
Integer
orderAppResourceId
)
{
return
tabSysOrderAppResourceMapper
.
selectByPrimaryKey
(
orderAppResourceId
);
return
tabSysOrderAppResourceMapper
.
selectByPrimaryKey
(
orderAppResourceId
);
}
}
@Override
public
List
<
TabSysOrderAppResource
>
listByIds
(
List
<
Integer
>
smsSignList
,
Integer
type
)
{
return
tabSysOrderAppResourceMapper
.
listByIds
(
smsSignList
,
type
);
}
}
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
View file @
281e8074
package
com
.
gic
.
auth
.
service
.
outer
.
impl
;
package
com
.
gic
.
auth
.
service
.
outer
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.constant.OrderOrAppEnum
;
import
com.gic.auth.constant.OrderOrAppEnum
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.dto.ResourceDTO
;
import
com.gic.auth.dto.ResourceDTO
;
import
com.gic.auth.dto.SmsSignResourceDTO
;
import
com.gic.auth.dto.UserResourceDTO
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
com.gic.auth.entity.TabSysResource
;
import
com.gic.auth.entity.TabSysResource
;
import
com.gic.auth.service.OrderAppResourceService
;
import
com.gic.auth.service.OrderAppResourceService
;
...
@@ -14,15 +19,19 @@ import com.gic.auth.service.UserResourceService;
...
@@ -14,15 +19,19 @@ import com.gic.auth.service.UserResourceService;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseServiceResponse
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -81,6 +90,7 @@ public class ResourceApiServiceImpl implements ResourceApiService {
...
@@ -81,6 +90,7 @@ public class ResourceApiServiceImpl implements ResourceApiService {
TabSysResource
resource
=
resourceService
.
getResource
(
resourceDTO
.
getResourceId
());
TabSysResource
resource
=
resourceService
.
getResource
(
resourceDTO
.
getResourceId
());
orderAppResourceService
.
del
(
resource
.
getOrderResource
());
orderAppResourceService
.
del
(
resource
.
getOrderResource
());
orderAppResourceService
.
del
(
resource
.
getAppResource
());
orderAppResourceService
.
del
(
resource
.
getAppResource
());
orderAppResourceService
.
del
(
resource
.
getSmsSignResource
());
resourceService
.
update
(
resourceDTO
);
resourceService
.
update
(
resourceDTO
);
}
}
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
...
@@ -134,4 +144,38 @@ public class ResourceApiServiceImpl implements ResourceApiService {
...
@@ -134,4 +144,38 @@ public class ResourceApiServiceImpl implements ResourceApiService {
}
}
return
ServiceResponse
.
success
(
resourceDTO
);
return
ServiceResponse
.
success
(
resourceDTO
);
}
}
@Override
public
ServiceResponse
<
SmsSignResourceDTO
>
getSmsResourceByUserId
(
Integer
userId
)
{
List
<
UserResourceDTO
>
userResourceList
=
userResourceService
.
listUserResourceByUserId
(
userId
);
if
(
CollectionUtils
.
isEmpty
(
userResourceList
))
{
return
EnterpriseServiceResponse
.
success
();
}
List
<
Integer
>
resourceIds
=
userResourceList
.
stream
().
map
(
UserResourceDTO:
:
getResourceId
).
collect
(
Collectors
.
toList
());
List
<
TabSysResource
>
resourceList
=
resourceService
.
listByIds
(
resourceIds
);
List
<
Integer
>
smsSignList
=
resourceList
.
stream
().
filter
(
Objects:
:
nonNull
).
map
(
TabSysResource:
:
getSmsSignResource
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
smsSignList
))
{
return
EnterpriseServiceResponse
.
success
();
}
List
<
TabSysOrderAppResource
>
orderAppResourceList
=
orderAppResourceService
.
listByIds
(
smsSignList
,
OrderOrAppEnum
.
SMS_SIGN
.
getCode
());
SmsSignResourceDTO
result
=
new
SmsSignResourceDTO
();
List
<
Long
>
resultIds
=
new
ArrayList
<>();
for
(
TabSysOrderAppResource
orderAppResource
:
orderAppResourceList
)
{
String
json
=
orderAppResource
.
getContent
();
if
(
StringUtils
.
isNotBlank
(
json
))
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
json
);
Integer
type
=
jsonObject
.
getInteger
(
"type"
);
if
(
type
==
1
)
{
result
.
setType
(
1
);
return
EnterpriseServiceResponse
.
success
(
result
);
}
JSONArray
ids
=
jsonObject
.
getJSONArray
(
"ids"
);
for
(
Object
id
:
ids
)
{
resultIds
.
add
(
Long
.
valueOf
(
id
.
toString
()));
}
}
}
result
.
setIds
(
resultIds
);
return
EnterpriseServiceResponse
.
success
(
result
);
}
}
}
gic-platform-auth-service/src/main/resources/mapper/TabSysOrderAppResourceMapper.xml
View file @
281e8074
...
@@ -117,4 +117,20 @@
...
@@ -117,4 +117,20 @@
status = #{status,jdbcType=INTEGER}
status = #{status,jdbcType=INTEGER}
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</update>
</update>
<select
id=
"listByIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_sys_order_app_resource
<where>
<if
test=
"type != null "
>
and type = #{type}
</if>
<if
test=
"null != ids and ids.size > 0"
>
and order_app_resource_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/ResourceController.java
View file @
281e8074
...
@@ -131,8 +131,8 @@ public class ResourceController {
...
@@ -131,8 +131,8 @@ public class ResourceController {
resourceDTO
.
setAppResourceJson
(
JSON
.
toJSONString
(
resourceQO
.
getAppResourceJSON
()));
resourceDTO
.
setAppResourceJson
(
JSON
.
toJSONString
(
resourceQO
.
getAppResourceJSON
()));
}
}
// 短信签名资源
// 短信签名资源
if
(
CollectionUtils
.
isNotEmpty
(
resourceQO
.
getSms
Sign
ResourceJSON
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
resourceQO
.
getSmsResourceJSON
()))
{
resourceDTO
.
setSmsSignResourceJson
(
JSON
.
toJSONString
(
resourceQO
.
getSms
Sign
ResourceJSON
()));
resourceDTO
.
setSmsSignResourceJson
(
JSON
.
toJSONString
(
resourceQO
.
getSmsResourceJSON
()));
}
}
ServiceResponse
<
Integer
>
response
=
resourceApiService
.
saveOrUpdateResource
(
resourceDTO
);
ServiceResponse
<
Integer
>
response
=
resourceApiService
.
saveOrUpdateResource
(
resourceDTO
);
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/qo/ResourceQO.java
View file @
281e8074
...
@@ -66,7 +66,7 @@ public class ResourceQO implements Serializable {
...
@@ -66,7 +66,7 @@ public class ResourceQO implements Serializable {
private
List
<
List
<
Long
>>
appResourceJSON
;
private
List
<
List
<
Long
>>
appResourceJSON
;
private
List
<
SmsSignResourceQO
>
sms
Sign
ResourceJSON
;
private
List
<
SmsSignResourceQO
>
smsResourceJSON
;
public
Integer
getResourceId
()
{
public
Integer
getResourceId
()
{
return
resourceId
;
return
resourceId
;
...
@@ -156,11 +156,11 @@ public class ResourceQO implements Serializable {
...
@@ -156,11 +156,11 @@ public class ResourceQO implements Serializable {
this
.
goodsResource
=
goodsResource
;
this
.
goodsResource
=
goodsResource
;
}
}
public
List
<
SmsSignResourceQO
>
getSms
Sign
ResourceJSON
()
{
public
List
<
SmsSignResourceQO
>
getSmsResourceJSON
()
{
return
sms
Sign
ResourceJSON
;
return
smsResourceJSON
;
}
}
public
void
setSms
SignResourceJSON
(
List
<
SmsSignResourceQO
>
smsSign
ResourceJSON
)
{
public
void
setSms
ResourceJSON
(
List
<
SmsSignResourceQO
>
sms
ResourceJSON
)
{
this
.
sms
SignResourceJSON
=
smsSign
ResourceJSON
;
this
.
sms
ResourceJSON
=
sms
ResourceJSON
;
}
}
}
}
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