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