@ -9,12 +9,10 @@ import com.mashibing.util.R;
import com.mashibing.vo.ResultVO ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.validation.BindingResult ;
import org.springframework.web.bind.annotation.GetMapping ;
import org.springframework.web.bind.annotation.PostMapping ;
import org.springframework.web.bind.annotation.RequestParam ;
import org.springframework.web.bind.annotation.RestController ;
import org.springframework.web.bind.annotation.* ;
import javax.validation.Valid ;
import javax.websocket.server.PathParam ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;
@ -141,4 +139,37 @@ public class AirController {
//3、返回
return R . ok ( ) ;
}
/ * *
* # 删 除 空 气 质 量 信 息
* # 请 求 方 式 & 路 径
* DELETE http : //localhost:8080/air/delete/{id}
*
* # 请 求 参 数
* 路 径 上 的 id
*
* # 业 务 流 程
* 1 、 接 收 参 数
* 2 、 删 除 指 定 id 的 数 据
*
* # 响 应 数 据
* 成 功 响 应 :
* {
* "code" : 0 ,
* "msg" : ""
* }
* 失 败 响 应 :
* {
* "code" : 错 误 编 码 ,
* "msg" : "错误信息"
* }
* /
@DeleteMapping ( "/air/delete/{id}" )
public ResultVO airDelete ( @PathVariable Integer id ) {
//1、调用service删除
airService . deleteById ( id ) ;
//2、响应数据
return R . ok ( ) ;
}
}