zhengzhou-byd-lms/DOAN.Admin.WebApi/Controllers/Bydlms/BydToolLifeConfigController.cs
2025-04-18 16:38:11 +08:00

102 lines
3.2 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.Bydlms.Dto;
using DOAN.Model.Bydlms;
using DOAN.Service.Bydlms.IBydlmsService;
using DOAN.Admin.WebApi.Filters;
//创建时间2025-04-17
namespace DOAN.Admin.WebApi.Controllers.Bydlms
{
/// <summary>
///
/// </summary>
[Verify]
[Route("bydlms/BydToolLifeConfig")]
public class BydToolLifeConfigController : BaseController
{
/// <summary>
/// 接口
/// </summary>
private readonly IBydToolLifeConfigService _BydToolLifeConfigService;
public BydToolLifeConfigController(IBydToolLifeConfigService BydToolLifeConfigService)
{
_BydToolLifeConfigService = BydToolLifeConfigService;
}
/// <summary>
/// 查询列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "bydtoollifeconfig:list")]
public IActionResult QueryBydToolLifeConfig([FromQuery] BydToolLifeConfigQueryDto parm)
{
var response = _BydToolLifeConfigService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "bydtoollifeconfig:query")]
public IActionResult GetBydToolLifeConfig(string Id)
{
var response = _BydToolLifeConfigService.GetInfo(Id);
var info = response.Adapt<BydToolLifeConfigDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "bydtoollifeconfig:add")]
[Log(Title = "", BusinessType = BusinessType.INSERT)]
public IActionResult AddBydToolLifeConfig([FromBody] BydToolLifeConfigDto parm)
{
var modal = parm.Adapt<BydToolLifeConfig>().ToCreate(HttpContext);
var response = _BydToolLifeConfigService.AddBydToolLifeConfig(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "bydtoollifeconfig:edit")]
[Log(Title = "", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateBydToolLifeConfig([FromBody] BydToolLifeConfigDto parm)
{
var modal = parm.Adapt<BydToolLifeConfig>().ToUpdate(HttpContext);
var response = _BydToolLifeConfigService.UpdateBydToolLifeConfig(modal);
return ToResponse(response);
}
/// <summary>
/// 删除
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "bydtoollifeconfig:delete")]
[Log(Title = "", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteBydToolLifeConfig([FromRoute] string ids)
{
var idArr = Tools.SplitAndConvert<string>(ids);
return ToResponse(_BydToolLifeConfigService.Delete(idArr));
}
}
}