2025-10-17 11:28:14 +08:00
|
|
|
package com.cdzy.operations.controller;
|
|
|
|
|
|
2025-10-21 09:36:31 +08:00
|
|
|
import com.cdzy.common.model.response.JsonResult;
|
2025-10-21 14:57:52 +08:00
|
|
|
import com.cdzy.operations.model.entity.EbikeBikeInfo;
|
2025-10-21 09:51:07 +08:00
|
|
|
import com.cdzy.operations.model.vo.EbikeBikeBindVo;
|
2025-10-21 09:36:31 +08:00
|
|
|
import com.cdzy.operations.service.EbikeBikeInfoService;
|
|
|
|
|
import jakarta.annotation.Resource;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
2025-10-21 14:57:52 +08:00
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
2025-10-17 11:28:14 +08:00
|
|
|
|
|
|
|
|
/**
|
2025-10-21 09:36:31 +08:00
|
|
|
* 车辆基本信息 控制层。
|
2025-10-17 11:28:14 +08:00
|
|
|
*
|
|
|
|
|
* @author attiya
|
|
|
|
|
* @since 2025-10-17
|
|
|
|
|
*/
|
2025-10-21 09:36:31 +08:00
|
|
|
@Validated
|
2025-10-17 11:28:14 +08:00
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/ebikeBikeInfo")
|
|
|
|
|
public class EbikeBikeInfoController {
|
|
|
|
|
|
2025-10-21 09:36:31 +08:00
|
|
|
@Resource
|
2025-10-17 11:28:14 +08:00
|
|
|
private EbikeBikeInfoService ebikeBikeInfoService;
|
|
|
|
|
|
2025-10-21 09:51:51 +08:00
|
|
|
/**
|
|
|
|
|
* 整车绑定
|
|
|
|
|
* @param bindVo 绑定信息
|
|
|
|
|
* @return 绑定结果
|
|
|
|
|
*/
|
2025-10-21 09:36:31 +08:00
|
|
|
@PostMapping("bind")
|
2025-10-21 09:51:07 +08:00
|
|
|
public JsonResult<?> bind(@Validated @RequestBody EbikeBikeBindVo bindVo) {
|
|
|
|
|
ebikeBikeInfoService.bind(bindVo);
|
2025-10-21 09:36:31 +08:00
|
|
|
return JsonResult.success();
|
2025-10-17 11:28:14 +08:00
|
|
|
}
|
|
|
|
|
|
2025-10-21 14:57:52 +08:00
|
|
|
/**
|
|
|
|
|
* 车辆列表
|
|
|
|
|
* @return 列表
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("list")
|
|
|
|
|
public JsonResult<?> list() {
|
|
|
|
|
List<EbikeBikeInfo> list = ebikeBikeInfoService.list();
|
|
|
|
|
return JsonResult.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成车辆
|
|
|
|
|
* @return 列表
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("save")
|
|
|
|
|
public JsonResult<?> save(@Validated @RequestBody EbikeBikeInfo ebikeBikeInfo) {
|
|
|
|
|
ebikeBikeInfoService.save(ebikeBikeInfo);
|
|
|
|
|
return JsonResult.success();
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-17 11:28:14 +08:00
|
|
|
}
|