|
@@ -6,8 +6,11 @@ import cn.iocoder.yudao.module.system.controller.admin.dictTenant.vo.data.DictDa
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.dictTenant.vo.data.DictDataTenantRespVO;
|
|
|
import cn.iocoder.yudao.module.system.controller.admin.dictTenant.vo.data.DictDataTenantSaveReqVO;
|
|
|
|
|
|
+import cn.iocoder.yudao.module.system.controller.admin.dictTenant.vo.data.DictDataTenantUpdateReqVO;
|
|
|
import cn.iocoder.yudao.module.system.dal.dataobject.dictTenant.DictDataTenantDO;
|
|
|
import cn.iocoder.yudao.module.system.service.dictTenant.DictDataTenantService;
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import org.springdoc.api.annotations.ParameterObject;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -36,7 +39,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
|
|
|
|
@Tag(name = "管理后台 - 租户字典数据")
|
|
|
@RestController
|
|
|
-@RequestMapping("/tenant/dict-data")
|
|
|
+@RequestMapping("/system/tenant/dict-data")
|
|
|
@Validated
|
|
|
public class DictDataTenantController {
|
|
|
|
|
@@ -45,6 +48,7 @@ public class DictDataTenantController {
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
@Operation(summary = "新增租户字典数据")
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
@PreAuthorize("@ss.hasPermission('tenant:dict-data:create')")
|
|
|
public CommonResult<Long> createDictData(@Valid @RequestBody DictDataTenantSaveReqVO createReqVO) {
|
|
|
return success(dictDataTenantService.createDictData(createReqVO));
|
|
@@ -52,14 +56,16 @@ public class DictDataTenantController {
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
@Operation(summary = "修改租户字典数据")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
@PreAuthorize("@ss.hasPermission('tenant:dict-data:update')")
|
|
|
- public CommonResult<Boolean> updateDictData(@Valid @RequestBody DictDataTenantPageReqVO updateReqVO) {
|
|
|
+ public CommonResult<Boolean> updateDictData(@Valid @RequestBody DictDataTenantUpdateReqVO updateReqVO) {
|
|
|
dictDataTenantService.updateDictData(updateReqVO);
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
@Operation(summary = "删除租户字典数据")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
@PreAuthorize("@ss.hasPermission('tenant:dict-data:delete')")
|
|
|
public CommonResult<Boolean> deleteDictData(@RequestParam("id") Long id) {
|
|
@@ -67,17 +73,9 @@ public class DictDataTenantController {
|
|
|
return success(true);
|
|
|
}
|
|
|
|
|
|
- @GetMapping(value = {"/list-all-simple", "simple-list"})
|
|
|
- @Operation(summary = "获得全部字典数据列表", description = "一般用于管理后台缓存字典数据在本地")
|
|
|
- // 无需添加权限认证,因为前端全局都需要
|
|
|
- public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDataList() {
|
|
|
- List<DictDataTenantDO> list = dictDataTenantService.getDictDataList(
|
|
|
- CommonStatusEnum.ENABLE.getStatus(), null);
|
|
|
- return success(BeanUtils.toBean(list, DictDataSimpleRespVO.class));
|
|
|
- }
|
|
|
-
|
|
|
@GetMapping("/get")
|
|
|
@Operation(summary = "获得租户字典数据")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
@PreAuthorize("@ss.hasPermission('tenant:dict-data:query')")
|
|
|
public CommonResult<DictDataTenantRespVO> getDictData(@RequestParam("id") Long id) {
|
|
@@ -87,17 +85,19 @@ public class DictDataTenantController {
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
@Operation(summary = "获得租户字典数据分页")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
@PreAuthorize("@ss.hasPermission('tenant:dict-data:query')")
|
|
|
- public CommonResult<PageResult<DictDataTenantRespVO>> getDictDataPage(@Valid DictDataTenantPageReqVO pageReqVO) {
|
|
|
+ public CommonResult<PageResult<DictDataTenantRespVO>> getDictDataPage(@Valid @ParameterObject DictDataTenantPageReqVO pageReqVO) {
|
|
|
PageResult<DictDataTenantDO> pageResult = dictDataTenantService.getDictDataPage(pageReqVO);
|
|
|
return success(BeanUtils.toBean(pageResult, DictDataTenantRespVO.class));
|
|
|
}
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
@Operation(summary = "导出租户字典数据 Excel")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
@PreAuthorize("@ss.hasPermission('tenant:dict-data:export')")
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
- public void exportDictDataExcel(@Valid DictDataTenantPageReqVO pageReqVO,
|
|
|
+ public void exportDictDataExcel(@Valid @ParameterObject DictDataTenantPageReqVO pageReqVO,
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
List<DictDataTenantDO> list = dictDataTenantService.getDictDataPage(pageReqVO).getList();
|
|
@@ -106,4 +106,14 @@ public class DictDataTenantController {
|
|
|
BeanUtils.toBean(list, DictDataTenantRespVO.class));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping(value = {"/list-all-simple", "simple-list"})
|
|
|
+ @Operation(summary = "获得全部字典数据列表", description = "一般用于管理后台缓存字典数据在本地")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ // 无需添加权限认证,因为前端全局都需要
|
|
|
+ public CommonResult<List<DictDataSimpleRespVO>> getSimpleDictDataList() {
|
|
|
+ List<DictDataTenantDO> list = dictDataTenantService.getDictDataList(
|
|
|
+ CommonStatusEnum.ENABLE.getStatus(), null);
|
|
|
+ return success(BeanUtils.toBean(list, DictDataSimpleRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
}
|