Files
2025-11-26 11:32:30 +08:00

66 lines
1.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using MQTTServerSideAPI.Models;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Helpers;
using System.Web.Http;
using System.Xml.Linq;
namespace MQTTServerSideAPI.Controllers
{
public class StateController : ApiController
{
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET: api/State
public List<string> Get(string devicename,string stime,string etime)
{
return SQLiteDBHelper.GetSelectStatus(devicename, stime, etime);
}
// GET: api/State/5
public List<string> Get(string productid, string devicename,string times, string Statuss)
{
return SQLiteDBHelper.GetSelectStatus(productid, devicename, times, Statuss);
}
public List<string> Get(string productid, string devicename)
{
return SQLiteDBHelper.GetSelectStatus(productid, devicename);
}
//public StateByecharts Get(string devicename)
//{
// return SQLiteDBHelper.GetSelectStatus(devicename); ;
//}
// POST: api/State
public void Post([FromBody] JObject mqttmessage)
{
//Logger.LogCalloutanaSide("StateController" + mqttmessage);
SQLiteDBHelper.InsertState(mqttmessage);
}
// PUT: api/State/5
public void Put(int id, [FromBody]string value)
{
}
// DELETE: api/State/5
public void Delete(int id)
{
}
}
}