qianhao.xu 90080ced7a line
2025-03-05 13:45:15 +08:00

102 lines
2.9 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-03-05
namespace DOAN.Admin.WebApi.Controllers.Bydlms
{
/// <summary>
///
/// </summary>
[Verify]
[Route("bydlms/BydLine")]
public class BydLineController : BaseController
{
/// <summary>
/// 接口
/// </summary>
private readonly IBydLineService _BydLineService;
public BydLineController(IBydLineService BydLineService)
{
_BydLineService = BydLineService;
}
/// <summary>
/// 查询列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "bydline:list")]
public IActionResult QueryBydLine([FromQuery] BydLineQueryDto parm)
{
var response = _BydLineService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "bydline:query")]
public IActionResult GetBydLine(int Id)
{
var response = _BydLineService.GetInfo(Id);
var info = response.Adapt<BydLineDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "bydline:add")]
[Log(Title = "", BusinessType = BusinessType.INSERT)]
public IActionResult AddBydLine([FromBody] BydLineDto parm)
{
var modal = parm.Adapt<BydLine>().ToCreate(HttpContext);
var response = _BydLineService.AddBydLine(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "bydline:edit")]
[Log(Title = "", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateBydLine([FromBody] BydLineDto parm)
{
var modal = parm.Adapt<BydLine>().ToUpdate(HttpContext);
var response = _BydLineService.UpdateBydLine(modal);
return ToResponse(response);
}
/// <summary>
/// 删除
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "bydline:delete")]
[Log(Title = "", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteBydLine([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<int>(ids);
return ToResponse(_BydLineService.Delete(idArr));
}
}
}