设置模块
This commit is contained in:
@@ -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<SettingController> _logger;
|
||||||
|
|
||||||
|
public SettingController(ILogger<SettingController> logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<Result> GetSetting()
|
||||||
|
{
|
||||||
|
var p = RedisConst.stringData[RedisConst.ImageList_key];
|
||||||
|
return Result.Success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_Setting"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPut]
|
||||||
|
public async Task<Result> UpdateSetting()
|
||||||
|
{
|
||||||
|
|
||||||
|
return Result.Success();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
42
Yi.Framework/Yi.Framework.Common/Const/RedisConst.cs
Normal file
42
Yi.Framework/Yi.Framework.Common/Const/RedisConst.cs
Normal file
@@ -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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 前缀
|
||||||
|
/// </summary>
|
||||||
|
private const string prefix = "Yi:";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化角色名
|
||||||
|
/// </summary>
|
||||||
|
public const string InitRole_key = nameof(InitRole_key);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 标题名
|
||||||
|
/// </summary>
|
||||||
|
public const string Title_key = nameof(Title_key);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片列表名
|
||||||
|
/// </summary>
|
||||||
|
public const string ImageList_key = nameof(ImageList_key);
|
||||||
|
|
||||||
|
public static Dictionary<string, string> stringData = new Dictionary<string, string>()
|
||||||
|
{
|
||||||
|
{prefix+nameof(InitRole_key), "普通用户"},
|
||||||
|
{prefix+nameof(Title_key), "YiFramework"},
|
||||||
|
};
|
||||||
|
|
||||||
|
public static Dictionary<string, List<string>> listData = new Dictionary<string, List<string>>()
|
||||||
|
{
|
||||||
|
{prefix+nameof(ImageList_key), new List<string>(){"图片地址1", "图片地址2", "图片地址3", "图片地址4" } }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Yi.Framework/Yi.Framework.DTOModel/SettingDto.cs
Normal file
12
Yi.Framework/Yi.Framework.DTOModel/SettingDto.cs
Normal file
@@ -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
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user