重构:重构部门管理前端代码;新增修改部门、批量删除部门、查看部门详情功能(后端主要基于 CRUD 通用组件提供 API)

This commit is contained in:
2023-02-01 23:25:36 +08:00
parent d27339ef3b
commit c5d4e8ae21
13 changed files with 532 additions and 504 deletions

View File

@@ -37,7 +37,7 @@ public @interface CrudRequestMapping {
/**
* API 列表
*/
Api[] api() default {Api.PAGE, Api.DETAIL, Api.CREATE, Api.UPDATE, Api.DELETE};
Api[] api() default {Api.PAGE, Api.GET, Api.CREATE, Api.UPDATE, Api.DELETE};
/**
* API 枚举
@@ -58,7 +58,7 @@ public @interface CrudRequestMapping {
/**
* 详情
*/
DETAIL,
GET,
/**
* 新增
*/

View File

@@ -93,12 +93,12 @@ public abstract class BaseController<S extends BaseService<V, D, Q, C>, V, D, Q,
* ID
* @return 详情信息
*/
@Operation(summary = "查看数据详情")
@Operation(summary = "查看详情")
@Parameter(name = "id", description = "ID", in = ParameterIn.PATH)
@ResponseBody
@GetMapping("/{id}")
protected R<D> detail(@PathVariable Long id) {
D detail = baseService.detail(id);
protected R<D> get(@PathVariable Long id) {
D detail = baseService.get(id);
return R.ok(detail);
}

View File

@@ -64,7 +64,7 @@ public interface BaseService<V, D, Q, C extends BaseRequest> {
* ID
* @return 详情信息
*/
D detail(Long id);
D get(Long id);
/**
* 新增

View File

@@ -76,7 +76,7 @@ public abstract class BaseServiceImpl<M extends BaseMapper<T>, T, V, D, Q, C ext
}
@Override
public D detail(Long id) {
public D get(Long id) {
T entity = this.getById(id);
return BeanUtil.copyProperties(entity, detailVoClass);
}

View File

@@ -69,8 +69,8 @@ public class PageQuery implements Serializable {
/** 默认页码1 */
private static final int DEFAULT_PAGE = 1;
/** 默认每页记录数:int 最大值 */
private static final int DEFAULT_SIZE = Integer.MAX_VALUE;
/** 默认每页记录数:10 */
private static final int DEFAULT_SIZE = 10;
private static final String DELIMITER = ",";
public PageQuery() {