using Vo;
using Microsoft.AspNetCore.Mvc;
using Model;
using Services;
using Model.Base;
using Vo.Admin;
using Mapster;
using Infrastructure;
namespace Controllers.Admin
{
///
/// PriPrizeInQueryField)Controller
///
// [ApiExplorerSettings(GroupName = "PriPrizeInQueryField")]
public class PriPrizeInQueryFieldController : BaseController
{
///
/// api分组接口
///
private readonly IPriPrizeInQueryFieldService _PriPrizeInQueryFieldService;
public PriPrizeInQueryFieldController(IPriPrizeInQueryFieldService PriPrizeInQueryFieldService)
{
_PriPrizeInQueryFieldService = PriPrizeInQueryFieldService;
}
/// 分页参数
///
/// 列表
///
/// 分页对象
/// 参数请求体
/// 列表
[HttpGet]
[Route("/v1/pri/PriPrizeInQueryField/getPriPrizeInQueryFieldList")]
public IActionResult getPriPrizeInQueryFieldList([FromQuery] PagerInfo page, [FromQuery] PriPrizeInQueryField param)
{
var response = _PriPrizeInQueryFieldService.getPriPrizeInQueryFieldList(page, param);
return SUCCESS(response);
}
///
/// 详情
///
/// 参数请求体
/// 详情
[HttpGet]
[Route("/v1/pri/PriPrizeInQueryField/getPriPrizeInQueryFieldQuery")]
public IActionResult getPriPrizeInQueryFieldQuery([FromQuery] PriPrizeInQueryField param)
{
var response = _PriPrizeInQueryFieldService.GetFirst(m => m.id == param.id).Adapt();
return SUCCESS(response);
}
///
/// 添加
///
/// 参数请求体
/// 添加
[HttpPost]
[Route("/v1/pri/PriPrizeInQueryField/addPriPrizeInQueryField")]
public IActionResult addPriPrizeInQueryField([FromBody] PriPrizeInQueryField param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _PriPrizeInQueryFieldService.Add(modal);
return SUCCESS(response);
}
///
/// 修改
///
/// 参数请求体
/// 修改
[HttpPut]
[Route("/v1/pri/PriPrizeInQueryField/updatePriPrizeInQueryField")]
public IActionResult updatePriPrizeInQueryField([FromBody] PriPrizeInQueryField param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _PriPrizeInQueryFieldService.Update(modal);
return SUCCESS(response);
}
///
/// 删除
///
/// ID
/// 删除
[HttpDelete]
[Route("/v1/pri/PriPrizeInQueryField/deletePriPrizeInQueryField/{id}")]
public IActionResult deletePriPrizeInQueryField(int id)
{
var response = _PriPrizeInQueryFieldService.Delete(id);
return SUCCESS(response);
}
}
}