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