103 lines
3.5 KiB
C#
103 lines
3.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.Bydlms.Dto;
|
||
using DOAN.Model.Bydlms;
|
||
using DOAN.Service.Bydlms.IBydlmsService;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
using DOAN.Service.Bydlms;
|
||
using SqlSugar;
|
||
|
||
//创建时间:2025-04-17
|
||
namespace DOAN.Admin.WebApi.Controllers.Bydlms
|
||
{
|
||
/// <summary>
|
||
/// 刀具采集信息
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("bydlms/BydToolLifeRemaining")]
|
||
public class BydToolLifeRemainingController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 刀具采集信息接口
|
||
/// </summary>
|
||
private readonly IBydToolLifeRemainingService _BydToolLifeRemainingService;
|
||
|
||
public BydToolLifeRemainingController(IBydToolLifeRemainingService BydToolLifeRemainingService)
|
||
{
|
||
_BydToolLifeRemainingService = BydToolLifeRemainingService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询刀具采集信息列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "bydtoolliferemaining:list")]
|
||
public IActionResult QueryBydToolLifeRemaining([FromQuery] BydToolLifeRemainingQueryDto parm)
|
||
{
|
||
var response = _BydToolLifeRemainingService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询刀具采集信息详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "bydtoolliferemaining:query")]
|
||
public IActionResult GetBydToolLifeRemaining(string Id)
|
||
{
|
||
var response = _BydToolLifeRemainingService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<BydToolLifeRemainingDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加刀具采集信息
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[AllowAnonymous]
|
||
public IActionResult AddBydToolLifeRemaining([FromBody] BydToolLifeRemainingDto parm)
|
||
{
|
||
var modal = parm.Adapt<BydToolLifeRemaining>().ToCreate(HttpContext);
|
||
modal.Id = SnowFlakeSingle.Instance.NextId().ToString();
|
||
var response = _BydToolLifeRemainingService.AddBydToolLifeRemaining(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新刀具采集信息
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "bydtoolliferemaining:edit")]
|
||
[Log(Title = "刀具采集信息", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateBydToolLifeRemaining([FromBody] BydToolLifeRemainingDto parm)
|
||
{
|
||
var modal = parm.Adapt<BydToolLifeRemaining>().ToUpdate(HttpContext);
|
||
var response = _BydToolLifeRemainingService.UpdateBydToolLifeRemaining(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除刀具采集信息
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "bydtoolliferemaining:delete")]
|
||
[Log(Title = "刀具采集信息", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteBydToolLifeRemaining([FromRoute] string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<string>(ids);
|
||
|
||
return ToResponse(_BydToolLifeRemainingService.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |