|
|
@@ -7,14 +7,6 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
-/**
|
|
|
- * <p>
|
|
|
- * 车辆表 前端控制器
|
|
|
- * </p>
|
|
|
- *
|
|
|
- * @author skyline
|
|
|
- * @since 2023-07-26
|
|
|
- */
|
|
|
@RestController
|
|
|
@RequestMapping("/cars")
|
|
|
public class CarsController {
|
|
|
@@ -40,16 +32,16 @@ public class CarsController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/setDefault/{id}")
|
|
|
- public R<?> setDefault(@PathVariable Long id) {
|
|
|
+ public R<?> setDefault(@PathVariable String id) {
|
|
|
var userId = StpUtil.getLoginIdAsLong();
|
|
|
- carsService.setDefault(userId, id);
|
|
|
+ carsService.setDefault(userId, Long.parseLong(id));
|
|
|
return R.success();
|
|
|
}
|
|
|
|
|
|
- @DeleteMapping("/delete/{id}")
|
|
|
- public R<?> delete(@PathVariable Long id) {
|
|
|
+ @PostMapping("/delete/{id}")
|
|
|
+ public R<?> delete(@PathVariable String id) {
|
|
|
var userId = StpUtil.getLoginIdAsLong();
|
|
|
- carsService.deleteCar(userId, id);
|
|
|
+ carsService.deleteCar(userId, Long.parseLong(id));
|
|
|
return R.success();
|
|
|
}
|
|
|
}
|