116 lines
3.8 KiB
C#
116 lines
3.8 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.huate_group.CloudMonitor;
|
||
using DOAN.Model.huate_group.CloudMonitor.Dto;
|
||
|
||
using DOAN.Service.huate_group.CloudMonitor;
|
||
using DOAN.Service.huate_group.CloudMonitor.IService;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
using Aliyun.OSS;
|
||
|
||
//创建时间:2024-08-21
|
||
namespace DOAN.Admin.WebApi.Controllers.Business
|
||
{
|
||
/// <summary>
|
||
/// 小房间热熔焊接
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("huate_group/cloudMonitor/")]
|
||
public class ZiyuanDevice01Controller : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 小房间热熔焊接接口
|
||
/// </summary>
|
||
private readonly IZiyuanDevice01Service _ZiyuanDevice01Service;
|
||
|
||
public ZiyuanDevice01Controller(IZiyuanDevice01Service ZiyuanDevice01Service)
|
||
{
|
||
_ZiyuanDevice01Service = ZiyuanDevice01Service;
|
||
}
|
||
|
||
//TODO 查询设备设备表含义
|
||
[HttpGet("reflect")]
|
||
public IActionResult GetReflectDevice()
|
||
{
|
||
|
||
var response = _ZiyuanDevice01Service.GetReflectDevice();
|
||
return SUCCESS(response);
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询小房间热熔焊接列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "ziyuandevice01:list")]
|
||
public IActionResult QueryZiyuanDevice01([FromQuery] ZiyuanDevice01QueryDto parm)
|
||
{
|
||
if (parm.ReflexAccount_id == 0) { throw new ArgumentException($"{parm.ReflexAccount_id}不存在"); };
|
||
var response = _ZiyuanDevice01Service.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询小房间热熔焊接详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "ziyuandevice01:query")]
|
||
public IActionResult GetZiyuanDevice01(int Id)
|
||
{
|
||
var response = _ZiyuanDevice01Service.GetInfo(Id);
|
||
|
||
var info = response.Adapt<ZiyuanDevice01Dto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加小房间热熔焊接
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "ziyuandevice01:add")]
|
||
[Log(Title = "小房间热熔焊接", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddZiyuanDevice01([FromBody] ZiyuanDevice01Dto parm)
|
||
{
|
||
var modal = parm.Adapt<ZiyuanDevice01>().ToCreate(HttpContext);
|
||
|
||
var response = _ZiyuanDevice01Service.AddZiyuanDevice01(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新小房间热熔焊接
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "ziyuandevice01:edit")]
|
||
[Log(Title = "小房间热熔焊接", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateZiyuanDevice01([FromBody] ZiyuanDevice01Dto parm)
|
||
{
|
||
var modal = parm.Adapt<ZiyuanDevice01>().ToUpdate(HttpContext);
|
||
var response = _ZiyuanDevice01Service.UpdateZiyuanDevice01(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除小房间热熔焊接
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "ziyuandevice01:delete")]
|
||
[Log(Title = "小房间热熔焊接", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteZiyuanDevice01([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<int>(ids);
|
||
|
||
return ToResponse(_ZiyuanDevice01Service.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |