using Microsoft.AspNetCore.Mvc; using DOAN.Admin.WebApi.Filters; using DOAN.Model.MES.mm.line; using DOAN.Model.MES.mm.line.Dto; using DOAN.Service.MES.mm.line.IService; //创建时间:2025-03-21 namespace DOAN.WebApi.Controllers.MES.mm.line { /// /// mm_line_location /// [Verify] [Route("mes/materialManagement/MmLineLocation")] public class MmLineLocationController : BaseController { /// /// mm_line_location接口 /// private readonly IMmLineLocationService _MmLineLocationService; public MmLineLocationController(IMmLineLocationService MmLineLocationService) { _MmLineLocationService = MmLineLocationService; } /// /// 查询mm_line_location列表 /// /// /// [HttpGet("list")] [ActionPermissionFilter(Permission = "business:mmlinelocation:list")] public IActionResult QueryMmLineLocation([FromQuery] MmLineLocationQueryDto parm) { var response = _MmLineLocationService.GetList(parm); return SUCCESS(response); } /// /// 查询mm_line_location详情 /// /// /// [HttpGet("{Id}")] [ActionPermissionFilter(Permission = "business:mmlinelocation:query")] public IActionResult GetMmLineLocation(string Id) { var response = _MmLineLocationService.GetInfo(Id); var info = response.Adapt(); return SUCCESS(info); } /// /// 添加mm_line_location /// /// [HttpPost] [ActionPermissionFilter(Permission = "business:mmlinelocation:add")] [Log(Title = "mm_line_location", BusinessType = BusinessType.INSERT)] public IActionResult AddMmLineLocation([FromBody] MmLineLocationDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); var response = _MmLineLocationService.AddMmLineLocation(modal); return SUCCESS(response); } /// /// 更新mm_line_location /// /// [HttpPut] [ActionPermissionFilter(Permission = "business:mmlinelocation:edit")] [Log(Title = "mm_line_location", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateMmLineLocation([FromBody] MmLineLocationDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); var response = _MmLineLocationService.UpdateMmLineLocation(modal); return ToResponse(response); } /// /// 删除mm_line_location /// /// [HttpDelete("{ids}")] [ActionPermissionFilter(Permission = "business:mmlinelocation:delete")] [Log(Title = "mm_line_location", BusinessType = BusinessType.DELETE)] public IActionResult DeleteMmLineLocation(string ids) { string[] idsArr = Tools.SpitStrArrary(ids); if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } var response = _MmLineLocationService.Delete(idsArr); return ToResponse(response); } } }