using Vo;
using Microsoft.AspNetCore.Mvc;
using Model;
using Services;
using Model.Base;
using Vo.Admin;
using Mapster;
using Infrastructure;
namespace Controllers.Admin
{
///
/// MakeTemplateGategory)Controller
///
// [Route("${Router}$")]
// [ApiExplorerSettings(GroupName = "MakeTemplateGategory")]
public class MakeTemplateGategoryController : BaseController
{
private readonly IMakeTemplateGategoryService _MakeTemplateGategoryService;
public MakeTemplateGategoryController(IMakeTemplateGategoryService MakeTemplateGategoryService)
{
_MakeTemplateGategoryService = MakeTemplateGategoryService;
}
///
/// 列表
///
/// 分页对象
/// 参数请求体
/// 列表
[HttpGet]
[Route("/v1/omega_make/MakeTemplateGategory/getMakeTemplateGategoryList")]
public IActionResult getMakeTemplateGategoryList()
{
var response = _MakeTemplateGategoryService.getMakeTemplateGategoryList();
return SUCCESS(response);
}
///
/// 详情
///
/// 参数请求体
/// 详情
[HttpGet]
[Route("/v1/omega_make/MakeTemplateGategory/getMakeTemplateGategoryQuery")]
public IActionResult getMakeTemplateGategoryQuery([FromQuery] MakeTemplateGategory param)
{
var response = _MakeTemplateGategoryService.GetFirst(m => m.id == param.id).Adapt();
return SUCCESS(response);
}
///
/// 添加
///
/// 参数请求体
/// 添加
[HttpPost]
[Route("/v1/omega_make/MakeTemplateGategory/addMakeTemplateGategory")]
public IActionResult addMakeTemplateGategory([FromBody] MakeTemplateGategory param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _MakeTemplateGategoryService.InsertReturnIdentity(modal);
return SUCCESS(response);
}
///
/// 修改
///
/// 参数请求体
/// 修改
[HttpPut]
[Route("/v1/omega_make/MakeTemplateGategory/updateMakeTemplateGategory")]
public IActionResult updateMakeTemplateGategory([FromBody] MakeTemplateGategory param)
{
var modal = param.Adapt().ToCreate(HttpContext);
var response = _MakeTemplateGategoryService.Update(modal, true);
return SUCCESS(response);
}
///
/// 删除
///
/// ID
/// 删除
[HttpDelete]
[Route("/v1/omega_make/MakeTemplateGategory/deleteMakeTemplateGategory/{id}")]
public IActionResult deleteMakeTemplateGategory(int id)
{
var response = _MakeTemplateGategoryService.Delete(id);
return SUCCESS(response);
}
}
}