1 changed files with 0 additions and 68 deletions
@ -1,68 +0,0 @@ |
|||||
package com.crm.dict.controller; |
|
||||
|
|
||||
import com.crm.base.domain.result.PageResult; |
|
||||
import com.crm.base.domain.result.Result; |
|
||||
import com.crm.dict.constant.DictConstants; |
|
||||
import com.crm.dict.domain.dto.DictGroupDTO; |
|
||||
import com.crm.dict.domain.param.GroupPageParam; |
|
||||
import com.crm.dict.service.IDictGroupService; |
|
||||
import io.swagger.v3.oas.annotations.Operation; |
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
|
||||
import lombok.RequiredArgsConstructor; |
|
||||
import org.springframework.security.access.prepost.PreAuthorize; |
|
||||
import org.springframework.web.bind.annotation.GetMapping; |
|
||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RequestParam; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* 字典分组管理接口(薄适配层,只调 {@link IDictGroupService},不含业务逻辑) |
|
||||
*/ |
|
||||
@Tag(name = "A7 后台管理/数据字典/分组") |
|
||||
@RestController |
|
||||
@RequestMapping("/api/dict/group") |
|
||||
@RequiredArgsConstructor |
|
||||
public class DictGroupController { |
|
||||
|
|
||||
private final IDictGroupService dictGroupService; |
|
||||
|
|
||||
@Operation(summary = "分组分页(keyword 匹配名称/编码,status 筛选)") |
|
||||
@PreAuthorize("hasAuthority('" + DictConstants.PERM_GROUP_LIST + "')") |
|
||||
@PostMapping("/page") |
|
||||
public Result<PageResult<DictGroupDTO>> page(GroupPageParam param) { |
|
||||
return Result.success(dictGroupService.pageGroups(param)); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "新建/编辑分组(新建编码必填;编码创建后只读;编辑弹窗状态可直接改,保存即生效)") |
|
||||
@PreAuthorize("hasAuthority('" + DictConstants.PERM_GROUP_SAVE + "')") |
|
||||
@PostMapping("/saveOrUpdate") |
|
||||
public Result<Void> saveOrUpdate(DictGroupDTO dto) { |
|
||||
dictGroupService.saveGroup(dto); |
|
||||
return Result.success(); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "删除分组(有字典项或内置分组则阻断)") |
|
||||
@PreAuthorize("hasAuthority('" + DictConstants.PERM_GROUP_DELETE + "')") |
|
||||
@PostMapping("/delete") |
|
||||
public Result<Void> delete(@RequestParam("id") Long id) { |
|
||||
dictGroupService.deleteGroup(id); |
|
||||
return Result.success(); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "分组启停(停用保留默认项休眠,二次确认由前端承担)") |
|
||||
@PreAuthorize("hasAuthority('" + DictConstants.PERM_GROUP_STATUS + "')") |
|
||||
@PostMapping("/status") |
|
||||
public Result<Void> status(@RequestParam("id") Long id, @RequestParam("status") Integer status) { |
|
||||
dictGroupService.updateGroupStatus(id, status); |
|
||||
return Result.success(); |
|
||||
} |
|
||||
|
|
||||
@Operation(summary = "启用分组列表(新建字典项选分组用;基础数据,登录即可读)") |
|
||||
@GetMapping("/enabled-list") |
|
||||
public Result<List<DictGroupDTO>> enabledList() { |
|
||||
return Result.success(dictGroupService.listEnabled()); |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue