Commit 1b70bdb0 by zhiwj

资源组添加应用资源

parent 4bd83e95
......@@ -23,6 +23,7 @@
<gic-store-api>4.0-SNAPSHOT</gic-store-api>
<gic-redis-data>4.0-SNAPSHOT</gic-redis-data>
<gic-marketing-api>4.0-SNAPSHOT</gic-marketing-api>
<gic-open-platform-api>4.0-SNAPSHOT</gic-open-platform-api>
</properties>
<dependencies>
......@@ -148,6 +149,11 @@
<artifactId>gic-enterprise-download</artifactId>
<version>${gic-enterprise-download}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-open-platform-api</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
......
......@@ -22,6 +22,10 @@ import com.gic.goods.api.dto.GoodsRightsSelectorDTO;
import com.gic.goods.api.service.GoodsRightsSelectorApiService;
import com.gic.marketing.api.dto.sms.EnterpriseSmsSignDTO;
import com.gic.marketing.api.service.sms.SmsApiService;
import com.gic.open.api.dto.ApplicationDTO;
import com.gic.open.api.dto.ApplicationSubDTO;
import com.gic.open.api.service.AppTokenApiService;
import com.gic.open.api.service.ApplicationSubApiService;
import com.gic.store.dto.StoreWidgetDTO;
import com.gic.store.service.StoreWidgetApiService;
import org.apache.commons.collections.CollectionUtils;
......@@ -51,6 +55,28 @@ public class ResourceController {
private GoodsRightsSelectorApiService goodsRightsSelectorApiService;
@Autowired
private SmsApiService smsApiService;
@Autowired
private AppTokenApiService appTokenApiService;
@Autowired
private ApplicationSubApiService applicationSubApiService;
@RequestMapping("/list-resource-app")
public RestResponse listResourceApp() {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
ServiceResponse<List<ApplicationDTO>> appServiceResponse = appTokenApiService.listApplicationByEnterpriseId(Long.valueOf(enterpriseId), 0);
if (!appServiceResponse.isSuccess()) {
return ResultControllerUtils.commonResult(appServiceResponse);
}
List<ApplicationDTO> appDTOList = appServiceResponse.getResult();
List<ApplicationVO> appVOList = EntityUtil.changeEntityListByJSON(ApplicationVO.class, appDTOList);
for (ApplicationVO applicationVO : appVOList) {
ServiceResponse<List<ApplicationSubDTO>> subServiceResponse = applicationSubApiService.listSubApp(enterpriseId, applicationVO.getApplicationId());
if (subServiceResponse.isSuccess()) {
applicationVO.setChildList(subServiceResponse.getResult());
}
}
return RestResponse.success(appVOList);
}
@RequestMapping("/list-sms-sign")
public RestResponse listSmsSign(String search) {
......
package com.gic.auth.web.vo;
import com.gic.open.api.dto.ApplicationDTO;
import com.gic.open.api.dto.ApplicationSubDTO;
import java.util.List;
/**
*
* @Description:
* @author zhiwj
* @date 2019-11-06 11:36
*/
public class ApplicationVO extends ApplicationDTO {
private static final long serialVersionUID = 4558390896804884123L;
private List<ApplicationSubDTO> childList;
public List<ApplicationSubDTO> getChildList() {
return childList;
}
public void setChildList(List<ApplicationSubDTO> childList) {
this.childList = childList;
}
}
......@@ -63,4 +63,7 @@
<dubbo:reference interface="com.gic.marketing.api.service.sms.SmsApiService" id="smsApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.DownloadReportApiService" id="downloadReportApiService" timeout="6000"/>
<!--应用-->
<dubbo:reference interface="com.gic.open.api.service.ApplicationSubApiService" id="applicationSubApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.open.api.service.AppTokenApiService" id="appTokenApiService" timeout="6000"/>
</beans>
\ No newline at end of file
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