|
@@ -0,0 +1,56 @@
|
|
|
+package com.dragoninfo.dcuc.authweb.restcontroller.sub;
|
|
|
+
|
|
|
+import com.dragoninfo.dcuc.app.facade.sub.IAppDataResourceInfoFacade;
|
|
|
+import com.dragoninfo.dcuc.app.vo.AppDataResourceInfoRespVO;
|
|
|
+import com.dragoninfo.dcuc.app.vo.AppDataResourcePageVo;
|
|
|
+import com.dragoninfo.duceap.core.response.Result;
|
|
|
+import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
|
+import com.dragonsoft.duceap.base.entity.search.SearchDTO;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author mazq
|
|
|
+ * @date 2023/6/28
|
|
|
+ */
|
|
|
+@Api(tags = "数据集管理")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/app-data-resource/v2/")
|
|
|
+public class AppDataResourceController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IAppDataResourceInfoFacade appDataResourceInfoFacade;
|
|
|
+
|
|
|
+ @ApiOperation(value = "数据集分页查询")
|
|
|
+ @PostMapping("/page")
|
|
|
+ public Result<List<AppDataResourcePageVo>> pageSearch(SearchDTO searchDTO) {
|
|
|
+ Page<AppDataResourcePageVo> pageVos = appDataResourceInfoFacade.pageSearch(searchDTO);
|
|
|
+ return Result.success(pageVos.getTotalElements(), pageVos.getContent());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询详情")
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public Result<AppDataResourceInfoRespVO> detail(@PathVariable("id") String id) {
|
|
|
+ return Result.success(appDataResourceInfoFacade.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除资源")
|
|
|
+ @DeleteMapping("/{id}")
|
|
|
+ public Result<Object> deleteById(@PathVariable("id") String id) {
|
|
|
+ ResponseStatus responseStatus = appDataResourceInfoFacade.deleteById(id);
|
|
|
+ return getResult(responseStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Result<Object> getResult(ResponseStatus responseStatus) {
|
|
|
+ Result<Object> result = new Result<>();
|
|
|
+ result.setMsg(responseStatus.getMessage());
|
|
|
+ result.setResult(responseStatus.getStatusCode());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|