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