package com.cdzy.operations; import com.cdzy.operations.mapper.EbikeBikeInfoMapper; import com.cdzy.operations.model.entity.EbikeBikeInfo; import org.junit.jupiter.api.Test; import org.postgresql.geometric.PGpoint; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class EbikeOperationsApplicationTests { @Autowired private EbikeBikeInfoMapper ebikeBikeInfoMapper; @Test void contextLoads() throws Exception { EbikeBikeInfo bikeInfo = new EbikeBikeInfo(); // 创建测试点:X经度、纬度 PGpoint point =new PGpoint(116.3974, 39.9093); bikeInfo.setLocation(point); bikeInfo.setLongitude(String.valueOf(point.x)); bikeInfo.setLatitude(String.valueOf(point.y)); ebikeBikeInfoMapper.insert(bikeInfo); } }