igl hace 3 meses
padre
commit
c29ae96898

+ 3 - 1
src/main/java/com/chelvc/cloud/maintain/controller/AssetController.java

@@ -6,7 +6,7 @@ import com.chelvc.cloud.vehicle.client.param.TransferNotifyParam;
 import com.chelvc.cloud.vehicle.client.param.WithdrawNotifyParam;
 import com.chelvc.cloud.vehicle.client.param.WithdrawParam;
 import com.chelvc.framework.base.annotation.ResponseWrapping;
-import com.chelvc.framework.base.context.SessionContextHolder;
+import com.chelvc.framework.security.annotation.Authorize;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,6 +52,7 @@ public class AssetController {
      *
      */
     @PostMapping("/asset/withdraw/notify")
+    @Authorize(enabled = false)
     public void withdrawNotify(@RequestBody WithdrawNotifyParam param) {
         this.assetClient.withdrawNotify(param);
     }
@@ -61,6 +62,7 @@ public class AssetController {
      *
      */
     @PostMapping("/asset/transfer/notify")
+    @Authorize(enabled = false)
     public void transferNotify(@RequestBody TransferNotifyParam param) {
         this.assetClient.transferNotify(param);
     }

+ 9 - 1
src/main/java/com/chelvc/cloud/maintain/controller/MerchantController.java

@@ -1,6 +1,7 @@
 package com.chelvc.cloud.maintain.controller;
 
 import java.util.List;
+import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotEmpty;
@@ -20,6 +21,7 @@ import com.chelvc.cloud.vehicle.client.param.*;
 import com.chelvc.framework.base.annotation.ResponseWrapping;
 import com.chelvc.framework.base.context.SessionContextHolder;
 import com.chelvc.framework.common.model.Pagination;
+import com.chelvc.framework.security.annotation.Authorize;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -172,7 +174,13 @@ public class MerchantController {
      *
      */
     @PostMapping("/merchant/apply/notify")
-    public void merchantApplyNotify(@RequestBody MerchantApplyRecordParam param) {
+    @Authorize(enabled = false)
+    public void merchantApplyNotify(HttpServletRequest request,
+           @RequestBody MerchantApplyRecordParam param) {
+        String merchantId = request.getHeader("merchantId");
+        String encryptKey = request.getHeader("encryptKey");
+        param.setMerchantId(merchantId);
+        param.setEncryptKey(encryptKey);
         this.merchantClient.merchantApplyNotify(param);
     }
 }

+ 0 - 1
src/main/java/com/chelvc/cloud/maintain/controller/OmsOrderController.java

@@ -40,7 +40,6 @@ import java.util.Objects;
 public class OmsOrderController {
     private final OmsOrderClient omsOrderClient;
     private final OmsOrderReturnApplyClient omsOrderReturnApplyClient;
-
     private final WechatPaymentHandler wechatPaymentHandler;
 
 

+ 40 - 0
src/main/java/com/chelvc/cloud/maintain/controller/UserAuthController.java

@@ -0,0 +1,40 @@
+package com.chelvc.cloud.maintain.controller;
+
+import com.chelvc.cloud.vehicle.client.UserAuthClient;
+import com.chelvc.cloud.vehicle.client.dto.UserAuthDTO;
+import com.chelvc.cloud.vehicle.client.param.UserAuthParam;
+import com.chelvc.framework.base.annotation.ResponseWrapping;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 推广人员认证
+ */
+@Validated
+@RestController
+@ResponseWrapping
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+public class UserAuthController {
+    private final UserAuthClient userAuthClient;
+
+    /**
+     * 获取认证信息
+     * @param userId
+     * @return
+     */
+    @GetMapping("/user/auth")
+    UserAuthDTO getUserAuthInfo(@RequestParam("userId") Long userId){
+        return this.userAuthClient.getUserAuthInfo(userId);
+    }
+
+    /**
+     * 申请认证
+     * @param param
+     */
+    @PutMapping(value = "/user/auth")
+    void userAuth(@RequestBody UserAuthParam param){
+        this.userAuthClient.userAuth(param);
+    }
+}

+ 5 - 1
src/main/resources/application-dev.yml

@@ -16,6 +16,10 @@ security:
   oauth:
     scoped: true
     secret: oauth.token.secret@chelvc!@#2023
+  ignores:
+    - /maintain/merchant/apply/notify #商户入驻回调
+    - /maintain/asset/withdraw/notify #提现回调
+    - /maintain/asset/transfer/notify #转账回调
 
 upload:
   directory: /home/chelvc/static
@@ -33,4 +37,4 @@ sms:
       secret: xs6OZj6pyJLTcNBDjp6ikftVyKRXsk
       template: SMS_274640619
       signature: 车旅程
-      channel: ALIYUN
+      channel: ALIYUN

+ 5 - 1
src/main/resources/application-pre.yml

@@ -16,6 +16,10 @@ security:
   oauth:
     scoped: true
     secret: oauth.token.secret@chelvc!@#2023
+  ignores:
+    - /maintain/merchant/apply/notify #商户入驻回调
+    - /maintain/asset/withdraw/notify #提现回调
+    - /maintain/asset/transfer/notify #转账回调
 
 upload:
   directory: /home/chelvc/static
@@ -33,4 +37,4 @@ sms:
       secret: xs6OZj6pyJLTcNBDjp6ikftVyKRXsk
       template: SMS_274640619
       signature: 车旅程
-      channel: ALIYUN
+      channel: ALIYUN

+ 5 - 1
src/main/resources/application-prod.yml

@@ -16,6 +16,10 @@ security:
   oauth:
     scoped: true
     secret: oauth.token.secret@chelvc!@#2023
+  ignores:
+    - /maintain/merchant/apply/notify #商户入驻回调
+    - /maintain/asset/withdraw/notify #提现回调
+    - /maintain/asset/transfer/notify #转账回调
 
 upload:
   directory: /home/chelvc/static
@@ -33,4 +37,4 @@ sms:
       secret: xs6OZj6pyJLTcNBDjp6ikftVyKRXsk
       template: SMS_274640619
       signature: 车旅程
-      channel: ALIYUN
+      channel: ALIYUN

+ 5 - 1
src/main/resources/application-test.yml

@@ -16,6 +16,10 @@ security:
   oauth:
     scoped: true
     secret: oauth.token.secret@chelvc!@#2023
+  ignores:
+    - /maintain/merchant/apply/notify #商户入驻回调
+    - /maintain/asset/withdraw/notify #提现回调
+    - /maintain/asset/transfer/notify #转账回调
 
 upload:
   directory: /home/chelvc/static
@@ -33,4 +37,4 @@ sms:
       secret: xs6OZj6pyJLTcNBDjp6ikftVyKRXsk
       template: SMS_274640619
       signature: 车旅程
-      channel: ALIYUN
+      channel: ALIYUN