using Vo;
using Microsoft.AspNetCore.Mvc;
using Model;
using Services;
using Model.Base;
using Vo.Admin;
using Mapster;
using Infrastructure;
using Common;
namespace Controllers.Admin
{
///
/// PriLog)Controller
///
// [ApiExplorerSettings(GroupName = "PriLog")]
public class PriLogController : BaseController
{
///
/// api分组接口
///
private readonly IPriLogService _PriLogService;
public PriLogController(IPriLogService PriLogService)
{
_PriLogService = PriLogService;
}
/// 分页参数
///
/// 列表
///
/// 分页对象
/// 参数请求体
/// 列表
[HttpGet]
[Route("/v1/pri/PriLog/getPriLogList")]
public IActionResult getPriLogList([FromQuery] PagerInfo page, [FromQuery] PriLog param)
{
var response = _PriLogService.getPriLogList(page, param);
return SUCCESS(response);
}
///
/// 详情
///
/// 参数请求体
/// 详情
[HttpGet]
[Route("/v1/pri/PriLog/getPriLogQuery")]
public IActionResult getPriLogQuery([FromQuery] PriLog param)
{
var response = _PriLogService.GetFirst(m => m.id == param.id).Adapt();
response.stepList = "{" + Function.CheckNull(response.stepList).TrimEnd(',') + "}";
return SUCCESS(response);
}
///
/// 添加
///
/// 参数请求体
/// 添加
[HttpPost]
[Route("/v1/pri/PriLog/addPriLog")]
public IActionResult addPriLog([FromBody] PriLog param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _PriLogService.Add(modal);
return SUCCESS(response);
}
///
/// 修改
///
/// 参数请求体
/// 修改
[HttpPut]
[Route("/v1/pri/PriLog/updatePriLog")]
public IActionResult updatePriLog([FromBody] PriLog param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _PriLogService.Update(modal);
return SUCCESS(response);
}
///
/// 删除
///
/// ID
/// 删除
[HttpDelete]
[Route("/v1/pri/PriLog/deletePriLog/{id}")]
public IActionResult deletePriLog(int id)
{
var response = _PriLogService.Delete(id);
return SUCCESS(response);
}
}
}