34 lines
1.1 KiB
Java
34 lines
1.1 KiB
Java
package com.cdzy.operations;
|
|
|
|
import com.cdzy.operations.model.entity.EbikeBikeInfo;
|
|
import com.cdzy.operations.service.EbikeBikeInfoService;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.postgresql.geometric.PGpoint;
|
|
import org.postgresql.geometric.PGpolygon;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
import java.util.List;
|
|
|
|
@SpringBootTest
|
|
class EbikeOperationsApplicationTests {
|
|
|
|
@Autowired
|
|
private EbikeBikeInfoService bikeInfoService;
|
|
|
|
@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);
|
|
}
|
|
}
|
|
|
|
}
|