Commit 946af092 by zhiwj

查询渠道资源

parent c4fd436a
......@@ -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() {
......
......@@ -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);
}
......@@ -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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment