完善系统参数配置和数据字典管理模块
This commit is contained in:
@@ -1,10 +1,54 @@
|
||||
using Model;
|
||||
using Model.Dto.System;
|
||||
using SqlSugar;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Service.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据字典管理 服务接口
|
||||
/// 约定:字典分类(DictType) + 字典项(DictItem) 二层结构,不支持级联
|
||||
/// </summary>
|
||||
public interface IDictService
|
||||
{
|
||||
// TODO: 定义 数据字典管理 相关方法
|
||||
// ==================== 字典分类 ====================
|
||||
|
||||
/// <summary>分页查询字典分类(关键字匹配 Code/Name)</summary>
|
||||
Task<Result<List<DictTypeDto>>> GetTypesPagedAsync(int pageIndex, int pageSize, RefAsync<int> total, string? keyword = null);
|
||||
|
||||
/// <summary>全部启用的字典分类(下拉用,不缓存)</summary>
|
||||
Task<Result<List<DictTypeDto>>> GetTypesAllAsync();
|
||||
|
||||
/// <summary>字典分类详情</summary>
|
||||
Task<Result<DictTypeDto>> GetTypeByIdAsync(long id);
|
||||
|
||||
/// <summary>新增字典分类(校验编码唯一)</summary>
|
||||
Task<Result<DictTypeDto>> AddTypeAsync(DictTypeDto dto);
|
||||
|
||||
/// <summary>修改字典分类</summary>
|
||||
Task<Result<DictTypeDto>> UpdateTypeAsync(DictTypeDto dto);
|
||||
|
||||
/// <summary>删除字典分类(分类下有字典项时禁止删除)</summary>
|
||||
Task<Result> DeleteTypeAsync(long id);
|
||||
|
||||
// ==================== 字典项 ====================
|
||||
|
||||
/// <summary>查询指定分类下的字典项(按 Sort、CreateTime 倒序)</summary>
|
||||
Task<Result<List<DictItemDto>>> GetItemsByTypeAsync(long typeId);
|
||||
|
||||
/// <summary>新增字典项(校验同分类下编码唯一;IsDefault=1 时清零其它默认项)</summary>
|
||||
Task<Result<DictItemDto>> AddItemAsync(DictItemDto dto);
|
||||
|
||||
/// <summary>修改字典项</summary>
|
||||
Task<Result<DictItemDto>> UpdateItemAsync(DictItemDto dto);
|
||||
|
||||
/// <summary>删除字典项</summary>
|
||||
Task<Result> DeleteItemAsync(long id);
|
||||
|
||||
// ==================== 业务侧(无权限,供其它模块调用) ====================
|
||||
|
||||
/// <summary>按字典编码查询启用项(带 IMemoryCache 缓存,增删改时失效)</summary>
|
||||
Task<Result<List<DictOptionDto>>> GetOptionsByCodeAsync(string typeCode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user