车辆基本信息基础功能完善
This commit is contained in:
parent
defc603f99
commit
68298d0bef
@ -1,95 +1,32 @@
|
|||||||
package com.cdzy.operations.controller;
|
package com.cdzy.operations.controller;
|
||||||
|
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.cdzy.common.model.response.JsonResult;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import com.cdzy.operations.model.entity.EbikeBikeInfo;
|
import com.cdzy.operations.model.entity.EbikeBikeInfo;
|
||||||
import com.cdzy.operations.service.EbikeBikeInfoService;
|
import com.cdzy.operations.service.EbikeBikeInfoService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 控制层。
|
* 车辆基本信息 控制层。
|
||||||
*
|
*
|
||||||
* @author attiya
|
* @author attiya
|
||||||
* @since 2025-10-17
|
* @since 2025-10-17
|
||||||
*/
|
*/
|
||||||
|
@Validated
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/ebikeBikeInfo")
|
@RequestMapping("/ebikeBikeInfo")
|
||||||
public class EbikeBikeInfoController {
|
public class EbikeBikeInfoController {
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private EbikeBikeInfoService ebikeBikeInfoService;
|
private EbikeBikeInfoService ebikeBikeInfoService;
|
||||||
|
|
||||||
/**
|
@PostMapping("bind")
|
||||||
* 添加。
|
public JsonResult<?> bind(@Validated @RequestBody EbikeBikeInfo ebikeBikeInfo) {
|
||||||
*
|
return JsonResult.success();
|
||||||
* @param ebikeBikeInfo
|
|
||||||
* @return {@code true} 添加成功,{@code false} 添加失败
|
|
||||||
*/
|
|
||||||
@PostMapping("save")
|
|
||||||
public boolean save(@RequestBody EbikeBikeInfo ebikeBikeInfo) {
|
|
||||||
return ebikeBikeInfoService.save(ebikeBikeInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键删除。
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return {@code true} 删除成功,{@code false} 删除失败
|
|
||||||
*/
|
|
||||||
@DeleteMapping("remove/{id}")
|
|
||||||
public boolean remove(@PathVariable Long id) {
|
|
||||||
return ebikeBikeInfoService.removeById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键更新。
|
|
||||||
*
|
|
||||||
* @param ebikeBikeInfo
|
|
||||||
* @return {@code true} 更新成功,{@code false} 更新失败
|
|
||||||
*/
|
|
||||||
@PutMapping("update")
|
|
||||||
public boolean update(@RequestBody EbikeBikeInfo ebikeBikeInfo) {
|
|
||||||
return ebikeBikeInfoService.updateById(ebikeBikeInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有。
|
|
||||||
*
|
|
||||||
* @return 所有数据
|
|
||||||
*/
|
|
||||||
@GetMapping("list")
|
|
||||||
public List<EbikeBikeInfo> list() {
|
|
||||||
return ebikeBikeInfoService.list();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据主键获取详细信息。
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 详情
|
|
||||||
*/
|
|
||||||
@GetMapping("getInfo/{id}")
|
|
||||||
public EbikeBikeInfo getInfo(@PathVariable Long id) {
|
|
||||||
return ebikeBikeInfoService.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询。
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @return 分页对象
|
|
||||||
*/
|
|
||||||
@GetMapping("page")
|
|
||||||
public Page<EbikeBikeInfo> page(Page<EbikeBikeInfo> page) {
|
|
||||||
return ebikeBikeInfoService.page(page);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,30 +1,23 @@
|
|||||||
package com.cdzy.operations.model.entity;
|
package com.cdzy.operations.model.entity;
|
||||||
|
|
||||||
|
|
||||||
import com.cdzy.operations.handler.PGpointDeserializer;
|
|
||||||
import com.cdzy.operations.handler.PGpointSerializer;
|
|
||||||
import com.cdzy.operations.handler.PGpointTypeHandler;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.mybatisflex.annotation.Column;
|
import com.mybatisflex.annotation.Column;
|
||||||
import com.mybatisflex.annotation.Id;
|
import com.mybatisflex.annotation.Id;
|
||||||
import com.mybatisflex.annotation.Table;
|
import com.mybatisflex.annotation.Table;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.postgresql.geometric.PGpoint;
|
import org.postgresql.geometric.PGpoint;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实体类。
|
* 实体类。
|
||||||
*
|
*
|
||||||
* @author attiya
|
* @author attiya
|
||||||
* @since 2025-10-17
|
* @since 2025-10-21
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@ -75,9 +68,6 @@ public class EbikeBikeInfo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 定位
|
* 定位
|
||||||
*/
|
*/
|
||||||
@Column(typeHandler = PGpointTypeHandler.class)
|
|
||||||
@JsonSerialize(using = PGpointSerializer.class)
|
|
||||||
@JsonDeserialize(using = PGpointDeserializer.class)
|
|
||||||
private PGpoint location;
|
private PGpoint location;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,8 +98,8 @@ public class EbikeBikeInfo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@Column(onInsertValue = "now()")
|
@Column(onInsertValue = "now")
|
||||||
private Timestamp createdAt;
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 创建人
|
||||||
@ -119,8 +109,8 @@ public class EbikeBikeInfo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
@Column(onUpdateValue = "now()")
|
@Column(onUpdateValue = "now")
|
||||||
private Timestamp updatedAt;
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改人
|
* 修改人
|
||||||
@ -132,4 +122,9 @@ public class EbikeBikeInfo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Boolean isDeleted;
|
private Boolean isDeleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否包含头盔
|
||||||
|
*/
|
||||||
|
private Boolean hasHelme;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user