2025-02-22 14:31:52 +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-02-19
namespace DOAN.Admin.WebApi.Controllers.Bydlms
{
/// <summary>
/// 数据采集配置
/// </summary>
[Verify]
[Route("bydlms/BydDcConfig")]
public class BydDcConfigController : BaseController
{
/// <summary>
/// 数据采集配置接口
/// </summary>
private readonly IBydDcConfigService _BydDcConfigService;
public BydDcConfigController(IBydDcConfigService BydDcConfigService)
{
_BydDcConfigService = BydDcConfigService;
}
/// <summary>
/// 查询数据采集配置列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "byddcconfig:list")]
public IActionResult QueryBydDcConfig([FromQuery] BydDcConfigQueryDto parm)
{
var response = _BydDcConfigService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询数据采集配置详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "byddcconfig:query")]
public IActionResult GetBydDcConfig(string Id)
{
var response = _BydDcConfigService.GetInfo(Id);
var info = response.Adapt<BydDcConfigDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加数据采集配置
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "byddcconfig:add")]
[Log(Title = "数据采集配置", BusinessType = BusinessType.INSERT)]
public IActionResult AddBydDcConfig([FromBody] BydDcConfigDto parm)
{
var modal = parm.Adapt<BydDcConfig>().ToCreate(HttpContext);
var response = _BydDcConfigService.AddBydDcConfig(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新数据采集配置
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "byddcconfig:edit")]
[Log(Title = "数据采集配置", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateBydDcConfig([FromBody] BydDcConfigDto parm)
{
var modal = parm.Adapt<BydDcConfig>().ToUpdate(HttpContext);
var response = _BydDcConfigService.UpdateBydDcConfig(modal);
return ToResponse(response);
}
/// <summary>
/// 删除数据采集配置
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "byddcconfig:delete")]
[Log(Title = "数据采集配置", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteBydDcConfig([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<string>(ids);
return ToResponse(_BydDcConfigService.Delete(idArr));
}
}
}