diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/SettingController.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/SettingController.cs new file mode 100644 index 00000000..f30ecc46 --- /dev/null +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/SettingController.cs @@ -0,0 +1,55 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Yi.Framework.Common.Const; +using Yi.Framework.Common.Models; +using Yi.Framework.DTOModel; +using Yi.Framework.Interface; +using Yi.Framework.Model.Models; +using Yi.Framework.WebCore; + +namespace Yi.Framework.ApiMicroservice.Controllers +{ + [ApiController] + [Route("api/[controller]/[action]")] + [Authorize] + public class SettingController : ControllerBase + { + private readonly ILogger _logger; + + public SettingController(ILogger logger) + { + _logger = logger; + } + + + + /// + /// 查 + /// + /// + [HttpGet] + public async Task GetSetting() + { + var p = RedisConst.stringData[RedisConst.ImageList_key]; + return Result.Success(); + } + + /// + /// 更 + /// + /// + /// + [HttpPut] + public async Task UpdateSetting() + { + + return Result.Success(); + + } + } +} diff --git a/Yi.Framework/Yi.Framework.Common/Const/RedisConst.cs b/Yi.Framework/Yi.Framework.Common/Const/RedisConst.cs new file mode 100644 index 00000000..3a22a248 --- /dev/null +++ b/Yi.Framework/Yi.Framework.Common/Const/RedisConst.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.Common.Const +{ + public class RedisConst + { + /// + /// 前缀 + /// + private const string prefix = "Yi:"; + + /// + /// 初始化角色名 + /// + public const string InitRole_key = nameof(InitRole_key); + + /// + /// 标题名 + /// + public const string Title_key = nameof(Title_key); + + /// + /// 图片列表名 + /// + public const string ImageList_key = nameof(ImageList_key); + + public static Dictionary stringData = new Dictionary() + { + {prefix+nameof(InitRole_key), "普通用户"}, + {prefix+nameof(Title_key), "YiFramework"}, + }; + + public static Dictionary> listData = new Dictionary>() + { + {prefix+nameof(ImageList_key), new List(){"图片地址1", "图片地址2", "图片地址3", "图片地址4" } } + }; + } +} diff --git a/Yi.Framework/Yi.Framework.DTOModel/SettingDto.cs b/Yi.Framework/Yi.Framework.DTOModel/SettingDto.cs new file mode 100644 index 00000000..a327a37e --- /dev/null +++ b/Yi.Framework/Yi.Framework.DTOModel/SettingDto.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.DTOModel +{ + public class SettingDto + { + } +}