ebike-plus/ebike-operations/src/test/java/com/cdzy/operations/EbikeOperationsApplicationTests.java

36 lines
1.2 KiB
Java
Raw Normal View History

2025-09-15 15:48:54 +08:00
package com.cdzy.operations;
2025-09-15 10:36:01 +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;
import org.postgresql.geometric.PGpoint;
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
private EbikeRegionService regionService;
2025-09-15 10:36:01 +08:00
@Test
void contextLoads(){
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
}
}