2025-11-06 20:28:30 +08:00

108 lines
3.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Dto;
using DOAN.Model.Business;
using DOAN.Service.Business.IBusinessService;
using DOAN.Admin.WebApi.Filters;
//创建时间2025-11-06
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 工艺建模字典表
/// </summary>
[Verify]
[Route("business/ProModelDictionary")]
public class ProModelDictionaryController : BaseController
{
/// <summary>
/// 工艺建模字典表接口
/// </summary>
private readonly IProModelDictionaryService _ProModelDictionaryService;
public ProModelDictionaryController(IProModelDictionaryService ProModelDictionaryService)
{
_ProModelDictionaryService = ProModelDictionaryService;
}
/// <summary>
/// 查询工艺建模字典表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:promodeldictionary:list")]
public IActionResult QueryProModelDictionary([FromQuery] ProModelDictionaryQueryDto parm)
{
var response = _ProModelDictionaryService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询工艺建模字典表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:promodeldictionary:query")]
public IActionResult GetProModelDictionary(long Id)
{
var response = _ProModelDictionaryService.GetInfo(Id);
var info = response.Adapt<ProModelDictionary>();
return SUCCESS(info);
}
/// <summary>
/// 添加工艺建模字典表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:promodeldictionary:add")]
[Log(Title = "工艺建模字典表", BusinessType = BusinessType.INSERT)]
public IActionResult AddProModelDictionary([FromBody] ProModelDictionaryDto parm)
{
var modal = parm.Adapt<ProModelDictionary>().ToCreate(HttpContext);
var response = _ProModelDictionaryService.AddProModelDictionary(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新工艺建模字典表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:promodeldictionary:edit")]
[Log(Title = "工艺建模字典表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateProModelDictionary([FromBody] ProModelDictionaryDto parm)
{
var modal = parm.Adapt<ProModelDictionary>().ToUpdate(HttpContext);
var response = _ProModelDictionaryService.UpdateProModelDictionary(modal);
return ToResponse(response);
}
/// <summary>
/// 删除工艺建模字典表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:promodeldictionary:delete")]
[Log(Title = "工艺建模字典表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteProModelDictionary(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _ProModelDictionaryService.Delete(idsArr);
return ToResponse(response);
}
}
}