|
@@ -4,14 +4,21 @@ import com.dragoninfo.dcuc.app.entity.ServiceResource;
|
|
|
import com.dragoninfo.dcuc.app.facade.IServiceResourceFacade;
|
|
|
import com.dragoninfo.dcuc.app.vo.ServiceResourceVo;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ServiceResourceBaseVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.user.manager.utils.ImpExcelUtils;
|
|
|
import com.dragoninfo.dcuc.authweb.util.VersionUtils;
|
|
|
+import com.dragoninfo.dcuc.duceap.facade.IDuceapUploadFacade;
|
|
|
+import com.dragoninfo.dcuc.duceap.upload.dto.DocContentDTO;
|
|
|
import com.dragoninfo.duceap.core.response.Result;
|
|
|
+import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
|
import com.dragonsoft.duceap.base.entity.search.SearchDTO;
|
|
|
+import com.dragonsoft.duceap.commons.util.json.JsonUtils;
|
|
|
import com.dragonsoft.duceap.core.search.Searchable;
|
|
|
import com.dragonsoft.duceap.core.search.enums.SearchOperator;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -20,6 +27,10 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.io.ByteArrayInputStream;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.InputStream;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -31,9 +42,13 @@ import java.util.List;
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/authsvr/" + VersionUtils.VERSION_UID + "/resource/")
|
|
|
public class ServiceResourceController {
|
|
|
+ public static Logger logger = LoggerFactory.getLogger(ServiceResourceController.class);
|
|
|
@Autowired
|
|
|
private IServiceResourceFacade serviceResourceFacade;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IDuceapUploadFacade uploadhandler;
|
|
|
+
|
|
|
@ApiOperation(value = "服务资源列表")
|
|
|
@ApiImplicitParam(name = "serviceName", value = "查询条件")
|
|
|
@PostMapping(value = "search/drop")
|
|
@@ -61,4 +76,15 @@ public class ServiceResourceController {
|
|
|
Page<ServiceResourceVo> page = serviceResourceFacade.page(searchable.toSearchDTO());
|
|
|
return Result.success(page.getTotalElements(), page.getContent());
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping(value = "/import")
|
|
|
+ @ApiImplicitParam(name = "fileId", value = "导入文件id")
|
|
|
+ @ApiOperation(value = "授权主客体管理_服务资源导入")
|
|
|
+ public Result impExcel(@RequestBody String fileId) {
|
|
|
+ ResponseStatus responseStatus = serviceResourceFacade.impExcel(fileId);
|
|
|
+ if (!responseStatus.getStatusCode().equals("200")){
|
|
|
+ return Result.fail(responseStatus.getStatusCode(), responseStatus.getMessage());
|
|
|
+ }
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
}
|