运营配置完善
This commit is contained in:
parent
fa8cb81824
commit
4f64538c9a
@ -0,0 +1,89 @@
|
||||
package com.cdzy.operations.controller;
|
||||
|
||||
import com.cdzy.operations.model.entity.EbikeSite;
|
||||
import com.cdzy.operations.service.EbikeSiteService;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点控制层。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ebikeSite")
|
||||
public class EbikeSiteController {
|
||||
|
||||
@Resource
|
||||
private EbikeSiteService ebikeSiteService;
|
||||
|
||||
/**
|
||||
* 添加。
|
||||
*
|
||||
* @param ebikeSite
|
||||
* @return {@code true} 添加成功,{@code false} 添加失败
|
||||
*/
|
||||
@PostMapping("save")
|
||||
public boolean save(@RequestBody EbikeSite ebikeSite) {
|
||||
return ebikeSiteService.save(ebikeSite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键删除。
|
||||
*
|
||||
* @param id 主键
|
||||
* @return {@code true} 删除成功,{@code false} 删除失败
|
||||
*/
|
||||
@DeleteMapping("remove/{id}")
|
||||
public boolean remove(@PathVariable Long id) {
|
||||
return ebikeSiteService.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键更新。
|
||||
*
|
||||
* @param ebikeSite
|
||||
* @return {@code true} 更新成功,{@code false} 更新失败
|
||||
*/
|
||||
@PutMapping("update")
|
||||
public boolean update(@RequestBody EbikeSite ebikeSite) {
|
||||
return ebikeSiteService.updateById(ebikeSite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有。
|
||||
*
|
||||
* @return 所有数据
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public List<EbikeSite> list() {
|
||||
return ebikeSiteService.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据主键获取详细信息。
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 详情
|
||||
*/
|
||||
@GetMapping("getInfo/{id}")
|
||||
public EbikeSite getInfo(@PathVariable Long id) {
|
||||
return ebikeSiteService.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询。
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @return 分页对象
|
||||
*/
|
||||
@GetMapping("page")
|
||||
public Page<EbikeSite> page(Page<EbikeSite> page) {
|
||||
return ebikeSiteService.page(page);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cdzy.operations.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.cdzy.operations.model.entity.EbikeSite;
|
||||
|
||||
/**
|
||||
* 映射层。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-28
|
||||
*/
|
||||
public interface EbikeSiteMapper extends BaseMapper<EbikeSite> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.cdzy.operations.model.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import org.postgresql.geometric.PGpolygon;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 站点基础信息实体类。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("ebike_site")
|
||||
public class EbikeSite implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 站点ID
|
||||
*/
|
||||
@Id
|
||||
private Long siteId;
|
||||
|
||||
/**
|
||||
* 运营商ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 运营区ID
|
||||
*/
|
||||
private Long regionId;
|
||||
|
||||
/**
|
||||
* 站点区域
|
||||
*/
|
||||
private PGpolygon sitePolygon;
|
||||
|
||||
/**
|
||||
* 站点类型:1-普通站点(停车) 2-禁停区 3-仓库区
|
||||
*/
|
||||
private Integer siteType;
|
||||
|
||||
private Timestamp createAt;
|
||||
|
||||
private Long createdBy;
|
||||
|
||||
private Timestamp updatedAt;
|
||||
|
||||
private Long updatedBy;
|
||||
|
||||
private Boolean isDeleted;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.cdzy.operations.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.cdzy.operations.model.entity.EbikeSite;
|
||||
|
||||
/**
|
||||
* 服务层。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-28
|
||||
*/
|
||||
public interface EbikeSiteService extends IService<EbikeSite> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.cdzy.operations.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.cdzy.operations.model.entity.EbikeSite;
|
||||
import com.cdzy.operations.mapper.EbikeSiteMapper;
|
||||
import com.cdzy.operations.service.EbikeSiteService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 服务层实现。
|
||||
*
|
||||
* @author attiya
|
||||
* @since 2025-10-28
|
||||
*/
|
||||
@Service
|
||||
public class EbikeSiteServiceImpl extends ServiceImpl<EbikeSiteMapper, EbikeSite> implements EbikeSiteService{
|
||||
|
||||
}
|
||||
@ -12,7 +12,7 @@ class EbikeStaffApplicationTests {
|
||||
private static final String mapperPath="D:/ebike_plus/ebike-operations/resources/mapper";
|
||||
private static final String packageName ="com.cdzy.operations";
|
||||
private static final String[] tables= new String[]{
|
||||
"ebike_operation_config"
|
||||
"ebike_site"
|
||||
};
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user