//public async Task<IHttpActionResult> GetMeterKWH([FromBody] SmartMeterKWH_Input para) => Ok(await GetMeter_Helper.GetMeterKWH(para)); public ReturnMessage GetMeterKWH(SmartMeterKWH_Input item) { ReturnMessage rm = new ReturnMessage();//new 一個返回的請求狀態類 string Result = ""; try { Result = GetMeter_Helper.GetMeterKWH(item); JArray jArray = JArray.Parse(Result); rm.Success = true; rm.Status = "success"; rm.Command = "GetMeterKWH"; rm.Array = jArray; } catch (Exception ex) { Log.Error("Got error. " + ex.Message); rm.Success = false; rm.Status = "Error"; } return(rm); }
public async Task <IHttpActionResult> GetMeterKWHAlert([FromBody] SmartMeterKWHAlert_Input para) => Ok(await GetMeter_Helper.GetMeterKWHAlert(para));