Эх сурвалжийг харах

拉单接口获取亚马逊

cxd 8 сар өмнө
parent
commit
01db072972

+ 37 - 0
raycos_datacenter_api/src/main/java/com/raycos/raycosdatacenterapi/authorize/AuthcodeController.java

@@ -0,0 +1,37 @@
+package com.raycos.raycosdatacenterapi.authorize;
+
+
+import com.raycos.raycosdatacenterapi.config.RaycosUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Map;
+
+@RestController
+@Slf4j
+@RequestMapping("/erp/amz")
+@CrossOrigin
+public class AuthcodeController {
+
+    @Autowired
+    private  AmzTokenService amzTokenService;
+
+    /**
+     *
+     * @param request
+     */
+    @GetMapping(value = "/authcode")
+    public void authcode(HttpServletRequest request){
+        Map resultMap = RaycosUtils.getParameterMap(request);
+        try {
+            amzTokenService.saveAmzToken(resultMap);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+}