Example #1
0
        public async Task <IActionResult> Post([FromBody] UseHistoryReq reqForm)
        {
            _logger.LogInformation("start get use history");

            if (reqForm.UserID == "" || reqForm.Range == "")
            {
                return(Ok(new QueryUse_Fail()
                {
                    Msg = "Invalid Request"
                }));
            }

            if (reqForm.Range != "1" && reqForm.Range != "3" && reqForm.Range != "12")
            {
                return(Ok(new QueryUse_Fail()
                {
                    Msg = "Invalid Range"
                }));
            }

            DBModels dbModel = new DBModels();

            return(Ok(new QueryUse_OK()
            {
                UseDetail = (await dbModel.GetQRUseDetail(reqForm.UserID, reqForm.Range))
            }));
        }