diff --git a/pom.xml b/pom.xml index 5450b0c..a8bf53a 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,11 @@ org.springframework.boot spring-boot-starter-data-redis - + + + org.springframework.boot + spring-boot-starter-cache + org.springframework.boot spring-boot-devtools diff --git a/src/main/java/cn/chjyj/szwh/SzwhApplication.java b/src/main/java/cn/chjyj/szwh/SzwhApplication.java index 134eac5..0fc2b04 100644 --- a/src/main/java/cn/chjyj/szwh/SzwhApplication.java +++ b/src/main/java/cn/chjyj/szwh/SzwhApplication.java @@ -2,9 +2,11 @@ package cn.chjyj.szwh; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; import org.springframework.scheduling.annotation.EnableScheduling; @SpringBootApplication +@EnableCaching public class SzwhApplication { public static void main(String[] args) { diff --git a/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java b/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java index 42344ce..7cc4c7d 100644 --- a/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java +++ b/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java @@ -240,7 +240,10 @@ public class GoodsController extends BaseController { String limit = request.getString("limit"); int ilimit = (StringUtils.isBlank(limit)) ? 20 : Integer.valueOf(limit); String page = request.getString("page"); - Integer ipage = StringUtils.isBlank(page) ? 1 : Integer.valueOf(page); + Integer ipage =1; + if(!"null".equals(page) && StringUtils.isNotEmpty(page)){ + ipage = Integer.valueOf(page); + } Map retmap = goodsService.getGoodsByMap(qmap, ipage, ilimit); diff --git a/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java b/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java index a6aa620..8751f66 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java @@ -164,6 +164,7 @@ public class GoodsServiceImpl implements GoodsService { * @param limit 条目 * @return */ + @Override public Map getGoodsByMap(Map gmap, int page, int limit) { Map retmap = new HashMap(); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 31acd80..56f5f8f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -26,6 +26,9 @@ spring.redis.jedis.pool.enabled=true spring.redis.jedis.pool.max-active=8 spring.redis.jedis.pool.max-wait=-1 +#缓存处理 +spring.cache.type=simple + # 暂使用单机模式进行任务管理 spring.quartz.scheduler-name=szwhQuartz spring.quartz.job-store-type=memory diff --git a/src/test/java/cn/chjyj/szwh/service/impl/PayServiceImplTest.java b/src/test/java/cn/chjyj/szwh/service/impl/PayServiceImplTest.java new file mode 100644 index 0000000..5904741 --- /dev/null +++ b/src/test/java/cn/chjyj/szwh/service/impl/PayServiceImplTest.java @@ -0,0 +1,40 @@ +package cn.chjyj.szwh.service.impl; + +import cn.chjyj.szwh.service.PayService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.junit.Assert.*; + +@SpringBootTest +@RunWith(SpringJUnit4ClassRunner.class) +public class PayServiceImplTest { + @Autowired + private PayService payService; + @Test + public void payComplete() { + } + + // 支付完成的处理 + @Test + public void payFinishOperate() { + String batchcode ="1670377727385829"; + int ii = payService.payFinishOperate(batchcode); + System.out.println(ii); + } + + @Test + public void payCallback() { + } + + @Test + public void invoiceBuyOperate() { + } + + @Test + public void invoiceSellerOperate() { + } +} \ No newline at end of file