添加ios内购
This commit is contained in:
@@ -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<String,Object> params){
|
||||
Set<BookEntity> bookList = new HashSet<>();
|
||||
//书籍绑定的标签
|
||||
List<BookAbroadToLable> tolableBookList = toLableService.list(new LambdaQueryWrapper<BookAbroadToLable>()
|
||||
.eq(BookAbroadToLable::getBookId,params.get("bookId")));
|
||||
for (BookAbroadToLable tolableBook : tolableBookList) {
|
||||
//标签下的书籍
|
||||
List<BookAbroadToLable> tolableLableList = toLableService.list(new LambdaQueryWrapper<BookAbroadToLable>()
|
||||
.eq(BookAbroadToLable::getLableId,tolableBook.getLableId()));
|
||||
for (BookAbroadToLable tolableLable : tolableLableList) {
|
||||
bookList.add(bookService.getById(tolableLable.getBookId()));
|
||||
}
|
||||
}
|
||||
return R.ok().put("bookList",bookList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user