|
|
@@ -0,0 +1,94 @@
|
|
|
+package cn.iocoder.yudao.module.system.controller.admin.homepage;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
+import cn.iocoder.yudao.module.system.controller.admin.homepage.vo.PageUiComponentPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.system.controller.admin.homepage.vo.PageUiComponentRespVO;
|
|
|
+import cn.iocoder.yudao.module.system.controller.admin.homepage.vo.PageUiComponentSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.system.dal.dataobject.homepage.PageUiComponentDO;
|
|
|
+import cn.iocoder.yudao.module.system.service.homepage.PageUiComponentService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import jakarta.validation.Valid;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - iscs驾驶舱页面和组件关联")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/sys/page-ui-component")
|
|
|
+@Validated
|
|
|
+public class PageUiComponentController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private PageUiComponentService pageUiComponentService;
|
|
|
+
|
|
|
+ @PostMapping("/insertPageUiComponent")
|
|
|
+ @Operation(summary = "创建iscs驾驶舱页面和组件关联")
|
|
|
+ @PreAuthorize("@ss.hasPermission('sys:page-ui-component:create')")
|
|
|
+ public CommonResult<Long> insertPageUiComponent(@Valid @RequestBody PageUiComponentSaveReqVO createReqVO) {
|
|
|
+ return success(pageUiComponentService.createPageUiComponent(createReqVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/updatePageUiComponent")
|
|
|
+ @Operation(summary = "更新iscs驾驶舱页面和组件关联")
|
|
|
+ @PreAuthorize("@ss.hasPermission('sys:page-ui-component:update')")
|
|
|
+ public CommonResult<Boolean> updatePageUiComponent(@Valid @RequestBody PageUiComponentSaveReqVO updateReqVO) {
|
|
|
+ pageUiComponentService.updatePageUiComponent(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/deletePageUiComponentList")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除iscs驾驶舱页面和组件关联")
|
|
|
+ @PreAuthorize("@ss.hasPermission('sys:page-ui-component:delete')")
|
|
|
+ public CommonResult<Boolean> deletePageUiComponentList(@RequestParam("ids") List<Long> ids) {
|
|
|
+ pageUiComponentService.deletePageUiComponentListByIds(ids);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/selectPageUiComponentById")
|
|
|
+ @Operation(summary = "获得iscs驾驶舱页面和组件关联")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ @PreAuthorize("@ss.hasPermission('sys:page-ui-component:query')")
|
|
|
+ public CommonResult<PageUiComponentRespVO> selectPageUiComponentById(@RequestParam("id") Long id) {
|
|
|
+ PageUiComponentDO pageUiComponent = pageUiComponentService.getPageUiComponent(id);
|
|
|
+ return success(BeanUtils.toBean(pageUiComponent, PageUiComponentRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getPageUiComponentPage")
|
|
|
+ @Operation(summary = "获得iscs驾驶舱页面和组件关联分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('sys:page-ui-component:query')")
|
|
|
+ public CommonResult<PageResult<PageUiComponentRespVO>> getPageUiComponentPage(@Valid PageUiComponentPageReqVO pageReqVO) {
|
|
|
+ PageResult<PageUiComponentDO> pageResult = pageUiComponentService.getPageUiComponentPage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, PageUiComponentRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/exportPageUiComponentExcel")
|
|
|
+ @Operation(summary = "导出iscs驾驶舱页面和组件关联 Excel")
|
|
|
+ @PreAuthorize("@ss.hasPermission('sys:page-ui-component:export')")
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
+ public void exportPageUiComponentExcel(@Valid PageUiComponentPageReqVO pageReqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<PageUiComponentDO> list = pageUiComponentService.getPageUiComponentPage(pageReqVO).getList();
|
|
|
+ // 导出 Excel
|
|
|
+ ExcelUtils.write(response, "iscs驾驶舱页面和组件关联.xls", "数据", PageUiComponentRespVO.class,
|
|
|
+ BeanUtils.toBean(list, PageUiComponentRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|