1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.flightfeather.obd.lightshare.web
 
import com.flightfeather.obd.lightshare.bean.ThresholdValueVo
import com.flightfeather.obd.lightshare.service.ObdThresholdValueService
import org.springframework.web.bind.annotation.*
 
/**
 * @author riku
 * Date: 2019/9/5
 */
@RestController
@RequestMapping("obd/threshold")
class ObdThresholdController(val obdThresholdValueService: ObdThresholdValueService) {
 
    @GetMapping("/{vinCode}")
    fun getDataByVinCode(
            @PathVariable("vinCode") vinCode: String
    ) = obdThresholdValueService.getDataByVinCode(vinCode)
 
    @PostMapping("/update")
    fun update(
            @RequestParam("userId") userId: String,
            @RequestBody thresholdValueVo: ThresholdValueVo
    ) = obdThresholdValueService.update(userId, thresholdValueVo)
 
    @PutMapping("/save")
    fun save(
            @RequestParam("userId") userId: String,
            @RequestBody thresholdValueVo: ThresholdValueVo
    ) = obdThresholdValueService.save(userId, thresholdValueVo)
 
}