90 lines
2.2 KiB
Java
90 lines
2.2 KiB
Java
|
|
package com.cdzy.operations.controller;
|
|||
|
|
|
|||
|
|
import com.cdzy.operations.model.entity.EbikeBikeOrder;
|
|||
|
|
import com.cdzy.operations.service.EbikeBikeOrderService;
|
|||
|
|
import com.mybatisflex.core.paginate.Page;
|
|||
|
|
import jakarta.annotation.Resource;
|
|||
|
|
import org.springframework.web.bind.annotation.*;
|
|||
|
|
|
|||
|
|
import java.util.List;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 工单信息 控制层。
|
|||
|
|
*
|
|||
|
|
* @author attiya
|
|||
|
|
* @since 2025-11-24
|
|||
|
|
*/
|
|||
|
|
@RestController
|
|||
|
|
@RequestMapping("/ebikeBikeOrder")
|
|||
|
|
public class EbikeBikeOrderController {
|
|||
|
|
|
|||
|
|
@Resource
|
|||
|
|
private EbikeBikeOrderService ebikeBikeOrderService;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 添加工单信息。
|
|||
|
|
*
|
|||
|
|
* @param ebikeBikeOrder 工单信息
|
|||
|
|
* @return {@code true} 添加成功,{@code false} 添加失败
|
|||
|
|
*/
|
|||
|
|
@PostMapping("save")
|
|||
|
|
public boolean save(@RequestBody EbikeBikeOrder ebikeBikeOrder) {
|
|||
|
|
return ebikeBikeOrderService.save(ebikeBikeOrder);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 根据主键删除工单信息。
|
|||
|
|
*
|
|||
|
|
* @param id 主键
|
|||
|
|
* @return {@code true} 删除成功,{@code false} 删除失败
|
|||
|
|
*/
|
|||
|
|
@DeleteMapping("remove/{id}")
|
|||
|
|
public boolean remove(@PathVariable Long id) {
|
|||
|
|
return ebikeBikeOrderService.removeById(id);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 根据主键更新工单信息。
|
|||
|
|
*
|
|||
|
|
* @param ebikeBikeOrder 工单信息
|
|||
|
|
* @return {@code true} 更新成功,{@code false} 更新失败
|
|||
|
|
*/
|
|||
|
|
@PutMapping("update")
|
|||
|
|
public boolean update(@RequestBody EbikeBikeOrder ebikeBikeOrder) {
|
|||
|
|
return ebikeBikeOrderService.updateById(ebikeBikeOrder);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 查询所有工单信息。
|
|||
|
|
*
|
|||
|
|
* @return 所有数据
|
|||
|
|
*/
|
|||
|
|
@GetMapping("list")
|
|||
|
|
public List<EbikeBikeOrder> list() {
|
|||
|
|
return ebikeBikeOrderService.list();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 根据工单信息主键获取详细信息。
|
|||
|
|
*
|
|||
|
|
* @param id 工单信息主键
|
|||
|
|
* @return 工单信息详情
|
|||
|
|
*/
|
|||
|
|
@GetMapping("getInfo/{id}")
|
|||
|
|
public EbikeBikeOrder getInfo(@PathVariable Long id) {
|
|||
|
|
return ebikeBikeOrderService.getById(id);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* 分页查询工单信息。
|
|||
|
|
*
|
|||
|
|
* @param page 分页对象
|
|||
|
|
* @return 分页对象
|
|||
|
|
*/
|
|||
|
|
@GetMapping("page")
|
|||
|
|
public Page<EbikeBikeOrder> page(Page<EbikeBikeOrder> page) {
|
|||
|
|
return ebikeBikeOrderService.page(page);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|