|
|
|
@ -0,0 +1,70 @@
|
|
|
|
|
using AutoMapper;
|
|
|
|
|
using Entity.DbModel.Station;
|
|
|
|
|
using Entity.Dto.Resp;
|
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Service.Charger.Client;
|
|
|
|
|
using Service.WaterCool.Client;
|
|
|
|
|
using Service.WaterCool.Msg.WaterCool;
|
|
|
|
|
|
|
|
|
|
namespace WebStarter.Controllers;
|
|
|
|
|
|
|
|
|
|
[Produces("application/json")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
|
public class WaterCoolControlller: ControllerBase
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取水冷机列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>充电机code列表返回</returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetWhaterCoolList")]
|
|
|
|
|
public async Task<Result<List<WaterCoolStatusResp>>> GetWhaterCoolList()
|
|
|
|
|
{
|
|
|
|
|
var vv = WaterCoolClientMgr.Dictionary.Values;
|
|
|
|
|
List<WaterCoolStatusResp> coolStatusResps = new();
|
|
|
|
|
|
|
|
|
|
var configuration = new MapperConfiguration(cfg => cfg.CreateMap<WaterCoolStatus, WaterCoolStatusResp>());
|
|
|
|
|
var mapper = configuration.CreateMapper();
|
|
|
|
|
|
|
|
|
|
foreach (var VARIABLE in vv)
|
|
|
|
|
{
|
|
|
|
|
if (VARIABLE != null && VARIABLE.WaterCoolStatus != null)
|
|
|
|
|
{
|
|
|
|
|
WaterCoolStatusResp coolStatusResp = new();
|
|
|
|
|
coolStatusResp=mapper.Map<WaterCoolStatusResp>(VARIABLE.WaterCoolStatus);
|
|
|
|
|
coolStatusResp.Sn = VARIABLE.Sn;
|
|
|
|
|
coolStatusResps.Add(coolStatusResp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Result<List<WaterCoolStatusResp>>.Success(coolStatusResps);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*/// <summary>
|
|
|
|
|
/// 水冷机发送指令
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>充电机code列表返回</returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("SendModeMsg")]
|
|
|
|
|
public async Task<Result<List<WaterCoolStatusResp>>> SendModeMsg()
|
|
|
|
|
{
|
|
|
|
|
var vv = WaterCoolClientMgr.Dictionary.Values;
|
|
|
|
|
List<WaterCoolStatusResp> coolStatusResps = new();
|
|
|
|
|
|
|
|
|
|
var configuration = new MapperConfiguration(cfg => cfg.CreateMap<WaterCoolStatus, WaterCoolStatusResp>());
|
|
|
|
|
var mapper = configuration.CreateMapper();
|
|
|
|
|
|
|
|
|
|
foreach (var VARIABLE in vv)
|
|
|
|
|
{
|
|
|
|
|
if (VARIABLE != null && VARIABLE.WaterCoolStatus != null)
|
|
|
|
|
{
|
|
|
|
|
WaterCoolStatusResp coolStatusResp = new();
|
|
|
|
|
coolStatusResp=mapper.Map<WaterCoolStatusResp>(VARIABLE.WaterCoolStatus);
|
|
|
|
|
coolStatusResp.Sn = VARIABLE.Sn;
|
|
|
|
|
coolStatusResps.Add(coolStatusResp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Result<List<WaterCoolStatusResp>>.Success(coolStatusResps);
|
|
|
|
|
}*/
|
|
|
|
|
}
|