package com.cdzy.operations; import com.cdzy.operations.model.entity.EbikeRegion; import com.cdzy.operations.service.EbikeRegionService; 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; @SpringBootTest class EbikeOperationsApplicationTests { @Autowired private EbikeRegionService regionService; @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); } }