Explorar el Código

新增商户时,生成appId,appkey

liu_lake hace 6 meses
padre
commit
5aa838580f
Se han modificado 28 ficheros con 528 adiciones y 264 borrados
  1. 5 0
      db/db-agent/pom.xml
  2. 0 119
      db/db-agent/src/main/java/pay/platform/domain/PayMerchant.java
  3. 0 120
      db/db-agent/src/main/java/pay/platform/domain/PayOrder.java
  4. 0 17
      db/db-agent/src/main/java/pay/platform/mapper/PayOrderMapper.java
  5. 2 0
      db/db-merchant/src/main/java/pay/platform/domain/PayMerchant.java
  6. 102 0
      db/db-merchant/src/main/java/pay/platform/domain/PayMerchantAppKey.java
  7. 0 0
      db/db-merchant/src/main/java/pay/platform/domain/PayMerchantStore.java
  8. 3 3
      db/db-merchant/src/main/java/pay/platform/mapper/PayMerchantAppKeyMapper.java
  9. 0 0
      db/db-merchant/src/main/java/pay/platform/mapper/PayMerchantStoreMapper.java
  10. 158 0
      web/admin-api/src/main/java/pay/platform/api/system/controller/PayMerchantAppKeyController.java
  11. 15 0
      web/admin-api/src/main/java/pay/platform/api/system/servcie/PayMerchantAppKeyService.java
  12. 19 0
      web/admin-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantAppKeyServiceImpl.java
  13. 8 0
      web/admin-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantServiceImpl.java
  14. 15 0
      web/agent-api/src/main/java/pay/platform/api/system/servcie/PayMerchantAppKeyService.java
  15. 19 0
      web/agent-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantAppKeyServiceImpl.java
  16. 10 1
      web/agent-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantServiceImpl.java
  17. 1 1
      web/merchant-api/src/main/java/pay/platform/core/security/service/UserDetailServiceImpl.java
  18. 10 0
      web/open-api/pom.xml
  19. 14 2
      web/open-api/src/main/java/pay/platform/api/controller/PayController.java
  20. 10 1
      web/open-api/src/main/java/pay/platform/api/model/request/PayRequest.java
  21. 15 0
      web/open-api/src/main/java/pay/platform/api/servcie/PayMerchantAppKeyService.java
  22. 16 0
      web/open-api/src/main/java/pay/platform/api/servcie/PayMerchantService.java
  23. 15 0
      web/open-api/src/main/java/pay/platform/api/servcie/PayMerchantStoreService.java
  24. 15 0
      web/open-api/src/main/java/pay/platform/api/servcie/PayOrderService.java
  25. 19 0
      web/open-api/src/main/java/pay/platform/api/servcie/impl/PayMerchantAppKeyServiceImpl.java
  26. 19 0
      web/open-api/src/main/java/pay/platform/api/servcie/impl/PayMerchantServiceImpl.java
  27. 19 0
      web/open-api/src/main/java/pay/platform/api/servcie/impl/PayMerchantStoreServiceImpl.java
  28. 19 0
      web/open-api/src/main/java/pay/platform/api/servcie/impl/PayOrderServiceImpl.java

+ 5 - 0
db/db-agent/pom.xml

@@ -21,6 +21,11 @@
             <artifactId>core</artifactId>
             <version>1.0.0-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>pay.platform</groupId>
+            <artifactId>db-merchant</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>io.swagger.core.v3</groupId>
             <artifactId>swagger-annotations-jakarta</artifactId>

+ 0 - 119
db/db-agent/src/main/java/pay/platform/domain/PayMerchant.java

@@ -1,119 +0,0 @@
-package pay.platform.domain;
-
-import com.mybatisflex.annotation.Column;
-import com.mybatisflex.annotation.Id;
-import com.mybatisflex.annotation.KeyType;
-import com.mybatisflex.annotation.Table;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-/**
- * 商户管理 实体类。
- *
- * @author mybatis-flex-helper automatic generation
- * @since 1.0
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@Schema(name = "商户管理")
-@Table(value = "t_pay_merchant")
-public class PayMerchant {
-
-    /**
-     * id
-     */
-    @Schema(description = "id")
-    @Id(keyType = KeyType.Generator, value = "SUID")
-    private String id;
-    /**
-     * 代理id
-     */
-    @Schema(description = "代理id")
-    @Column(value = "agent_id")
-    private String agentId;
-
-    /**
-     * 用户名
-     */
-    @Schema(description = "用户名")
-    @Column(value = "user_name")
-    private String userName;
-
-    /**
-     * 密码
-     */
-    @Schema(description = "密码")
-    @Column(value = "password")
-    private String password;
-
-    /**
-     * 余额
-     */
-    @Schema(description = "余额")
-    @Column(value = "amount")
-    private BigDecimal amount;
-
-    /**
-     * 费率
-     */
-    @Schema(description = "费率")
-    @Column(value = "rate")
-    private BigDecimal rate;
-
-    /**
-     * Google校验器
-     */
-    @Schema(description = "Google校验器")
-    @Column(value = "tpop_code")
-    private String tpopCode;
-
-    /**
-     * 是否绑定Google校验器
-     */
-    @Schema(description = "是否绑定Google校验器")
-    @Column(value = "has_tpop")
-    private String hasTpop;
-
-    /**
-     * 状态
-     */
-    @Schema(description = "状态 ")
-    @Column(value = "status")
-    private Integer status;
-
-    /**
-     * 创建人
-     */
-    @Schema(description = "创建人")
-    @Column(value = "create_user")
-    private String createUser;
-
-    /**
-     * 创建时间
-     */
-    @Schema(description = "创建时间")
-    @Column(value = "create_time", onInsertValue = "now()")
-    private LocalDateTime createTime;
-
-    /**
-     * 修改人
-     */
-    @Schema(description = "修改人")
-    @Column(value = "update_user")
-    private String updateUser;
-
-    /**
-     * 修改时间
-     */
-    @Schema(description = "修改时间")
-    @Column(value = "update_time", onUpdateValue = "now()", onInsertValue = "now()")
-    private LocalDateTime updateTime;
-}

+ 0 - 120
db/db-agent/src/main/java/pay/platform/domain/PayOrder.java

@@ -1,120 +0,0 @@
-package pay.platform.domain;
-
-import com.mybatisflex.annotation.Column;
-import com.mybatisflex.annotation.Id;
-import com.mybatisflex.annotation.KeyType;
-import com.mybatisflex.annotation.Table;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-/**
- * 通道管理 实体类。
- *
- * @author mybatis-flex-helper automatic generation
- * @since 1.0
- */
-@Data
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@Schema(name = "通道管理")
-@Table(value = "t_pay_order")
-public class PayOrder {
-
-    /**
-     * id
-     */
-    @Schema(description = "id")
-    @Id(keyType = KeyType.Generator, value = "SUID")
-    private String id;
-
-    /**
-     * 订单号
-     */
-    @Schema(description = "订单号")
-    @Column(value = "order_no")
-    private String orderNo;
-
-    /**
-     * 平台订单号
-     */
-    @Schema(description = "平台订单号")
-    @Column(value = "platform_order_no")
-    private String platformOrderNo;
-
-    /**
-     * 代理用户ID
-     */
-    @Schema(description = "代理用户ID")
-    @Column(value = "agent_id")
-    private String agentId;
-
-    /**
-     * 商户用户ID
-     */
-    @Schema(description = "商户用户ID")
-    @Column(value = "merchant_id")
-    private String merchantId;
-
-    /**
-     * 金额
-     */
-    @Schema(description = "金额")
-    @Column(value = "amount")
-    private BigDecimal amount;
-
-    /**
-     * 手续费
-     */
-    @Schema(description = "手续费")
-    @Column(value = "fee")
-    private BigDecimal fee;
-
-    /**
-     * 费率
-     */
-    @Schema(description = "费率")
-    @Column(value = "rate")
-    private BigDecimal rate;
-
-    /**
-     * -1:支付失败 0:待支付 1:支付成功 2:退款
-     */
-    @Schema(description = "-1:支付失败 0:待支付 1:支付成功 2:退款")
-    @Column(value = "status")
-    private Integer status;
-
-    /**
-     * 创建人
-     */
-    @Schema(description = "创建人")
-    @Column(value = "create_user")
-    private String createUser;
-
-    /**
-     * 创建时间
-     */
-    @Schema(description = "创建时间")
-    @Column(value = "create_time", onInsertValue = "now()")
-    private LocalDateTime createTime;
-
-    /**
-     * 修改人
-     */
-    @Schema(description = "修改人")
-    @Column(value = "update_user")
-    private String updateUser;
-
-    /**
-     * 修改时间
-     */
-    @Schema(description = "修改时间")
-    @Column(value = "update_time", onUpdateValue = "now()", onInsertValue = "now()")
-    private LocalDateTime updateTime;
-}

+ 0 - 17
db/db-agent/src/main/java/pay/platform/mapper/PayOrderMapper.java

@@ -1,17 +0,0 @@
-package pay.platform.mapper;
-
-import com.mybatisflex.core.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import pay.platform.domain.PayOrder;
-
-/**
- * 通道管理 映射层。
- *
- * @author mybatis-flex-helper automatic generation
- * @since 1.0
- */
-@Mapper
-public interface PayOrderMapper extends BaseMapper<PayOrder> {
-
-
-}

+ 2 - 0
db/db-merchant/src/main/java/pay/platform/domain/PayMerchant.java

@@ -33,6 +33,8 @@ public class PayMerchant {
     @Schema(description = "id")
     @Id(keyType = KeyType.Generator, value = "SUID")
     private String id;
+    @Column(value = "agent_id")
+    private String agentId;
 
     /**
      * 用户名

+ 102 - 0
db/db-merchant/src/main/java/pay/platform/domain/PayMerchantAppKey.java

@@ -0,0 +1,102 @@
+package pay.platform.domain;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.KeyType;
+import com.mybatisflex.annotation.Table;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+/**
+ * 商户扩展信息,提供外部应用 实体类。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Schema(name = "商户扩展信息,提供外部应用")
+@Table(value = "t_pay_merchant_app_key")
+public class PayMerchantAppKey {
+
+    /**
+     * id
+     */
+    @Schema(description = "id")
+    @Id(keyType = KeyType.Auto)
+    private String id;
+
+    @Column(value = "agent_id")
+    private String agentId;
+    /**
+     * 商户id
+     */
+    @Schema(description = "商户id")
+    @Column(value = "merchant_id")
+    private String merchantId;
+
+    /**
+     * app_id
+     */
+    @Schema(description = "app_id")
+    @Column(value = "app_id")
+    private String appId;
+
+    /**
+     * app_key
+     */
+    @Schema(description = "app_key")
+    @Column(value = "app_key")
+    private String appKey;
+
+    /**
+     * app_secret
+     */
+    @Schema(description = "app_secret")
+    @Column(value = "app_secret")
+    private String appSecret;
+
+    /**
+     * 状态
+     */
+    @Schema(description = "状态")
+    @Column(value = "status")
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    @Schema(description = "创建人")
+    @Column(value = "create_user")
+    private String createUser;
+
+    /**
+     * 创建时间
+     */
+    @Schema(description = "创建时间")
+    @Column(value = "create_time")
+    private Date createTime;
+
+    /**
+     * 修改人
+     */
+    @Schema(description = "修改人")
+    @Column(value = "update_user")
+    private String updateUser;
+
+    /**
+     * 修改时间
+     */
+    @Schema(description = "修改时间")
+    @Column(value = "update_time")
+    private Date updateTime;
+
+
+}

+ 0 - 0
db/db-agent/src/main/java/pay/platform/domain/PayMerchantStore.java → db/db-merchant/src/main/java/pay/platform/domain/PayMerchantStore.java


+ 3 - 3
db/db-agent/src/main/java/pay/platform/mapper/PayMerchantMapper.java → db/db-merchant/src/main/java/pay/platform/mapper/PayMerchantAppKeyMapper.java

@@ -2,16 +2,16 @@ package pay.platform.mapper;
 
 import com.mybatisflex.core.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
-import pay.platform.domain.PayMerchant;
+import pay.platform.domain.PayMerchantAppKey;
 
 /**
- * 商户管理 映射层。
+ * 商户扩展信息,提供外部应用 映射层。
  *
  * @author mybatis-flex-helper automatic generation
  * @since 1.0
  */
 @Mapper
-public interface PayMerchantMapper extends BaseMapper<PayMerchant> {
+public interface PayMerchantAppKeyMapper extends BaseMapper<PayMerchantAppKey> {
 
 
 }

+ 0 - 0
db/db-agent/src/main/java/pay/platform/mapper/PayMerchantStoreMapper.java → db/db-merchant/src/main/java/pay/platform/mapper/PayMerchantStoreMapper.java


+ 158 - 0
web/admin-api/src/main/java/pay/platform/api/system/controller/PayMerchantAppKeyController.java

@@ -0,0 +1,158 @@
+package pay.platform.api.system.controller;
+
+import com.mybatisflex.core.paginate.Page;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import pay.platform.api.system.servcie.PayMerchantAppKeyService;
+import pay.platform.domain.PayMerchantAppKey;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 商户扩展信息,提供外部应用 控制层。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@RestController
+@RequestMapping("/PayMerchantAppKey")
+@Tag(name = "商户扩展信息,提供外部应用控制层")
+public class PayMerchantAppKeyController {
+
+    @Autowired
+    private PayMerchantAppKeyService PayMerchantAppKeyService;
+
+    /**
+     * 添加 商户扩展信息,提供外部应用
+     *
+     * @param PayMerchantAppKey 商户扩展信息,提供外部应用
+     * @return {@code true} 添加成功,{@code false} 添加失败
+     */
+    @PostMapping("/save")
+    @Operation(summary = "添加商户扩展信息,提供外部应用")
+    @Parameters(value = {
+            @Parameter(name = "id", description = "id"),
+
+            @Parameter(name = "merchantId", description = "商户id"),
+
+            @Parameter(name = "appId", description = "app_id"),
+
+            @Parameter(name = "appKey", description = "app_key"),
+
+            @Parameter(name = "appSecret", description = "app_secret"),
+
+            @Parameter(name = "status", description = "状态"),
+
+            @Parameter(name = "createUser", description = "创建人"),
+
+            @Parameter(name = "createTime", description = "创建时间"),
+
+            @Parameter(name = "updateUser", description = "修改人"),
+
+            @Parameter(name = "updateTime", description = "修改时间")
+    })
+
+    public boolean save(@RequestBody PayMerchantAppKey PayMerchantAppKey) {
+        return PayMerchantAppKeyService.save(PayMerchantAppKey);
+    }
+
+
+    /**
+     * 根据主键删除商户扩展信息,提供外部应用
+     *
+     * @param id 主键
+     * @return {@code true} 删除成功,{@code false} 删除失败
+     */
+    @DeleteMapping("/remove/{id}")
+    @Operation(summary = "根据主键删除商户扩展信息,提供外部应用")
+    @Parameters(value = {
+            @Parameter(name = "id", description = "id", required = true)
+    })
+    public boolean remove(@PathVariable Serializable id) {
+        return PayMerchantAppKeyService.removeById(id);
+    }
+
+
+    /**
+     * 根据主键更新商户扩展信息,提供外部应用
+     *
+     * @param PayMerchantAppKey 商户扩展信息,提供外部应用
+     * @return {@code true} 更新成功,{@code false} 更新失败
+     */
+    @PutMapping("/update")
+    @Operation(summary = "根据主键更新商户扩展信息,提供外部应用")
+    @Parameters(value = {
+            @Parameter(name = "id", description = "id", required = true),
+
+            @Parameter(name = "merchantId", description = "商户id"),
+
+            @Parameter(name = "appId", description = "app_id"),
+
+            @Parameter(name = "appKey", description = "app_key"),
+
+            @Parameter(name = "appSecret", description = "app_secret"),
+
+            @Parameter(name = "status", description = "状态"),
+
+            @Parameter(name = "createUser", description = "创建人"),
+
+            @Parameter(name = "createTime", description = "创建时间"),
+
+            @Parameter(name = "updateUser", description = "修改人"),
+
+            @Parameter(name = "updateTime", description = "修改时间")
+    })
+    public boolean update(@RequestBody PayMerchantAppKey PayMerchantAppKey) {
+        return PayMerchantAppKeyService.updateById(PayMerchantAppKey);
+    }
+
+
+    /**
+     * 查询所有商户扩展信息,提供外部应用
+     *
+     * @return 所有数据
+     */
+    @GetMapping("/list")
+    @Operation(summary = "查询所有商户扩展信息,提供外部应用")
+    public List<PayMerchantAppKey> list() {
+        return PayMerchantAppKeyService.list();
+    }
+
+
+    /**
+     * 根据商户扩展信息,提供外部应用主键获取详细信息。
+     *
+     * @param id PayMerchantAppKey主键
+     * @return 商户扩展信息,提供外部应用详情
+     */
+    @GetMapping("/getInfo/{id}")
+    @Operation(summary = "根据商户扩展信息,提供外部应用主键获取详细信息")
+    @Parameters(value = {
+            @Parameter(name = "id", description = "id", required = true)
+    })
+    public PayMerchantAppKey getInfo(@PathVariable Serializable id) {
+        return PayMerchantAppKeyService.getById(id);
+    }
+
+
+    /**
+     * 分页查询商户扩展信息,提供外部应用
+     *
+     * @param page 分页对象
+     * @return 分页对象
+     */
+    @GetMapping("/page")
+    @Operation(summary = "分页查询商户扩展信息,提供外部应用")
+    @Parameters(value = {
+            @Parameter(name = "pageNumber", description = "页码", required = true),
+            @Parameter(name = "pageSize", description = "每页大小", required = true)
+    })
+    public Page<PayMerchantAppKey> page(Page<PayMerchantAppKey> page) {
+        return PayMerchantAppKeyService.page(page);
+    }
+}

+ 15 - 0
web/admin-api/src/main/java/pay/platform/api/system/servcie/PayMerchantAppKeyService.java

@@ -0,0 +1,15 @@
+package pay.platform.api.system.servcie;
+
+
+import com.mybatisflex.core.service.IService;
+import pay.platform.domain.PayMerchantAppKey;
+
+/**
+ * 商户扩展信息,提供外部应用 服务层。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+public interface PayMerchantAppKeyService extends IService<PayMerchantAppKey> {
+
+}

+ 19 - 0
web/admin-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantAppKeyServiceImpl.java

@@ -0,0 +1,19 @@
+package pay.platform.api.system.servcie.impl;
+
+
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import pay.platform.api.system.servcie.PayMerchantAppKeyService;
+import pay.platform.domain.PayMerchantAppKey;
+import pay.platform.mapper.PayMerchantAppKeyMapper;
+
+/**
+ * 商户扩展信息,提供外部应用 服务层实现。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@Service
+public class PayMerchantAppKeyServiceImpl extends ServiceImpl<PayMerchantAppKeyMapper, PayMerchantAppKey> implements PayMerchantAppKeyService {
+
+}

+ 8 - 0
web/admin-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantServiceImpl.java

@@ -5,10 +5,12 @@ import cn.hutool.core.util.RandomUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import pay.platform.api.system.servcie.PayMerchantAppKeyService;
 import pay.platform.api.system.servcie.PayMerchantService;
 import pay.platform.api.system.servcie.PayMerchantStoreService;
 import pay.platform.core.common.domain.BaseService;
 import pay.platform.domain.PayMerchant;
+import pay.platform.domain.PayMerchantAppKey;
 import pay.platform.domain.PayMerchantStore;
 import pay.platform.mapper.PayMerchantMapper;
 
@@ -25,6 +27,8 @@ import java.util.List;
 public class PayMerchantServiceImpl extends BaseService<PayMerchantMapper, PayMerchant> implements PayMerchantService {
     @Autowired
     private PayMerchantStoreService payMerchantStoreService;
+    @Autowired
+    private PayMerchantAppKeyService payMerchantAppKeyService;
 
     @Override
     @Transactional
@@ -40,6 +44,10 @@ public class PayMerchantServiceImpl extends BaseService<PayMerchantMapper, PayMe
 
         }
         payMerchantStoreService.saveBatch(storeList);
+        PayMerchantAppKey payMerchantAppKey = PayMerchantAppKey.builder().appId(RandomUtil.randomString(18)).appSecret(RandomUtil.randomString(32))
+                .appKey(RandomUtil.randomString(12))
+                .merchantId(payMerchant.getId()).build();
+        payMerchantAppKeyService.save(payMerchantAppKey);
         return true;
     }
 }

+ 15 - 0
web/agent-api/src/main/java/pay/platform/api/system/servcie/PayMerchantAppKeyService.java

@@ -0,0 +1,15 @@
+package pay.platform.api.system.servcie;
+
+
+import com.mybatisflex.core.service.IService;
+import pay.platform.domain.PayMerchantAppKey;
+
+/**
+ * 商户扩展信息,提供外部应用 服务层。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+public interface PayMerchantAppKeyService extends IService<PayMerchantAppKey> {
+
+}

+ 19 - 0
web/agent-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantAppKeyServiceImpl.java

@@ -0,0 +1,19 @@
+package pay.platform.api.system.servcie.impl;
+
+
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import pay.platform.api.system.servcie.PayMerchantAppKeyService;
+import pay.platform.domain.PayMerchantAppKey;
+import pay.platform.mapper.PayMerchantAppKeyMapper;
+
+/**
+ * 商户扩展信息,提供外部应用 服务层实现。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@Service
+public class PayMerchantAppKeyServiceImpl extends ServiceImpl<PayMerchantAppKeyMapper, PayMerchantAppKey> implements PayMerchantAppKeyService {
+
+}

+ 10 - 1
web/agent-api/src/main/java/pay/platform/api/system/servcie/impl/PayMerchantServiceImpl.java

@@ -5,11 +5,13 @@ import cn.hutool.core.util.RandomUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import pay.platform.api.system.servcie.PayMerchantAppKeyService;
 import pay.platform.api.system.servcie.PayMerchantService;
 import pay.platform.api.system.servcie.PayMerchantStoreService;
 import pay.platform.core.common.domain.BaseService;
 import pay.platform.core.security.util.SecurityUtil;
 import pay.platform.domain.PayMerchant;
+import pay.platform.domain.PayMerchantAppKey;
 import pay.platform.domain.PayMerchantStore;
 import pay.platform.mapper.PayMerchantMapper;
 
@@ -26,6 +28,8 @@ import java.util.List;
 public class PayMerchantServiceImpl extends BaseService<PayMerchantMapper, PayMerchant> implements PayMerchantService {
     @Autowired
     private PayMerchantStoreService payMerchantStoreService;
+    @Autowired
+    private PayMerchantAppKeyService payMerchantAppKeyService;
 
     @Override
     @Transactional
@@ -33,7 +37,7 @@ public class PayMerchantServiceImpl extends BaseService<PayMerchantMapper, PayMe
         payMerchant.setAgentId(SecurityUtil.getCurrentUser().getUserid());
         save(payMerchant);
         List<PayMerchantStore> storeList = new ArrayList<>();
-        for (int i = 0; i < 7; i++) {
+        for (int i = 0; i < 10; i++) {
             PayMerchantStore payMerchantStore = new PayMerchantStore();
             payMerchantStore.setAgentId(SecurityUtil.getCurrentUser().getUserid());
             payMerchantStore.setMerchantId(payMerchant.getId());
@@ -43,6 +47,11 @@ public class PayMerchantServiceImpl extends BaseService<PayMerchantMapper, PayMe
 
         }
         payMerchantStoreService.saveBatch(storeList);
+
+        PayMerchantAppKey payMerchantAppKey = PayMerchantAppKey.builder().appId(RandomUtil.randomString(18)).appSecret(RandomUtil.randomString(32))
+                .appKey(RandomUtil.randomString(12)).agentId(SecurityUtil.getCurrentUser().getUserid())
+                .merchantId(payMerchant.getId()).build();
+        payMerchantAppKeyService.save(payMerchantAppKey);
         return true;
     }
 }

+ 1 - 1
web/merchant-api/src/main/java/pay/platform/core/security/service/UserDetailServiceImpl.java

@@ -41,7 +41,7 @@ public class UserDetailServiceImpl implements UserDetailsService {
 //        info.setPassword(PasswordUtil.encoder("123456"));
 //        info.setUsername("admin");
 //        info.setRoles(Arrays.asList("ROLE_ADMIN"));
-//        info.setPermissions(Arrays.asList("test::query", "test:add"));
+//        info.setPermissions(Arrays.asList("test::q uery", "test:add"));
 //        info.setIsEnabled(1);
         // 正式
         Optional<PayMerchant> userOptional = sysUserService.loadUserByUsername(username);

+ 10 - 0
web/open-api/pom.xml

@@ -91,6 +91,16 @@
             <artifactId>db-system</artifactId>
             <version>1.0.0-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>pay.platform</groupId>
+            <artifactId>db-merchant</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>pay.platform</groupId>
+            <artifactId>db-agent</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 14 - 2
web/open-api/src/main/java/pay/platform/api/controller/PayController.java

@@ -2,8 +2,14 @@ package pay.platform.api.controller;
 
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+import pay.platform.api.model.request.PayRequest;
+import pay.platform.api.servcie.PayMerchantService;
+import pay.platform.domain.PayMerchant;
 
 /**
  * 接口 - 支付
@@ -14,9 +20,15 @@ import org.springframework.web.bind.annotation.RestController;
 @RequiredArgsConstructor
 public class PayController {
 
-    @RequestMapping("/pay/alipay")
-    public void pay() {
+    @Autowired
+    private PayMerchantService payMerchantService;
 
+    @PostMapping("/pay/alipay")
+    public void pay(@RequestBody PayRequest payRequest) {
+        PayMerchant payMerchant = payMerchantService.getById(payRequest.getMerchantId());
+        if (payMerchant == null) {
+            throw new RuntimeException("商户号不存在");
+        }
     }
 
 }

+ 10 - 1
web/open-api/src/main/java/pay/platform/api/model/request/PayRequest.java

@@ -1,5 +1,6 @@
 package pay.platform.api.model.request;
 
+import jakarta.validation.constraints.NotBlank;
 import lombok.Data;
 
 import java.io.Serial;
@@ -14,8 +15,16 @@ public class PayRequest implements Serializable {
 
     @Serial
     private static final long serialVersionUID = 1L;
+    @NotBlank(message = "订单号不能为空")
 
     private String orderNo;
-
+    @NotBlank(message = "金额不能为空")
     private String amount;
+    // 商品名称
+    String subject;
+    // 商品描述
+    String body;
+    // 金额
+    @NotBlank(message = "商户号不能为空")
+    String merchantId;
 }

+ 15 - 0
web/open-api/src/main/java/pay/platform/api/servcie/PayMerchantAppKeyService.java

@@ -0,0 +1,15 @@
+package pay.platform.api.servcie;
+
+
+import com.mybatisflex.core.service.IService;
+import pay.platform.domain.PayMerchantAppKey;
+
+/**
+ * 商户扩展信息,提供外部应用 服务层。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+public interface PayMerchantAppKeyService extends IService<PayMerchantAppKey> {
+
+}

+ 16 - 0
web/open-api/src/main/java/pay/platform/api/servcie/PayMerchantService.java

@@ -0,0 +1,16 @@
+package pay.platform.api.servcie;
+
+
+import com.mybatisflex.core.service.IService;
+import pay.platform.domain.PayMerchant;
+
+/**
+ * 商户管理 服务层。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+public interface PayMerchantService extends IService<PayMerchant> {
+
+
+}

+ 15 - 0
web/open-api/src/main/java/pay/platform/api/servcie/PayMerchantStoreService.java

@@ -0,0 +1,15 @@
+package pay.platform.api.servcie;
+
+
+import com.mybatisflex.core.service.IService;
+import pay.platform.domain.PayMerchantStore;
+
+/**
+ * 商户关联支付宝店铺 服务层。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+public interface PayMerchantStoreService extends IService<PayMerchantStore> {
+
+}

+ 15 - 0
web/open-api/src/main/java/pay/platform/api/servcie/PayOrderService.java

@@ -0,0 +1,15 @@
+package pay.platform.api.servcie;
+
+
+import com.mybatisflex.core.service.IService;
+import pay.platform.domain.PayOrder;
+
+/**
+ * 通道管理 服务层。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+public interface PayOrderService extends IService<PayOrder> {
+
+}

+ 19 - 0
web/open-api/src/main/java/pay/platform/api/servcie/impl/PayMerchantAppKeyServiceImpl.java

@@ -0,0 +1,19 @@
+package pay.platform.api.servcie.impl;
+
+
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import pay.platform.api.servcie.PayMerchantAppKeyService;
+import pay.platform.domain.PayMerchantAppKey;
+import pay.platform.mapper.PayMerchantAppKeyMapper;
+
+/**
+ * 商户扩展信息,提供外部应用 服务层实现。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@Service
+public class PayMerchantAppKeyServiceImpl extends ServiceImpl<PayMerchantAppKeyMapper, PayMerchantAppKey> implements PayMerchantAppKeyService {
+
+}

+ 19 - 0
web/open-api/src/main/java/pay/platform/api/servcie/impl/PayMerchantServiceImpl.java

@@ -0,0 +1,19 @@
+package pay.platform.api.servcie.impl;
+
+
+import org.springframework.stereotype.Service;
+import pay.platform.api.servcie.PayMerchantService;
+import pay.platform.core.common.domain.BaseService;
+import pay.platform.domain.PayMerchant;
+import pay.platform.mapper.PayMerchantMapper;
+
+/**
+ * 商户管理 服务层实现。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@Service
+public class PayMerchantServiceImpl extends BaseService<PayMerchantMapper, PayMerchant> implements PayMerchantService {
+
+}

+ 19 - 0
web/open-api/src/main/java/pay/platform/api/servcie/impl/PayMerchantStoreServiceImpl.java

@@ -0,0 +1,19 @@
+package pay.platform.api.servcie.impl;
+
+
+import com.mybatisflex.spring.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import pay.platform.api.servcie.PayMerchantStoreService;
+import pay.platform.domain.PayMerchantStore;
+import pay.platform.mapper.PayMerchantStoreMapper;
+
+/**
+ * 商户关联支付宝店铺 服务层实现。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@Service
+public class PayMerchantStoreServiceImpl extends ServiceImpl<PayMerchantStoreMapper, PayMerchantStore> implements PayMerchantStoreService {
+
+}

+ 19 - 0
web/open-api/src/main/java/pay/platform/api/servcie/impl/PayOrderServiceImpl.java

@@ -0,0 +1,19 @@
+package pay.platform.api.servcie.impl;
+
+
+import org.springframework.stereotype.Service;
+import pay.platform.api.servcie.PayOrderService;
+import pay.platform.core.common.domain.BaseService;
+import pay.platform.domain.PayOrder;
+import pay.platform.mapper.PayOrderMapper;
+
+/**
+ * 通道管理 服务层实现。
+ *
+ * @author mybatis-flex-helper automatic generation
+ * @since 1.0
+ */
+@Service
+public class PayOrderServiceImpl extends BaseService<PayOrderMapper, PayOrder> implements PayOrderService {
+
+}