2025-09-15 15:48:54 +08:00
|
|
|
package com.cdzy.operations;
|
2025-09-15 10:36:01 +08:00
|
|
|
|
2025-10-22 10:18:32 +08:00
|
|
|
import com.cdzy.operations.model.entity.EbikeRegion;
|
|
|
|
|
import com.cdzy.operations.service.EbikeRegionService;
|
2025-09-15 10:36:01 +08:00
|
|
|
import org.junit.jupiter.api.Test;
|
2025-10-17 11:28:14 +08:00
|
|
|
import org.postgresql.geometric.PGpoint;
|
2025-10-22 10:18:32 +08:00
|
|
|
import org.postgresql.geometric.PGpolygon;
|
2025-10-14 11:09:22 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2025-09-15 10:36:01 +08:00
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
|
|
|
|
|
@SpringBootTest
|
|
|
|
|
class EbikeOperationsApplicationTests {
|
|
|
|
|
|
2025-10-14 11:09:22 +08:00
|
|
|
@Autowired
|
2025-10-22 10:18:32 +08:00
|
|
|
private EbikeRegionService regionService;
|
2025-10-15 10:47:08 +08:00
|
|
|
|
2025-09-15 10:36:01 +08:00
|
|
|
@Test
|
2025-10-17 14:30:43 +08:00
|
|
|
void contextLoads(){
|
2025-10-22 10:18:32 +08:00
|
|
|
PGpoint gpoint1 = new PGpoint(103.943116,30.6327);
|
|
|
|
|
PGpoint gpoint2 = new PGpoint(104.205415,30.633586);
|
|
|
|
|
PGpoint gpoint3 = new PGpoint(104.080789,30.496715);
|
|
|
|
|
PGpoint gpoint4 = new PGpoint(103.943116,30.6327);
|
|
|
|
|
PGpoint[] points = new PGpoint[]{gpoint1,gpoint2,gpoint3,gpoint4};
|
|
|
|
|
PGpolygon pgpolygon = new PGpolygon(points);
|
|
|
|
|
EbikeRegion ebikeRegion = EbikeRegion.builder()
|
|
|
|
|
.operatorId(311460622768435200L)
|
|
|
|
|
.regionName("测试区域")
|
|
|
|
|
.regionPolygon(pgpolygon)
|
|
|
|
|
.createdBy(320131029184712704L)
|
|
|
|
|
.status(0)
|
|
|
|
|
.build();
|
|
|
|
|
regionService.save(ebikeRegion);
|
2025-09-15 10:36:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|