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
946af092
Commit
946af092
authored
Feb 10, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询渠道资源
parent
c4fd436a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
13 deletions
+50
-13
ChannelResourceDTO.java
...pi/src/main/java/com/gic/auth/dto/ChannelResourceDTO.java
+9
-0
ResourceApiService.java
...rc/main/java/com/gic/auth/service/ResourceApiService.java
+20
-9
ResourceApiServiceImpl.java
...m/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
+21
-4
No files found.
gic-platform-auth-api/src/main/java/com/gic/auth/dto/ChannelResourceDTO.java
View file @
946af092
...
...
@@ -11,8 +11,17 @@ import java.util.List;
public
class
ChannelResourceDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
7372101518056686792L
;
/**
* 会员卡id
*/
private
List
<
Long
>
cardConfigIdList
;
/**
* 小程序id
*/
private
List
<
Long
>
appletConfigIdList
;
/**
* 服务号id
*/
private
List
<
Long
>
serviceConfigIdList
;
public
List
<
Long
>
getCardConfigIdList
()
{
...
...
gic-platform-auth-api/src/main/java/com/gic/auth/service/ResourceApiService.java
View file @
946af092
...
...
@@ -2,13 +2,14 @@ package com.gic.auth.service;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.ChannelResourceDTO
;
import
com.gic.auth.dto.ResourceDTO
;
import
com.gic.auth.dto.SmsSignResourceDTO
;
/**
*
*
* @ClassName: ResourceApiService
* @Description:
* @Description:
* @author zhiwj
* @date 2019/8/28 18:14
*/
...
...
@@ -18,10 +19,10 @@ public interface ResourceApiService {
* 保存或更新资源
* @Title: saveOrUpdateResource
* @Description: 保存或更新资源
* @author zhiwj
* @author zhiwj
* @param resourceDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
* @throws
*/
ServiceResponse
<
Integer
>
saveOrUpdateResource
(
ResourceDTO
resourceDTO
);
...
...
@@ -29,10 +30,10 @@ public interface ResourceApiService {
* 删除资源
* @Title: delResource
* @Description: 删除资源
* @author zhiwj
* @author zhiwj
* @param resourceId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
* @throws
*/
ServiceResponse
<
Integer
>
delResource
(
Integer
resourceId
);
...
...
@@ -52,11 +53,11 @@ public interface ResourceApiService {
/**
* 查询资源详情
* @Title: getResource
* @Description:
* @author zhiwj
* @Description:
* @author zhiwj
* @param resourceId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.auth.dto.ResourceDTO>>
* @throws
* @throws
*/
ServiceResponse
<
ResourceDTO
>
getResource
(
Integer
resourceId
);
...
...
@@ -70,4 +71,14 @@ public interface ResourceApiService {
* @throws
*/
ServiceResponse
<
SmsSignResourceDTO
>
getSmsResourceByUserId
(
Integer
userId
);
/**
* 查询用户的渠道资源
* @Title: getChannelResourceByUserId
* @Description:
* @author zhiwj
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
ChannelResourceDTO
>
getChannelResourceByUserId
(
Integer
userId
);
}
gic-platform-auth-service/src/main/java/com/gic/auth/service/outer/impl/ResourceApiServiceImpl.java
View file @
946af092
...
...
@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.constant.OrderOrAppEnum
;
import
com.gic.auth.dto.OrderAppResourceDTO
;
import
com.gic.auth.dto.ResourceDTO
;
import
com.gic.auth.dto.SmsSignResourceDTO
;
import
com.gic.auth.dto.UserResourceDTO
;
import
com.gic.auth.dto.*
;
import
com.gic.auth.entity.TabSysOrderAppResource
;
import
com.gic.auth.entity.TabSysResource
;
import
com.gic.auth.entity.TabSysUser
;
...
...
@@ -49,6 +46,7 @@ public class ResourceApiServiceImpl implements ResourceApiService {
@Autowired
private
UserService
userService
;
@Override
@Transactional
public
ServiceResponse
<
Integer
>
saveOrUpdateResource
(
ResourceDTO
resourceDTO
)
{
...
...
@@ -201,4 +199,23 @@ public class ResourceApiServiceImpl implements ResourceApiService {
result
.
setType
(
2
);
return
EnterpriseServiceResponse
.
success
(
result
);
}
@Override
public
ServiceResponse
<
ChannelResourceDTO
>
getChannelResourceByUserId
(
Integer
userId
)
{
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
());
if
(
resource
.
getChannelResource
()
==
null
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
TabSysOrderAppResource
channelResource
=
orderAppResourceService
.
getById
(
resource
.
getChannelResource
());
ChannelResourceDTO
channelResourceDTO
=
JSON
.
parseObject
(
channelResource
.
getContent
(),
ChannelResourceDTO
.
class
);
return
EnterpriseServiceResponse
.
success
(
channelResourceDTO
);
}
}
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