|
@@ -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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|