public ActionResult <RequestResponse> Exit_POST([FromHeader] string authToken, [FromHeader] string localIp, [FromHeader] string publicIp)
        {
            if (string.IsNullOrEmpty(authToken) || string.IsNullOrEmpty(localIp) || string.IsNullOrEmpty(publicIp))
            {
                return(BadRequest());
            }

            return(Ok(Json(RestCore.GetResponse("assistant_exit", new RequestParameter(authToken, publicIp, localIp)))));
        }
Пример #2
0
        public ActionResult <RequestResponse> Status_GET([FromHeader] string authToken, [FromHeader] string localIp, [FromHeader] string publicIp)
        {
            if (string.IsNullOrEmpty(authToken) || string.IsNullOrEmpty(localIp) || string.IsNullOrEmpty(publicIp))
            {
                return(BadRequest());
            }

            return(Ok(Json(RestCore.GetResponse("gpio_status", new RequestParameter(authToken, publicIp, localIp)))));
        }
Пример #3
0
        public ActionResult <RequestResponse> SetRemainder_POST(
            [FromHeader] string authToken,
            [FromHeader] string localIp,
            [FromHeader] string publicIp,
            [FromQuery] string remainderUid)
        {
            if (string.IsNullOrEmpty(authToken) || string.IsNullOrEmpty(localIp) || string.IsNullOrEmpty(publicIp) || string.IsNullOrEmpty(remainderUid))
            {
                return(BadRequest());
            }

            return(Ok(Json(RestCore.GetResponse("assistant_remainder_delete", new RequestParameter(authToken, publicIp, localIp, new object[] { remainderUid })))));
        }
Пример #4
0
        public ActionResult <RequestResponse> SetAlarm_POST(
            [FromHeader] string authToken,
            [FromHeader] string localIp,
            [FromHeader] string publicIp,
            [FromQuery] string alarmText,
            [FromQuery] DateTime alarmAt)
        {
            if (string.IsNullOrEmpty(authToken) || string.IsNullOrEmpty(localIp) || string.IsNullOrEmpty(publicIp) || string.IsNullOrEmpty(alarmText))
            {
                return(BadRequest());
            }

            return(Ok(Json(RestCore.GetResponse("assistant_alarm", new RequestParameter(authToken, publicIp, localIp, new object[] { alarmText, alarmAt })))));
        }
Пример #5
0
        public ActionResult <RequestResponse> SetPin_POST(
            [FromHeader] string authToken,
            [FromHeader] string localIp,
            [FromHeader] string publicIp,
            [FromQuery] int gpioPin,
            [FromQuery] RestCore.GpioPinMode pinMode,
            [FromQuery] RestCore.GpioPinState pinState)
        {
            if (string.IsNullOrEmpty(authToken) || string.IsNullOrEmpty(localIp) || string.IsNullOrEmpty(publicIp) || gpioPin <= 0)
            {
                return(BadRequest());
            }

            return(Ok(Json(RestCore.GetResponse("set_gpio", new RequestParameter(authToken, publicIp, localIp, new object[] { gpioPin, pinMode, pinState })))));
        }