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/BydDcRecord")]
public class BydDcRecordController : BaseController
{
///
/// 数据采集记录接口
///
private readonly IBydDcRecordService _BydDcRecordService;
public BydDcRecordController(IBydDcRecordService BydDcRecordService)
{
_BydDcRecordService = BydDcRecordService;
}
///
/// 查询数据采集记录列表
///
///
///
[HttpGet("list")]
[ActionPermissionFilter(Permission = "byddcrecord:list")]
public IActionResult QueryBydDcRecord([FromQuery] BydDcRecordQueryDto parm)
{
var response = _BydDcRecordService.GetList(parm);
return SUCCESS(response);
}
///
/// 查询数据采集记录详情
///
///
///
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "byddcrecord:query")]
public IActionResult GetBydDcRecord(string Id)
{
var response = _BydDcRecordService.GetInfo(Id);
var info = response.Adapt();
return SUCCESS(info);
}
///
/// 添加数据采集记录
///
///
[HttpPost]
[ActionPermissionFilter(Permission = "byddcrecord:add")]
[Log(Title = "数据采集记录", BusinessType = BusinessType.INSERT)]
public IActionResult AddBydDcRecord([FromBody] BydDcRecordDto parm)
{
var modal = parm.Adapt().ToCreate(HttpContext);
var response = _BydDcRecordService.AddBydDcRecord(modal);
return SUCCESS(response);
}
///
/// 更新数据采集记录
///
///
[HttpPut]
[ActionPermissionFilter(Permission = "byddcrecord:edit")]
[Log(Title = "数据采集记录", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateBydDcRecord([FromBody] BydDcRecordDto parm)
{
var modal = parm.Adapt().ToUpdate(HttpContext);
var response = _BydDcRecordService.UpdateBydDcRecord(modal);
return ToResponse(response);
}
///
/// 删除数据采集记录
///
///
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "byddcrecord:delete")]
[Log(Title = "数据采集记录", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteBydDcRecord([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert(ids);
return ToResponse(_BydDcRecordService.Delete(idArr));
}
}
}