Beispiel #1
0
 public IActionResult DeleteDevice(int device_id)
 {
     if (_devicesService.DeleteDevice(device_id))
     {
         return(Ok(new ResponseBody()
         {
             ResponseCode = ResponseCodeEnum.Success, ResponseMessage = "删除成功"
         }));
     }
     return(Ok(new ResponseBody()
     {
         ResponseCode = ResponseCodeEnum.Fail, ResponseMessage = "删除失败"
     }));
 }
Beispiel #2
0
        public async Task <IActionResult> DeleteDevice([FromRoute] Guid id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var result = await _service.DeleteDevice(id);

            if (!result)
            {
                return(NotFound());
            }

            return(Ok());
        }