diff --git a/src/main/java/com/peanut/modules/bookAbroad/controller/VisitorController.java b/src/main/java/com/peanut/modules/bookAbroad/controller/VisitorController.java index 5ee3fd6..2cad2f7 100644 --- a/src/main/java/com/peanut/modules/bookAbroad/controller/VisitorController.java +++ b/src/main/java/com/peanut/modules/bookAbroad/controller/VisitorController.java @@ -12,8 +12,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; @Slf4j @RestController("visitorBookAbroad") @@ -100,6 +103,24 @@ public class VisitorController { return R.ok().put("bookInfo",bookEntity); } + //相关图书 + @RequestMapping("/getRecommendBook") + public R getRecommendBook(@RequestBody Map params){ + Set bookList = new HashSet<>(); + //书籍绑定的标签 + List tolableBookList = toLableService.list(new LambdaQueryWrapper() + .eq(BookAbroadToLable::getBookId,params.get("bookId"))); + for (BookAbroadToLable tolableBook : tolableBookList) { + //标签下的书籍 + List tolableLableList = toLableService.list(new LambdaQueryWrapper() + .eq(BookAbroadToLable::getLableId,tolableBook.getLableId())); + for (BookAbroadToLable tolableLable : tolableLableList) { + bookList.add(bookService.getById(tolableLable.getBookId())); + } + } + return R.ok().put("bookList",bookList); + } + } diff --git a/src/main/java/com/peanut/modules/pay/IOSPay/constant/VerifyReceiptConstant.java b/src/main/java/com/peanut/modules/pay/IOSPay/constant/VerifyReceiptConstant.java index 221f94b..3cf3295 100644 --- a/src/main/java/com/peanut/modules/pay/IOSPay/constant/VerifyReceiptConstant.java +++ b/src/main/java/com/peanut/modules/pay/IOSPay/constant/VerifyReceiptConstant.java @@ -12,6 +12,7 @@ public interface VerifyReceiptConstant { String APP_BUNDLE_IDENTIFIER = "com.cn.nuttyreading"; String MEDICINE_APP_BUNDLE_IDENTIFIER = "com.cn.medicine"; String ZMZM_APP_BUNDLE_IDENTIFIER = "com.cn.zmzm"; + String READINGGLOBAL_APP_BUNDLE_IDENTIFIER = "com.reading.amazing"; String URL_SANDBOX = "https://sandbox.itunes.apple.com/verifyReceipt"; String URL_VERIFY = "https://buy.itunes.apple.com/verifyReceipt"; diff --git a/src/main/java/com/peanut/modules/pay/IOSPay/controller/AppController.java b/src/main/java/com/peanut/modules/pay/IOSPay/controller/AppController.java index 069434b..1e0f190 100644 --- a/src/main/java/com/peanut/modules/pay/IOSPay/controller/AppController.java +++ b/src/main/java/com/peanut/modules/pay/IOSPay/controller/AppController.java @@ -94,7 +94,8 @@ public class AppController { // 3.1 校验bundle id if (!receipt.getReceipt().getBundle_id().equals(VerifyReceiptConstant.APP_BUNDLE_IDENTIFIER)&& !receipt.getReceipt().getBundle_id().equals(VerifyReceiptConstant.MEDICINE_APP_BUNDLE_IDENTIFIER)&& - !receipt.getReceipt().getBundle_id().equals(VerifyReceiptConstant.ZMZM_APP_BUNDLE_IDENTIFIER)) { + !receipt.getReceipt().getBundle_id().equals(VerifyReceiptConstant.ZMZM_APP_BUNDLE_IDENTIFIER)&& + !receipt.getReceipt().getBundle_id().equals(VerifyReceiptConstant.READINGGLOBAL_APP_BUNDLE_IDENTIFIER)) { return Result.error1(); } if (receipt.getStatus().equals("0")) { @@ -105,7 +106,8 @@ public class AppController { //p+productid为吴门医述商品,单id为疯子读书商品 (appleOrder.getProduct_id().equals(dto.getProductId())|| appleOrder.getProduct_id().equals("p"+dto.getProductId())|| - appleOrder.getProduct_id().equals("Z"+dto.getProductId()))) { + appleOrder.getProduct_id().equals("Z"+dto.getProductId())|| + appleOrder.getProduct_id().equals("Q"+dto.getProductId()))) { order.setOrderid(dto.getOrderId()); order.setReceiptData(dto.getReceiptData()); order.setProductID(dto.getProductId());