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

34 lines
1.1 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.EbikeBikeInfo;
import com.cdzy.operations.service.EbikeBikeInfoService;
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;
import java.util.List;
2025-09-15 10:36:01 +08:00
@SpringBootTest
class EbikeOperationsApplicationTests {
2025-10-14 11:09:22 +08:00
@Autowired
private EbikeBikeInfoService bikeInfoService;
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);
List<EbikeBikeInfo> bikeInfos = bikeInfoService.list(pgpolygon);
for (EbikeBikeInfo bikeInfo : bikeInfos) {
System.out.println(bikeInfo);
}
2025-09-15 10:36:01 +08:00
}
}