|
@@ -0,0 +1,32 @@
|
|
|
|
+package com.sxtvs.open.api.odata;
|
|
|
|
+
|
|
|
|
+import com.sxtvs.open.core.auth.LoginRequired;
|
|
|
|
+import com.sxtvs.open.core.sls.AliyunLogger;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+
|
|
|
|
+@Controller
|
|
|
|
+@RequestMapping("oauth")
|
|
|
|
+public class OauthController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private AliyunLogger logger;
|
|
|
|
+
|
|
|
|
+ @RequestMapping("douyin/code")
|
|
|
|
+ @LoginRequired
|
|
|
|
+ public String douyinQrCode() {
|
|
|
|
+ logger.info("key", "douyinQrCode");
|
|
|
|
+ return "redirect:https://open.douyin.com/platform/oauth/connect/?" +
|
|
|
|
+ "client_key=awfrca76s1petwh0&response_type=code&" +
|
|
|
|
+ "scope=video.data%2Cfans.list%2Cdata.external.item%2Cdata.external.user%2Cfans.data%2Cvideo.list%2Crenew_refresh_token%2Cuser_info&" +
|
|
|
|
+ "redirect_uri=http%3A%2F%2Fopen.smcic.net%2Fdouyin%2Fcallback";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @RequestMapping("douyin/callback")
|
|
|
|
+ public String douyinCallback(String code) {
|
|
|
|
+ logger.info("key", "douyinCallback", "code", code);
|
|
|
|
+ return "redirect:https://www.baidu.com";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|