|
@@ -1,5 +1,8 @@
|
|
-using FccLite.Web.Domain.FccStationInfo.Input;
|
|
|
|
|
|
+using FccLite.Web.Domain.FccOilInfo.Input;
|
|
|
|
+using FccLite.Web.Domain.FccOilInfo.Ouput;
|
|
|
|
+using FccLite.Web.Domain.FccStationInfo.Input;
|
|
using FccLite.Web.Domain.FccStationInfo.Output;
|
|
using FccLite.Web.Domain.FccStationInfo.Output;
|
|
|
|
+using FccLite.Web.Services.FccOilInfo;
|
|
using FccLite.Web.Services.FccStaionInfo;
|
|
using FccLite.Web.Services.FccStaionInfo;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
@@ -14,9 +17,11 @@ namespace FccLite.Web.Controller
|
|
public class ConfigController : ControllerBase
|
|
public class ConfigController : ControllerBase
|
|
{
|
|
{
|
|
private readonly IStationService _stationService;
|
|
private readonly IStationService _stationService;
|
|
- public ConfigController(IStationService stationService)
|
|
|
|
|
|
+ private readonly IOilInfoService _oilInfoService;
|
|
|
|
+ public ConfigController(IStationService stationService,IOilInfoService oilInfoService)
|
|
{
|
|
{
|
|
_stationService = stationService;
|
|
_stationService = stationService;
|
|
|
|
+ _oilInfoService = oilInfoService;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -59,5 +64,44 @@ namespace FccLite.Web.Controller
|
|
return Ok(response);
|
|
return Ok(response);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 分页获取油品信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="page">页数</param>
|
|
|
|
+ /// <param name="size">页码</param>
|
|
|
|
+ /// <param name="id">过滤条件——id</param>
|
|
|
|
+ /// <param name="name">过滤条件——油品名</param>
|
|
|
|
+ /// <param name="code">过滤条件——油品码</param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpGet("getOilInfo")]
|
|
|
|
+ public async Task<IActionResult> GetOilInfo(int page,int size,long? id,string? name,int? code)
|
|
|
|
+ {
|
|
|
|
+ var response = await _oilInfoService.GetPage(page, size, id, name, code);
|
|
|
|
+ return Ok(response);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 新增、修改油品信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="oilInfoInput">油品信息</param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost("upLoadOilInfo")]
|
|
|
|
+ public async Task<OilInfoSetOutput> UpLoadOilInfo(OilInfoInput oilInfoInput)
|
|
|
|
+ {
|
|
|
|
+ return await _oilInfoService.Save(oilInfoInput);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 通过 id 删除油品信息
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="id">id</param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost("deleteOilInfo")]
|
|
|
|
+ public async Task<IActionResult> DeleteOilInfo(long id)
|
|
|
|
+ {
|
|
|
|
+ var response = await _oilInfoService.DeleteById(id);
|
|
|
|
+ return Ok(response);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|