|
@@ -0,0 +1,38 @@
|
|
1
|
+package com.community.huiju.controller;
|
|
2
|
+
|
|
3
|
+import com.community.commom.mode.ResponseBean;
|
|
4
|
+import com.community.huiju.common.perproties.LoginCodePerproties;
|
|
5
|
+import com.google.common.collect.Maps;
|
|
6
|
+import io.swagger.annotations.Api;
|
|
7
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
8
|
+import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
9
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
10
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
11
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
12
|
+import org.springframework.web.bind.annotation.RestController;
|
|
13
|
+
|
|
14
|
+import java.util.Map;
|
|
15
|
+
|
|
16
|
+/**
|
|
17
|
+ * @author weiximei
|
|
18
|
+ */
|
|
19
|
+@RestController
|
|
20
|
+@RefreshScope
|
|
21
|
+@RequestMapping("/")
|
|
22
|
+@Api(value = "根据code获取url API", description = "根据code获取url API")
|
|
23
|
+public class LoginCodeController {
|
|
24
|
+
|
|
25
|
+ @Autowired
|
|
26
|
+ private LoginCodePerproties loginCodePerproties;
|
|
27
|
+
|
|
28
|
+ @RequestMapping(value = "/url", method = RequestMethod.GET)
|
|
29
|
+ public ResponseBean getUrl(@RequestParam String code) {
|
|
30
|
+ ResponseBean responseBean = new ResponseBean();
|
|
31
|
+ String url = loginCodePerproties.getLoginCode().get(code);
|
|
32
|
+ Map<String, String> map = Maps.newHashMap();
|
|
33
|
+ map.put("url", url);
|
|
34
|
+ responseBean.addSuccess(map);
|
|
35
|
+ return responseBean;
|
|
36
|
+ }
|
|
37
|
+
|
|
38
|
+}
|