|
|
|
@ -0,0 +1,58 @@
|
|
|
|
|
using Infrastructure;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using OpenAuth.App;
|
|
|
|
|
using OpenAuth.App.Response;
|
|
|
|
|
using OpenAuth.Repository.Domain;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace OpenAuth.WebApi.Controllers.BaseControllers
|
|
|
|
|
{
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class SysAppSettingController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
private readonly SysAppSettingApp _app;
|
|
|
|
|
public SysAppSettingController(SysAppSettingApp app)
|
|
|
|
|
{
|
|
|
|
|
_app = app;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<Response<SysAppSetting>> Get(long id)
|
|
|
|
|
{
|
|
|
|
|
var result = new Response<SysAppSetting>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
result.Result = await _app.Get(id);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Code = 500;
|
|
|
|
|
result.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<Response<bool>> Save(SysAppSetting obj)
|
|
|
|
|
{
|
|
|
|
|
var result = new Response<bool>();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
result = await _app.Save(obj);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.Code = 500;
|
|
|
|
|
result.Message = ex.InnerException?.Message ?? ex.Message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|