using Vo;
using Microsoft.AspNetCore.Mvc;
using Model;
using Services;
using Model.Base;
using Vo.Admin;
using Mapster;
using Infrastructure;
namespace Controllers.Admin
{
///
/// PriRecursionStartCondition)Controller
///
// [Route("${Router}$")]
// [ApiExplorerSettings(GroupName = "PriRecursionStartCondition")]
public class PriRecursionStartConditionController : BaseController
{
///
/// api分组接口
///
private readonly IPriRecursionStartConditionService _PriRecursionStartConditionService;
public PriRecursionStartConditionController(IPriRecursionStartConditionService PriRecursionStartConditionService)
{
_PriRecursionStartConditionService = PriRecursionStartConditionService;
}
/// 分页参数
///
/// 列表
///
/// 分页对象
/// 参数请求体
/// 列表
[HttpGet]
[Route("/v1/pri/PriRecursionStartCondition/getPriRecursionStartConditionList")]
public IActionResult getPriRecursionStartConditionList([FromQuery] PagerInfo page, [FromQuery] PriRecursionStartCondition param)
{
var response = _PriRecursionStartConditionService.getPriRecursionStartConditionList(page, param);
return SUCCESS(response);
}
///
/// 详情
///
/// 参数请求体
/// 详情
[HttpGet]
[Route("/v1/pri/PriRecursionStartCondition/getPriRecursionStartConditionQuery")]
public IActionResult getPriRecursionStartConditionQuery([FromQuery] PriRecursionStartCondition param)
{
var response = _PriRecursionStartConditionService.GetFirst(m => m.id == param.id).Adapt();
return SUCCESS(response);
}
///
/// 添加
///
/// 参数请求体
/// 添加
[HttpPost]
[Route("/v1/pri/PriRecursionStartCondition/addPriRecursionStartCondition")]
public IActionResult addPriRecursionStartCondition([FromBody] PriRecursionStartCondition param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _PriRecursionStartConditionService.Add(modal);
return SUCCESS(response);
}
///
/// 修改
///
/// 参数请求体
/// 修改
[HttpPut]
[Route("/v1/pri/PriRecursionStartCondition/updatePriRecursionStartCondition")]
public IActionResult updatePriRecursionStartCondition([FromBody] PriRecursionStartCondition param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _PriRecursionStartConditionService.Update(modal);
return SUCCESS(response);
}
///
/// 删除
///
/// ID
/// 删除
[HttpDelete]
[Route("/v1/pri/PriRecursionStartCondition/deletePriRecursionStartCondition/{id}")]
public IActionResult deletePriRecursionStartCondition(int id)
{
var response = _PriRecursionStartConditionService.Delete(id);
return SUCCESS(response);
}
}
}