Files
sy_hx_pbl_backend/DOAN.Admin.WebApi/Controllers/PBL/Logging/LightLogController.cs

106 lines
3.2 KiB
C#
Raw Normal View History

2024-11-01 14:19:17 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Model.PBL.Dto;
using DOAN.Model.PBL;
using DOAN.Service.PBL.IPBLService;
using DOAN.Admin.WebApi.Filters;
2024-11-01 14:47:01 +08:00
using Infrastructure.Converter;
2024-11-01 14:19:17 +08:00
//创建时间2024-11-01
namespace DOAN.Admin.WebApi.Controllers.PBL
{
/// <summary>
///
/// </summary>
[Verify]
[Route("PBL/LightLog")]
public class LightLogController : BaseController
{
/// <summary>
/// 接口
/// </summary>
private readonly ILightLogService _LightLogService;
public LightLogController(ILightLogService LightLogService)
{
_LightLogService = LightLogService;
}
/// <summary>
/// 查询列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
2024-11-01 15:10:51 +08:00
[HttpPost("list")]
2024-11-01 14:19:17 +08:00
[ActionPermissionFilter(Permission = "lightlog:list")]
2024-11-01 15:10:51 +08:00
public IActionResult QueryLightLog([FromBody] LightLogQueryDto parm)
2024-11-01 14:19:17 +08:00
{
2024-11-01 14:47:01 +08:00
parm.TimeRange[0]= DOANConvertDateTime.ConvertLocalDateTime(parm.TimeRange[0]??DateTime.MinValue);
parm.TimeRange[1]= DOANConvertDateTime.ConvertLocalDateTime(parm.TimeRange[1]??DateTime.MinValue);
2024-11-01 14:19:17 +08:00
var response = _LightLogService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "lightlog:query")]
public IActionResult GetLightLog(string Id)
{
var response = _LightLogService.GetInfo(Id);
var info = response.Adapt<LightLogDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "lightlog:add")]
[Log(Title = "", BusinessType = BusinessType.INSERT)]
public IActionResult AddLightLog([FromBody] LightLogDto parm)
{
var modal = parm.Adapt<LightLog>().ToCreate(HttpContext);
var response = _LightLogService.AddLightLog(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "lightlog:edit")]
[Log(Title = "", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateLightLog([FromBody] LightLogDto parm)
{
var modal = parm.Adapt<LightLog>().ToUpdate(HttpContext);
var response = _LightLogService.UpdateLightLog(modal);
return ToResponse(response);
}
/// <summary>
/// 删除
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "lightlog:delete")]
[Log(Title = "", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteLightLog([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<string>(ids);
return ToResponse(_LightLogService.Delete(idArr));
}
}
}