47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using LiveForum.Code.Base;
|
|
using LiveForum.Model.Dto.Others;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace LiveForum.IService.Others
|
|
{
|
|
/// <summary>
|
|
/// 应用配置服务接口
|
|
/// </summary>
|
|
public interface IConfigService
|
|
{
|
|
/// <summary>
|
|
/// 获取应用配置(全部)
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
Task<BaseResponse<Dictionary<string, object>>> GetAppConfig();
|
|
|
|
/// <summary>
|
|
/// 获取单个配置值
|
|
/// </summary>
|
|
/// <typeparam name="T">返回值类型(如 string, int, bool 等,支持引用类型)</typeparam>
|
|
/// <param name="key">配置键,支持嵌套路径,如 "AppIcon" 或 "upload_config:cosdomain"</param>
|
|
/// <param name="defaultValue">默认值(如果配置不存在时返回)</param>
|
|
/// <returns>配置值,如果不存在返回默认值</returns>
|
|
Task<BaseResponse<T>> GetConfigValue<T>(string key, T defaultValue = default(T));
|
|
|
|
/// <summary>
|
|
/// 获取协议内容
|
|
/// </summary>
|
|
/// <param name="request">请求参数</param>
|
|
/// <returns></returns>
|
|
Task<BaseResponse<AgreementDto>> GetAgreement(GetAgreementReq request);
|
|
|
|
/// <summary>
|
|
/// 检查更新
|
|
/// </summary>
|
|
/// <param name="request">请求参数</param>
|
|
/// <returns></returns>
|
|
Task<BaseResponse<UpdateInfoDto>> CheckUpdate(CheckUpdateReq request);
|
|
}
|
|
}
|