Commit 02c3708b by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents 39074881 d4317004
......@@ -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);
}
......@@ -27,6 +27,7 @@
<gic-wechat-business-api>4.0-SNAPSHOT</gic-wechat-business-api>
<gic-member-api>4.0-SNAPSHOT</gic-member-api>
<gic-open-platform-api>4.0-SNAPSHOT</gic-open-platform-api>
<application-center-api>4.0-SNAPSHOT</application-center-api>
</properties>
<dependencies>
......@@ -136,6 +137,11 @@
<artifactId>gic-member-api</artifactId>
<version>${gic-member-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>application-center-api</artifactId>
<version>${application-center-api}</version>
</dependency>
</dependencies>
<build>
......
......@@ -4,11 +4,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.application.center.api.service.AuthorizeService;
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;
......@@ -48,6 +46,9 @@ public class ResourceApiServiceImpl implements ResourceApiService {
private OrderAppResourceService orderAppResourceService;
@Autowired
private UserService userService;
@Autowired
private AuthorizeService authorizeService;
@Override
@Transactional
......@@ -110,6 +111,11 @@ public class ResourceApiServiceImpl implements ResourceApiService {
return ServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "该资源组正在使用中,不能删除");
}
Integer line = resourceService.delResource(resourceId);
if (line > 0) {
// 同步好办
authorizeService.delResource(resourceId.longValue());
}
return ServiceResponse.success(line);
}
......@@ -201,4 +207,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);
}
}
......@@ -55,4 +55,5 @@
<dubbo:reference interface="com.gic.enterprise.service.EnterpriseApiService" id="enterpriseApiService" timeout="6000"/>
<dubbo:service interface="com.gic.auth.service.UserResourceApiService" ref="userResourceApiService" timeout="6000" />
<dubbo:service interface="com.gic.auth.service.BusinessFrontResApiService" ref="businessFrontResApiService" timeout="6000" />
<dubbo:reference interface="com.gic.application.center.api.service.AuthorizeService" id="authorizeService" timeout="6000" />
</beans>
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