109 lines
3.5 KiB
C#
109 lines
3.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Model.Dto;
|
||
using ZR.Model.Business;
|
||
using ZR.Service.Business.IBusinessService;
|
||
using ZR.Admin.WebApi.Extensions;
|
||
using ZR.Admin.WebApi.Filters;
|
||
|
||
//创建时间:2025-01-02
|
||
namespace ZR.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 质量GP12基础站点
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("/mes/qc/gp12/QcGp12BaseSite")]
|
||
public class QcGp12BaseSiteController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 质量GP12基础站点接口
|
||
/// </summary>
|
||
private readonly IQcGp12BaseSiteService _QcGp12BaseSiteService;
|
||
|
||
public QcGp12BaseSiteController(IQcGp12BaseSiteService QcGp12BaseSiteService)
|
||
{
|
||
_QcGp12BaseSiteService = QcGp12BaseSiteService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询质量GP12基础站点列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basesite:list")]
|
||
public IActionResult QueryQcGp12BaseSite([FromQuery] QcGp12BaseSiteQueryDto parm)
|
||
{
|
||
var response = _QcGp12BaseSiteService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询质量GP12基础站点详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basesite:query")]
|
||
public IActionResult GetQcGp12BaseSite(int Id)
|
||
{
|
||
var response = _QcGp12BaseSiteService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<QcGp12BaseSite>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加质量GP12基础站点
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basesite:add")]
|
||
[Log(Title = "质量GP12基础站点", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddQcGp12BaseSite([FromBody] QcGp12BaseSiteDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcGp12BaseSite>().ToCreate(HttpContext);
|
||
|
||
var response = _QcGp12BaseSiteService.AddQcGp12BaseSite(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新质量GP12基础站点
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basesite:edit")]
|
||
[Log(Title = "质量GP12基础站点", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateQcGp12BaseSite([FromBody] QcGp12BaseSiteDto parm)
|
||
{
|
||
var modal = parm.Adapt<QcGp12BaseSite>().ToUpdate(HttpContext);
|
||
var response = _QcGp12BaseSiteService.UpdateQcGp12BaseSite(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除质量GP12基础站点
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:qcgp12basesite:delete")]
|
||
[Log(Title = "质量GP12基础站点", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteQcGp12BaseSite(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _QcGp12BaseSiteService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |