Prechádzať zdrojové kódy

支付模块:paddle生成支付链接接口调通

wangPH 2 rokov pred
rodič
commit
c269e51f47
33 zmenil súbory, kde vykonal 905 pridanie a 63 odobranie
  1. 23 23
      pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/bo/GeneratePayLinkPaddleBO.java
  2. 22 0
      pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/bo/GeneratePayLinkResultPaddleBO.java
  3. 18 0
      pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/constant/PaddleAPIConstant.java
  4. 19 0
      pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/paddle/PaddleErrorResult.java
  5. 22 0
      pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/paddle/PaddleResult.java
  6. 6 0
      pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/entity/TableColumn.java
  7. 1 1
      pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/service/TableColumnsService.java
  8. 1 1
      pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/service/impl/GenerateCodeServiceImpl.java
  9. 2 1
      pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/service/impl/TableColumnsServiceImpl.java
  10. 4 0
      pdf-office-payment/pom.xml
  11. 0 1
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/PDFOfficePaymentApplication.java
  12. 65 31
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/client/PaddleClient.java
  13. 76 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/entity/Product.java
  14. 122 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/entity/Subscriptions.java
  15. 61 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/interceptor/PaddleClientHttpRequestInterceptor.java
  16. 11 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/mapper/ProductMapper.java
  17. 11 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/mapper/SubscriptionsMapper.java
  18. 5 3
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/properties/PaddleProperties.java
  19. 19 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/ProductService.java
  20. 19 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/SubscriptionsService.java
  21. 23 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/ProductServiceImpl.java
  22. 23 0
      pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/SubscriptionsServiceImpl.java
  23. 24 0
      pdf-office-payment/src/main/resources/mapper/ProductMapper.xml
  24. 35 0
      pdf-office-payment/src/main/resources/mapper/SubscriptionsMapper.xml
  25. 47 0
      pdf-office-payment/src/test/java/cn/kdan/cloud/pdf/office/payment/PaddleTest.java
  26. 1 1
      pdf-office-payment/src/test/java/cn/kdan/cloud/pdf/office/payment/PayPalTest.java
  27. 113 1
      pdf-office-system/pom.xml
  28. 25 0
      pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/PDFOfficeSystemApplication.java
  29. 39 0
      pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/entity/App.java
  30. 11 0
      pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/mapper/AppMapper.java
  31. 19 0
      pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/service/AppService.java
  32. 23 0
      pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/service/impl/AppServiceImpl.java
  33. 15 0
      pdf-office-system/src/main/resources/mapper/AppMapper.xml

+ 23 - 23
pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/bo/GeneratePayLinkPaddleBO.java

@@ -21,7 +21,7 @@ public class GeneratePayLinkPaddleBO implements Serializable {
     private String vendorAuthCode;
 
     @JsonProperty("product_id")
-    private int productId;
+    private Integer productId;
 
     private String title;
 
@@ -34,7 +34,7 @@ public class GeneratePayLinkPaddleBO implements Serializable {
     private String recurringPrices;
 
     @JsonProperty("trial_days")
-    private int trialDays;
+    private Integer trialDays;
 
     @JsonProperty("custom_message")
     private String customMessage;
@@ -42,7 +42,7 @@ public class GeneratePayLinkPaddleBO implements Serializable {
     @JsonProperty("coupon_code")
     private String couponCode;
 
-    private int discountable;
+    private Integer discountable;
 
     @JsonProperty("image_url")
     private String imageUrl;
@@ -51,14 +51,14 @@ public class GeneratePayLinkPaddleBO implements Serializable {
     private String returnUrl;
 
     @JsonProperty("quantity_variable")
-    private int quantityVariable;
+    private Integer quantityVariable;
 
-    private int quantity;
+    private Integer quantity;
 
     private String expires;
 
     @JsonProperty("marketing_consent")
-    private int marketingConsent;
+    private Integer marketingConsent;
 
     @JsonProperty("customer_email")
     private String customerEmail;
@@ -96,23 +96,23 @@ public class GeneratePayLinkPaddleBO implements Serializable {
     private String vatPostcode;
 
 
-    public void setDiscountable(boolean b) {
-        if (b) this.discountable = 1;
-        else this.discountable = 0;
-    }
-
-    public boolean getDiscountable() {
-        return discountable != 0;
-    }
-
-    public void setQuantityVariable(boolean b) {
-        if (b) this.quantityVariable = 1;
-        else this.quantityVariable = 0;
-    }
-
-    public boolean getQuantityVariable() {
-        return quantityVariable != 0;
-    }
+//    public void setDiscountable(boolean b) {
+//        if (b) this.discountable = 1;
+//        else this.discountable = 0;
+//    }
+//
+//    public boolean getDiscountable() {
+//        return discountable != null && discountable != 0;
+//    }
+//
+//    public void setQuantityVariable(boolean b) {
+//        if (b) this.quantityVariable = 1;
+//        else this.quantityVariable = 0;
+//    }
+//
+//    public boolean getQuantityVariable() {
+//        return quantityVariable != null && quantityVariable != 0;
+//    }
 
 
 }

+ 22 - 0
pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/bo/GeneratePayLinkResultPaddleBO.java

@@ -0,0 +1,22 @@
+package cn.kdan.cloud.pdf.office.api.payment.bo;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author ComPDFKit-WPH 2023/1/26
+ *
+ * 生成支付链接返回对象
+ *
+ */
+@Data
+@ToString
+public class GeneratePayLinkResultPaddleBO implements Serializable {
+    /**
+     * 支付链接
+     */
+    private String url;
+
+}

+ 18 - 0
pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/constant/PaddleAPIConstant.java

@@ -0,0 +1,18 @@
+package cn.kdan.cloud.pdf.office.api.payment.constant;
+
+/**
+ * @author ComPDFKit-WPH 2023/1/16
+ * <p>
+ * PaypalAPIConstant
+ */
+public interface PaddleAPIConstant {
+    /**
+     * 创建订阅
+     */
+    String CREAT_PAY_LINK = "/product/generate_pay_link";
+//    /**
+//     * 获取订阅信息
+//     */
+//    String GET_SUBSCRIPTIONS_INFO = "/v1/billing/subscriptions/";
+
+}

+ 19 - 0
pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/paddle/PaddleErrorResult.java

@@ -0,0 +1,19 @@
+package cn.kdan.cloud.pdf.office.api.payment.paddle;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author ComPDFKit-WPH 2023/1/28
+ */
+@Data
+@ToString
+public class PaddleErrorResult implements Serializable {
+
+    private int code;
+
+    private String message;
+
+}

+ 22 - 0
pdf-office-api/pdf-office-api-payment/src/main/java/cn/kdan/cloud/pdf/office/api/payment/paddle/PaddleResult.java

@@ -0,0 +1,22 @@
+package cn.kdan.cloud.pdf.office.api.payment.paddle;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.io.Serializable;
+
+/**
+ * @author ComPDFKit-WPH 2023/1/28
+ */
+@Data
+@ToString
+public class PaddleResult<T> implements Serializable {
+
+    private boolean success;
+
+    private T response;
+
+    private PaddleErrorResult error;
+
+
+}

+ 6 - 0
pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/entity/TableColumn.java

@@ -14,6 +14,12 @@ import lombok.EqualsAndHashCode;
 @Data
 public class TableColumn extends Model<TableColumn> {
 
+
+    /**
+     * 数据库名
+     */
+    private String tableSchema;
+
     /**
      * 表名
      */

+ 1 - 1
pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/service/TableColumnsService.java

@@ -15,5 +15,5 @@ public interface TableColumnsService extends IService<TableColumn> {
      * @param tableName 表名字
      * @return 表字段信息
      */
-    List<TableColumn> listTableColumnByName(String tableName);
+    List<TableColumn> listTableColumnByName(String tableSchema,String tableName);
 }

+ 1 - 1
pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/service/impl/GenerateCodeServiceImpl.java

@@ -62,7 +62,7 @@ public class GenerateCodeServiceImpl implements GenerateCodeService {
                 templateRendering.setLowerClassName(className.substring(0, 1).toLowerCase() + className.substring(1));
                 templateRendering.setPathName(ComPDFWordUtils.convertPathName(tableName));
 
-                List<TableColumn> tableColumns = tableColumnsService.listTableColumnByName(tableName);
+                List<TableColumn> tableColumns = tableColumnsService.listTableColumnByName(generateCode.getDbName(),tableName);
                 List<ColumnInfoBO> columns = new LinkedList<>();
                 for (TableColumn tableColumn : tableColumns) {
                     ColumnInfoBO column = new ColumnInfoBO();

+ 2 - 1
pdf-office-generate/src/main/java/cn/kdan/cloud/pdf/office/generate/service/impl/TableColumnsServiceImpl.java

@@ -15,9 +15,10 @@ import java.util.List;
 @Service
 public class TableColumnsServiceImpl extends ServiceImpl<TableColumnsMapper, TableColumn> implements TableColumnsService {
     @Override
-    public List<TableColumn> listTableColumnByName(String tableName) {
+    public List<TableColumn> listTableColumnByName(String tableSchema,String tableName) {
         return this.baseMapper.selectList(
                 Wrappers.<TableColumn>lambdaQuery()
+                        .eq(TableColumn::getTableSchema,tableSchema)
                         .eq(TableColumn::getTableName, tableName)
                         .ne(TableColumn::getColumnName, "created_at")
                         .ne(TableColumn::getColumnName, "updated_at")

+ 4 - 0
pdf-office-payment/pom.xml

@@ -92,6 +92,10 @@
             <groupId>com.fasterxml.jackson.core</groupId>
             <artifactId>jackson-databind</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
 
     </dependencies>
 

+ 0 - 1
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/PDFOfficePaymentApplication.java

@@ -1,6 +1,5 @@
 package cn.kdan.cloud.pdf.office.payment;
 
-import cn.kdan.cloud.pdf.office.common.annotation.EnableMyRabbitMqHandler;
 import cn.kdan.cloud.pdf.office.common.annotation.EnableMybatisPlusConfig;
 import cn.kdan.cloud.pdf.office.payment.properties.PaddleProperties;
 import cn.kdan.cloud.pdf.office.payment.properties.PaypalProperties;

+ 65 - 31
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/client/PaddleClient.java

@@ -1,23 +1,35 @@
 package cn.kdan.cloud.pdf.office.payment.client;
 
-import cn.kdan.cloud.pdf.office.api.payment.bo.CreatSubscriptionsPaypalBO;
 import cn.kdan.cloud.pdf.office.api.payment.bo.CreatSubscriptionsResultPaypalBO;
-import cn.kdan.cloud.pdf.office.api.payment.constant.PaypalAPIConstant;
+import cn.kdan.cloud.pdf.office.api.payment.bo.GeneratePayLinkPaddleBO;
+import cn.kdan.cloud.pdf.office.api.payment.bo.GeneratePayLinkResultPaddleBO;
+import cn.kdan.cloud.pdf.office.api.payment.constant.PaddleAPIConstant;
+import cn.kdan.cloud.pdf.office.api.payment.paddle.PaddleResult;
+import cn.kdan.cloud.pdf.office.common.exception.BackendRuntimeException;
 import cn.kdan.cloud.pdf.office.common.utils.JsonUtils;
-import cn.kdan.cloud.pdf.office.payment.interceptor.PaypalClientHttpRequestInterceptor;
-import cn.kdan.cloud.pdf.office.payment.properties.PaypalProperties;
+import cn.kdan.cloud.pdf.office.payment.interceptor.PaddleClientHttpRequestInterceptor;
+import cn.kdan.cloud.pdf.office.payment.properties.PaddleProperties;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.google.common.collect.Iterables;
+import lombok.extern.slf4j.Slf4j;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.MediaType;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
 import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.DefaultResponseErrorHandler;
 import org.springframework.web.client.RestTemplate;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.io.IOException;
+import java.util.*;
 
 /**
  * @author ComPDFKit-WPH 2023/1/16
@@ -25,29 +37,34 @@ import java.util.List;
  * PaddleClient
  */
 @Component
+@Slf4j
 public class PaddleClient {
 
     private final RestTemplate restTemplate = new RestTemplate();
 
-    private static String PADDLE_HOST;
+    private static String PADDLE_CHECKOUT_HOST;
 
-    public PaddleClient(PaypalProperties properties, PaypalClientHttpRequestInterceptor paypalClientHttpRequestInterceptor) {
+    private static String PADDLE_VENDORS_HOST;
 
+    private final PaddleProperties properties;
 
-        /**PADDLE_HOST = properties.getAddress();
+    public PaddleClient(PaddleProperties properties, PaddleClientHttpRequestInterceptor paddleClientHttpRequestInterceptor) {
+        this.properties = properties;
+        PADDLE_CHECKOUT_HOST = properties.getCheckoutHost();
+        PADDLE_VENDORS_HOST = properties.getVendorsHost();
         SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
         factory.setReadTimeout(properties.getReadTimeOut());
         factory.setConnectTimeout(properties.getConnectTimeout());
         restTemplate.setRequestFactory(factory);
-        restTemplate.setInterceptors(Collections.singletonList(paypalClientHttpRequestInterceptor));
-        restTemplate.setMessageConverters(getConverts());
+//        restTemplate.setMessageConverters(getConverts());
+        restTemplate.setInterceptors(Collections.singletonList(paddleClientHttpRequestInterceptor));
         restTemplate.setErrorHandler(new DefaultResponseErrorHandler() {
             @Override
             public void handleError(@NotNull ClientHttpResponse clientHttpResponse) throws IOException {
-                //只要重写此方法,不去抛出HttpClientErrorException异常即可
-//                HttpStatus statusCode = clientHttpResponse.getStatusCode();
+                // 只要重写此方法,不去抛出HttpClientErrorException异常即可
+                // HttpStatus statusCode = clientHttpResponse.getStatusCode();
             }
-        });*/
+        });
     }
 
     private List<HttpMessageConverter<?>> getConverts() {
@@ -58,6 +75,7 @@ public class PaddleClient {
             add(MediaType.TEXT_PLAIN);
             add(MediaType.TEXT_HTML);
             add(MediaType.APPLICATION_JSON);
+            add(MediaType.ALL);
         }};
         stringConvert.setSupportedMediaTypes(stringMediaTypes);
         messageConverters.add(stringConvert);
@@ -70,12 +88,33 @@ public class PaddleClient {
      * @param creatSubscriptions creatSubscriptions
      * @return CreatSubscriptionsResultBO
      */
-    public CreatSubscriptionsResultPaypalBO creatSubscriptions(CreatSubscriptionsPaypalBO creatSubscriptions) {
-        String resultJson = restTemplate.exchange(PADDLE_HOST + PaypalAPIConstant.CREAT_SUBSCRIPTIONS,
+    public GeneratePayLinkResultPaddleBO creatSubscriptions(GeneratePayLinkPaddleBO creatSubscriptions) {
+        creatSubscriptions.setVendorId(properties.getVendorId());
+        creatSubscriptions.setVendorAuthCode(properties.getVendorAuthCode());
+        MultiValueMap<String, Object> requestParamMap = new LinkedMultiValueMap<>();
+
+        Map<String, Object> stringObjectMap = JSON.parseObject(JsonUtils.getJsonString(creatSubscriptions),
+                new TypeReference<Map<String, Object>>() {});
+
+        Iterables.removeIf(stringObjectMap.values(), Objects::isNull);
+
+        requestParamMap.setAll(stringObjectMap);
+
+        log.info("prama:{}",requestParamMap);
+        String resultJson = restTemplate.exchange(
+                PADDLE_VENDORS_HOST + PaddleAPIConstant.CREAT_PAY_LINK,
                 HttpMethod.POST,
-                new HttpEntity<>(JsonUtils.getJsonString(creatSubscriptions), getJsonHttpHeaders()),
+                new HttpEntity<>(requestParamMap, getJsonHttpHeaders()),
                 String.class).getBody();
-        return JsonUtils.jsonStringToBean(resultJson, CreatSubscriptionsResultPaypalBO.class);
+        PaddleResult<GeneratePayLinkResultPaddleBO> paddleResult = JSON.parseObject(resultJson,
+                new TypeReference<PaddleResult<GeneratePayLinkResultPaddleBO>>() {});
+
+        if (!paddleResult.isSuccess()) {
+            log.info("paddle 生成支付链接调用失败\n:{},\n参数:{}", paddleResult.getError(), creatSubscriptions);
+            throw new BackendRuntimeException(paddleResult.getError().getMessage());
+        }
+        // TODO 返回信息再调整
+        return paddleResult.getResponse();
     }
 
 
@@ -85,24 +124,19 @@ public class PaddleClient {
      * @param subscriptionId subscriptionId
      * @return CreatSubscriptionsResultBO
      */
-    public CreatSubscriptionsResultPaypalBO getSubscriptionInfo(@NotNull String subscriptionId){
-        String resultJson = restTemplate.exchange(PADDLE_HOST + PaypalAPIConstant.GET_SUBSCRIPTIONS_INFO + subscriptionId,
-                HttpMethod.GET,
-                new HttpEntity<>(getJsonHttpHeaders()),
-                String.class).getBody();
-        return JsonUtils.jsonStringToBean(resultJson, CreatSubscriptionsResultPaypalBO.class);
+    public CreatSubscriptionsResultPaypalBO getSubscriptionInfo(@NotNull String subscriptionId) {
+//        String resultJson = restTemplate.exchange(PADDLE_HOST + PaypalAPIConstant.GET_SUBSCRIPTIONS_INFO + subscriptionId,
+//                HttpMethod.GET,
+//                new HttpEntity<>(getJsonHttpHeaders()),
+//                String.class).getBody();
+//        return JsonUtils.jsonStringToBean(resultJson, CreatSubscriptionsResultPaypalBO.class);
+        return null;
     }
 
-
-    /**
-     * 创建 APPLICATION_JSON HttpHeaders
-     *
-     * @return HttpHeaders
-     */
     @NotNull
     private HttpHeaders getJsonHttpHeaders() {
         HttpHeaders httpHeaders = new HttpHeaders();
-        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
+        httpHeaders.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
         return httpHeaders;
     }
 

+ 76 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/entity/Product.java

@@ -0,0 +1,76 @@
+package cn.kdan.cloud.pdf.office.payment.entity;
+
+import cn.kdan.cloud.pdf.office.common.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.math.BigDecimal;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("product")
+public class Product extends BaseEntity{
+
+    /**
+     * 
+     */
+    private Integer id;
+    /**
+     * 
+     */
+    private String productName;
+    /**
+     * 
+     */
+    private Integer appId;
+    /**
+     * 
+     */
+    private String code;
+    /**
+     * 
+     */
+    private Double price;
+    /**
+     * 
+     */
+    private String forVersion;
+    /**
+     * 
+     */
+    private String forPeriod;
+    /**
+     * 
+     */
+    private Integer maxDeviceNum;
+    /**
+     * 
+     */
+    private String description;
+    /**
+     * 
+     */
+    private Double cnyPrice;
+    /**
+     * 
+     */
+    private Integer parentProductId;
+    /**
+     * 
+     */
+    private String sonIds;
+    /**
+     * 
+     */
+    private BigDecimal displayPrice;
+    /**
+     * 
+     */
+    private BigDecimal cnyDisplayPrice;
+
+}

+ 122 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/entity/Subscriptions.java

@@ -0,0 +1,122 @@
+package cn.kdan.cloud.pdf.office.payment.entity;
+
+import cn.kdan.cloud.pdf.office.common.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("subscriptions")
+public class Subscriptions extends BaseEntity{
+
+    /**
+     * 
+     */
+    @TableId(type = IdType.ASSIGN_UUID)
+    private String id;
+    /**
+     * 
+     */
+    private Integer productId;
+    /**
+     * 
+     */
+    private Integer status;
+    /**
+     * 
+     */
+    private BigDecimal price;
+    /**
+     * 
+     */
+    private Integer buyerType;
+    /**
+     * 
+     */
+    private String cdkey;
+    /**
+     * 
+     */
+    private String email;
+    /**
+     * 
+     */
+    private String phone;
+    /**
+     * 
+     */
+    private String contactName;
+    /**
+     * 
+     */
+    private String companyName;
+    /**
+     * 
+     */
+    private Date startDate;
+    /**
+     * 
+     */
+    private Date endDate;
+    /**
+     * 
+     */
+    private Integer maxDeviceAmount;
+    /**
+     * 
+     */
+    private BigDecimal cnyPrice;
+    /**
+     * 
+     */
+    private String couponId;
+    /**
+     * 
+     */
+    private String cdkeyType;
+    /**
+     * 
+     */
+    private String upgradeCdkey;
+    /**
+     * 
+     */
+    private String forReason;
+    /**
+     * 
+     */
+    private String lastSubId;
+    /**
+     * 
+     */
+    private Integer payment;
+    /**
+     * 
+     */
+    private BigDecimal originalPrice;
+    /**
+     * 
+     */
+    private BigDecimal cnyOriginalPrice;
+    /**
+     * 
+     */
+    private Integer isVpp;
+    /**
+     * 
+     */
+    private String vppMemberId;
+    /**
+     * 
+     */
+    private String companyId;
+
+}

+ 61 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/interceptor/PaddleClientHttpRequestInterceptor.java

@@ -0,0 +1,61 @@
+package cn.kdan.cloud.pdf.office.payment.interceptor;
+
+import cn.kdan.cloud.pdf.office.common.exception.BackendRuntimeException;
+import cn.kdan.cloud.pdf.office.common.utils.JsonUtils;
+import cn.kdan.cloud.pdf.office.payment.properties.PaddleProperties;
+import cn.kdan.cloud.pdf.office.payment.properties.PaypalProperties;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.tomcat.util.codec.binary.Base64;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.http.HttpRequest;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.client.ClientHttpRequestExecution;
+import org.springframework.http.client.ClientHttpRequestInterceptor;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.http.client.support.HttpRequestWrapper;
+import org.springframework.stereotype.Component;
+
+import java.io.IOException;
+import java.net.URI;
+import java.nio.charset.StandardCharsets;
+
+/**
+ * @author ComPDFKit-WPH 2023/1/16
+ */
+@Slf4j
+@Component
+public class PaddleClientHttpRequestInterceptor implements ClientHttpRequestInterceptor {
+
+    @NotNull
+    @Override
+    public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
+        //打印请求头信息
+        tranceRequest(request, body);
+        ClientHttpResponse execute = execution.execute(request, body);
+        HttpStatus statusCode = execute.getStatusCode();
+        if (statusCode.is2xxSuccessful()) {
+            return execute;
+        } else if (statusCode.is3xxRedirection()) {
+            // TODO http 3xx异常
+            throw new BackendRuntimeException();
+        } else if (statusCode.is4xxClientError()) {
+            // TODO http 4xx异常
+            throw new BackendRuntimeException();
+        } else if (statusCode.is5xxServerError()) {
+            // TODO http 5xx异常
+            throw new BackendRuntimeException();
+        } else {
+            // TODO http 未知异常
+            throw new BackendRuntimeException();
+        }
+    }
+
+    private void tranceRequest(HttpRequest request, byte[] body) {
+        log.info("======= paddle request begin ========");
+        log.info("uri : {}", request.getURI());
+        log.info("method : {}", request.getMethod());
+        log.info("headers : {}", request.getHeaders());
+        log.info("request body : {}", new String(body, StandardCharsets.UTF_8));
+        log.info("======= paddle request end ========");
+    }
+}

+ 11 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/mapper/ProductMapper.java

@@ -0,0 +1,11 @@
+package cn.kdan.cloud.pdf.office.payment.mapper;
+
+import cn.kdan.cloud.pdf.office.payment.entity.Product;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+public interface ProductMapper extends BaseMapper<Product> {
+
+}

+ 11 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/mapper/SubscriptionsMapper.java

@@ -0,0 +1,11 @@
+package cn.kdan.cloud.pdf.office.payment.mapper;
+
+import cn.kdan.cloud.pdf.office.payment.entity.Subscriptions;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+public interface SubscriptionsMapper extends BaseMapper<Subscriptions> {
+
+}

+ 5 - 3
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/properties/PaddleProperties.java

@@ -24,10 +24,12 @@ public class PaddleProperties {
     private String vendorsHost;
 
     /**
-     * clientId
+     * vendorId
+     */
+    private Integer vendorId;
+    /**
+     * vendorAuthCode
      */
-    private String vendorId;
-
     private String vendorAuthCode;
 
     private Integer readTimeOut;

+ 19 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/ProductService.java

@@ -0,0 +1,19 @@
+package cn.kdan.cloud.pdf.office.payment.service;
+
+import cn.kdan.cloud.pdf.office.payment.entity.Product;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+public interface ProductService extends IService<Product> {
+
+    /**
+     * 列表查询
+     * @param query 查询参数
+     * @return 列表数据
+     */
+    IPage<Product> page(Product query);
+
+}

+ 19 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/SubscriptionsService.java

@@ -0,0 +1,19 @@
+package cn.kdan.cloud.pdf.office.payment.service;
+
+import cn.kdan.cloud.pdf.office.payment.entity.Subscriptions;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+public interface SubscriptionsService extends IService<Subscriptions> {
+
+    /**
+     * 列表查询
+     * @param query 查询参数
+     * @return 列表数据
+     */
+    IPage<Subscriptions> page(Subscriptions query);
+
+}

+ 23 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/ProductServiceImpl.java

@@ -0,0 +1,23 @@
+package cn.kdan.cloud.pdf.office.payment.service.impl;
+
+import cn.kdan.cloud.pdf.office.payment.entity.Product;
+import cn.kdan.cloud.pdf.office.payment.mapper.ProductMapper;
+import cn.kdan.cloud.pdf.office.payment.service.ProductService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+@Service
+public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
+
+    @Override
+    public IPage<Product> page(Product query) {
+        return this.page(new Page<>(query.getPage(), query.getSize()), Wrappers.query(query));
+    }
+
+}

+ 23 - 0
pdf-office-payment/src/main/java/cn/kdan/cloud/pdf/office/payment/service/impl/SubscriptionsServiceImpl.java

@@ -0,0 +1,23 @@
+package cn.kdan.cloud.pdf.office.payment.service.impl;
+
+import cn.kdan.cloud.pdf.office.payment.entity.Subscriptions;
+import cn.kdan.cloud.pdf.office.payment.mapper.SubscriptionsMapper;
+import cn.kdan.cloud.pdf.office.payment.service.SubscriptionsService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+@Service
+public class SubscriptionsServiceImpl extends ServiceImpl<SubscriptionsMapper, Subscriptions> implements SubscriptionsService {
+
+    @Override
+    public IPage<Subscriptions> page(Subscriptions query) {
+        return this.page(new Page<>(query.getPage(), query.getSize()), Wrappers.query(query));
+    }
+
+}

+ 24 - 0
pdf-office-payment/src/main/resources/mapper/ProductMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="cn.kdan.cloud.pdf.office.payment.mapper.ProductMapper">
+
+    <!-- 可根据自己的需求,是否要使用 -->
+    <resultMap id="ProductResultMap" type="cn.kdan.cloud.pdf.office.payment.entity.Product">
+        <result property="id" column="id" />
+        <result property="productName" column="product_name" />
+        <result property="appId" column="app_id" />
+        <result property="code" column="code" />
+        <result property="price" column="price" />
+        <result property="forVersion" column="for_version" />
+        <result property="forPeriod" column="for_period" />
+        <result property="maxDeviceNum" column="max_device_num" />
+        <result property="description" column="description" />
+        <result property="cnyPrice" column="cny_price" />
+        <result property="parentProductId" column="parent_product_id" />
+        <result property="sonIds" column="son_ids" />
+        <result property="displayPrice" column="display_price" />
+        <result property="cnyDisplayPrice" column="cny_display_price" />
+    </resultMap>
+
+</mapper>

+ 35 - 0
pdf-office-payment/src/main/resources/mapper/SubscriptionsMapper.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="cn.kdan.cloud.pdf.office.payment.mapper.SubscriptionsMapper">
+
+    <!-- 可根据自己的需求,是否要使用 -->
+    <resultMap id="SubscriptionsResultMap" type="cn.kdan.cloud.pdf.office.payment.entity.Subscriptions">
+        <result property="id" column="id" />
+        <result property="productId" column="product_id" />
+        <result property="status" column="status" />
+        <result property="price" column="price" />
+        <result property="buyerType" column="buyer_type" />
+        <result property="cdkey" column="cdkey" />
+        <result property="email" column="email" />
+        <result property="phone" column="phone" />
+        <result property="contactName" column="contact_name" />
+        <result property="companyName" column="company_name" />
+        <result property="startDate" column="start_date" />
+        <result property="endDate" column="end_date" />
+        <result property="maxDeviceAmount" column="max_device_amount" />
+        <result property="cnyPrice" column="cny_price" />
+        <result property="couponId" column="coupon_id" />
+        <result property="cdkeyType" column="cdkey_type" />
+        <result property="upgradeCdkey" column="upgrade_cdkey" />
+        <result property="forReason" column="for_reason" />
+        <result property="lastSubId" column="last_sub_id" />
+        <result property="payment" column="payment" />
+        <result property="originalPrice" column="original_price" />
+        <result property="cnyOriginalPrice" column="cny_original_price" />
+        <result property="isVpp" column="is_vpp" />
+        <result property="vppMemberId" column="vpp_member_id" />
+        <result property="companyId" column="company_id" />
+    </resultMap>
+
+</mapper>

+ 47 - 0
pdf-office-payment/src/test/java/cn/kdan/cloud/pdf/office/payment/PaddleTest.java

@@ -0,0 +1,47 @@
+package cn.kdan.cloud.pdf.office.payment;
+
+import cn.kdan.cloud.pdf.office.api.payment.bo.CreatSubscriptionsPaypalBO;
+import cn.kdan.cloud.pdf.office.api.payment.bo.CreatSubscriptionsResultPaypalBO;
+import cn.kdan.cloud.pdf.office.api.payment.bo.GeneratePayLinkPaddleBO;
+import cn.kdan.cloud.pdf.office.api.payment.constant.UserAction;
+import cn.kdan.cloud.pdf.office.api.payment.paypal.ApplicationContext;
+import cn.kdan.cloud.pdf.office.api.payment.paypal.Money;
+import cn.kdan.cloud.pdf.office.api.payment.paypal.PayerName;
+import cn.kdan.cloud.pdf.office.api.payment.paypal.SubscriberRequest;
+import cn.kdan.cloud.pdf.office.common.utils.JsonUtils;
+import cn.kdan.cloud.pdf.office.payment.client.PaddleClient;
+import cn.kdan.cloud.pdf.office.payment.client.PaypalClient;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+/**
+ * @author ComPDFKit-WPH 2023/1/16
+ */
+@SpringBootTest
+public class PaddleTest {
+
+    @Autowired
+    private PaddleClient paddleClient;
+
+    @Test
+    public void creatS(){
+        GeneratePayLinkPaddleBO generatePayLinkPaddleBO = new GeneratePayLinkPaddleBO();
+        generatePayLinkPaddleBO.setProductId(38247);
+        System.out.println(paddleClient.creatSubscriptions(generatePayLinkPaddleBO));
+    }
+
+//    @Test
+//    public void getSInfo(){
+//        CreatSubscriptionsResultPaypalBO subscriptionInfo = paypalClient.getSubscriptionInfo("I-S8EXDUY8BYLF");
+//        System.out.println(JsonUtils.getJsonString(subscriptionInfo));
+//    }
+//
+//    public static void main(String[] args) {
+//        GeneratePayLinkPaddleBO generatePayLinkPaddleBO = new GeneratePayLinkPaddleBO();
+//        generatePayLinkPaddleBO.setDiscountable(true);
+//        System.out.println(generatePayLinkPaddleBO.getDiscountable());
+//
+//    }
+
+}

+ 1 - 1
pdf-office-payment/src/test/java/cn/kdan/cloud/pdf/office/payment/PayPalTest.java

@@ -59,7 +59,7 @@ public class PayPalTest {
 
     public static void main(String[] args) {
         GeneratePayLinkPaddleBO generatePayLinkPaddleBO = new GeneratePayLinkPaddleBO();
-        generatePayLinkPaddleBO.setDiscountable(true);
+//        generatePayLinkPaddleBO.setDiscountable(true);
         System.out.println(generatePayLinkPaddleBO.getDiscountable());
 
     }

+ 113 - 1
pdf-office-system/pom.xml

@@ -10,10 +10,122 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>pdf-office-system</artifactId>
-
+    <description>管理后台</description>
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
     </properties>
 
+    <dependencies>
+        <dependency>
+            <groupId>cn.kdan.pdf.office</groupId>
+            <artifactId>pdf-office-common</artifactId>
+            <version>0.0.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-amqp</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+        </dependency>
+
+    </dependencies>
+    <build>
+        <finalName>pdf-office-system</finalName>
+
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+
+
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.22.2</version>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>${docker.version}</version>
+                <configuration>
+                    <!-- Docker 远程管理地址-->
+                    <dockerHost>http://${docker.host}</dockerHost>
+                    <!--镜像名称-->
+                    <imageName>${project.artifactId}</imageName>
+                    <!--Dockerfile-->
+                    <dockerDirectory>${project.basedir}/docker</dockerDirectory>
+                    <!--插件会将需要的资源拷贝到docker目录下,供Dockerfile里构建镜像使用-->
+                    <resources>
+                        <resource>
+                            <targetPath>/</targetPath>
+                            <directory>${project.build.directory}</directory>
+                            <include>${project.build.finalName}.jar</include>
+                        </resource>
+                    </resources>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>

+ 25 - 0
pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/PDFOfficeSystemApplication.java

@@ -0,0 +1,25 @@
+package cn.kdan.cloud.pdf.office.system;
+
+import cn.kdan.cloud.pdf.office.common.annotation.EnableMybatisPlusConfig;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.netflix.hystrix.EnableHystrix;
+
+/**
+ * @author ComPDFKit-WPH 2023/1/10
+ */
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableHystrix
+@EnableMybatisPlusConfig
+@MapperScan("cn.kdan.cloud.pdf.office.system.mapper")
+public class PDFOfficeSystemApplication {
+
+    public static void main(String[] args) {
+        new SpringApplicationBuilder(PDFOfficeSystemApplication.class).run(args);
+    }
+
+}

+ 39 - 0
pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/entity/App.java

@@ -0,0 +1,39 @@
+package cn.kdan.cloud.pdf.office.system.entity;
+
+import cn.kdan.cloud.pdf.office.common.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("app")
+public class App extends BaseEntity{
+
+    /**
+     * 
+     */
+    private Integer id;
+    /**
+     * 
+     */
+    private String appName;
+    /**
+     * 
+     */
+    private String code;
+    /**
+     * 
+     */
+    private Integer latestVersionId;
+    /**
+     * 
+     */
+    private Double maxTrailDays;
+
+}

+ 11 - 0
pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/mapper/AppMapper.java

@@ -0,0 +1,11 @@
+package cn.kdan.cloud.pdf.office.system.mapper;
+
+import cn.kdan.cloud.pdf.office.system.entity.App;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+public interface AppMapper extends BaseMapper<App> {
+
+}

+ 19 - 0
pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/service/AppService.java

@@ -0,0 +1,19 @@
+package cn.kdan.cloud.pdf.office.system.service;
+
+import cn.kdan.cloud.pdf.office.system.entity.App;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+public interface AppService extends IService<App> {
+
+    /**
+     * 列表查询
+     * @param query 查询参数
+     * @return 列表数据
+     */
+    IPage<App> page(App query);
+
+}

+ 23 - 0
pdf-office-system/src/main/java/cn/kdan/cloud/pdf/office/system/service/impl/AppServiceImpl.java

@@ -0,0 +1,23 @@
+package cn.kdan.cloud.pdf.office.system.service.impl;
+
+import cn.kdan.cloud.pdf.office.system.entity.App;
+import cn.kdan.cloud.pdf.office.system.mapper.AppMapper;
+import cn.kdan.cloud.pdf.office.system.service.AppService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author ComPDFKit-WPH 2023-01-28
+ */
+@Service
+public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements AppService {
+
+    @Override
+    public IPage<App> page(App query) {
+        return this.page(new Page<>(query.getPage(), query.getSize()), Wrappers.query(query));
+    }
+
+}

+ 15 - 0
pdf-office-system/src/main/resources/mapper/AppMapper.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="cn.kdan.cloud.pdf.office.system.mapper.AppMapper">
+
+    <!-- 可根据自己的需求,是否要使用 -->
+    <resultMap id="AppResultMap" type="cn.kdan.cloud.pdf.office.system.entity.App">
+        <result property="id" column="id" />
+        <result property="appName" column="app_name" />
+        <result property="code" column="code" />
+        <result property="latestVersionId" column="latest_version_id" />
+        <result property="maxTrailDays" column="max_trail_days" />
+    </resultMap>
+
+</mapper>