|
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
using System.Drawing;
|
|
|
+using System.Text.Json;
|
|
|
using System.Xml.Linq;
|
|
|
|
|
|
namespace FccLite.Web.Controller
|
|
@@ -16,6 +17,8 @@ namespace FccLite.Web.Controller
|
|
|
[ApiController]
|
|
|
public class ConfigController : ControllerBase
|
|
|
{
|
|
|
+ static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
+
|
|
|
private readonly IStationService _stationService;
|
|
|
private readonly IOilInfoService _oilInfoService;
|
|
|
public ConfigController(IStationService stationService,IOilInfoService oilInfoService)
|
|
@@ -32,6 +35,7 @@ namespace FccLite.Web.Controller
|
|
|
[HttpPost("upLoadBaseInfo")]
|
|
|
public async Task<StationSetOutput> UpLoadBaseInfo(StationInfoInput stationInfoInput)
|
|
|
{
|
|
|
+ logger.Info($"add or update station info,{JsonSerializer.Serialize(stationInfoInput)}");
|
|
|
return await _stationService.UploadBaseInfo(stationInfoInput);
|
|
|
}
|
|
|
|
|
@@ -48,6 +52,7 @@ namespace FccLite.Web.Controller
|
|
|
[HttpGet("getBaseInfo")]
|
|
|
public async Task<IActionResult> GetBaseInfo(int page, int size,long? id,string? name, decimal? longitude,decimal? latitude)
|
|
|
{
|
|
|
+ logger.Info($"get page of station info:page = {page},size = {size}, id = {id},name = {name},longitude = {longitude},latitude = {latitude}");
|
|
|
var response = await _stationService.GetBaseInfo(page, size, id,name,longitude,latitude);
|
|
|
return Ok(response);
|
|
|
}
|
|
@@ -60,6 +65,7 @@ namespace FccLite.Web.Controller
|
|
|
[HttpPost("deleteBaseInfo")]
|
|
|
public async Task<IActionResult> DeleteBaseInfo(long id)
|
|
|
{
|
|
|
+ logger.Info($"delete station info by id:{id}");
|
|
|
var response = await _stationService.DeleteBaseInfo(id);
|
|
|
return Ok(response);
|
|
|
|
|
@@ -77,6 +83,7 @@ namespace FccLite.Web.Controller
|
|
|
[HttpGet("getOilInfo")]
|
|
|
public async Task<IActionResult> GetOilInfo(int page,int size,long? id,string? name,int? code)
|
|
|
{
|
|
|
+ logger.Info($"get page of oil info,page = {page},size = {size},id = {id},name = {name},code = {code}");
|
|
|
var response = await _oilInfoService.GetPage(page, size, id, name, code);
|
|
|
return Ok(response);
|
|
|
}
|
|
@@ -89,6 +96,7 @@ namespace FccLite.Web.Controller
|
|
|
[HttpPost("upLoadOilInfo")]
|
|
|
public async Task<OilInfoSetOutput> UpLoadOilInfo(OilInfoInput oilInfoInput)
|
|
|
{
|
|
|
+ logger.Info($"add or update oil info,{JsonSerializer.Serialize(oilInfoInput)}");
|
|
|
return await _oilInfoService.Save(oilInfoInput);
|
|
|
}
|
|
|
|
|
@@ -100,6 +108,7 @@ namespace FccLite.Web.Controller
|
|
|
[HttpPost("deleteOilInfo")]
|
|
|
public async Task<IActionResult> DeleteOilInfo(long id)
|
|
|
{
|
|
|
+ logger.Info($"delete oil info by id:{id}");
|
|
|
var response = await _oilInfoService.DeleteById(id);
|
|
|
return Ok(response);
|
|
|
}
|