Browse Source

Merge branch 'master' of http://10.100.5.99/jituan/tourist

# Conflicts:
#	src/main/java/com/yingying/tourist/request/SessionFilter.java
zjm 5 years ago
parent
commit
b51aa0bca7

+ 66 - 49
src/main/java/com/yingying/tourist/business/BusinessConstant.java

@@ -1,49 +1,66 @@
1
-package com.yingying.tourist.business;
2
-
3
-import java.util.HashMap;
4
-import java.util.Map;
5
-import java.util.ResourceBundle;
6
-
7
-public class BusinessConstant {
8
-
9
-    public enum Identity{
10
-        A("A","自然的崇拜者"), B("B","洒脱的冒险家"), C("C","文化的朝圣者"),D("D","心灵的按摩师");
11
-
12
-        Identity(String key,String value){
13
-            this.key = key;
14
-            this.value = value;
15
-        }
16
-        public String key;
17
-        public String value;
18
-
19
-        public static String getValue(String key) {
20
-            if (key==null) return null;
21
-            for (Identity d : Identity.values()){
22
-                if (key.equals(d.key)) {
23
-                    return d.value;
24
-                }
25
-            }
26
-            return key;
27
-        }
28
-    }
29
-
30
-    public static Map<Integer, String> describeMap = new HashMap<>(16,1);
31
-    static {
32
-        describeMap.put(1,"在山西挖煤挖到300000斤");
33
-        describeMap.put(2,"做环卫工打扫400个公厕坑位");
34
-        describeMap.put(3,"去动物园完成200次小脑斧近身喂食");
35
-        describeMap.put(4,"埋伏在巷子口专业碰瓷150次");
36
-        describeMap.put(5,"出演神剧龙套装死1800次");
37
-        describeMap.put(6,"在鬼屋扮鬼被人毒打900次");
38
-        describeMap.put(7,"在路边卖掉12000张煎饼果子");
39
-        describeMap.put(8,"帮狗粮工厂试吃1111罐狗粮");
40
-        describeMap.put(9,"在澡堂搭毛巾帮人搓澡1700次");
41
-        describeMap.put(10,"骑三轮车拉完800个胖太太客人");
42
-        describeMap.put(11,"沿街收破烂走过600条街");
43
-        describeMap.put(12,"劝退300位斯巴达广场舞大妈");
44
-        describeMap.put(13,"猫在后厨边哭边刷30000个盘子");
45
-        describeMap.put(14,"去民政局门口卖唱500首分手快乐");
46
-        describeMap.put(15,"去黑帮老大家催收到200万欠款");
47
-        describeMap.put(16,"下乡给4000头公猪做绝育手术");
48
-    }
49
-}
1
+package com.yingying.tourist.business;
2
+
3
+import java.util.HashMap;
4
+import java.util.Map;
5
+import java.util.ResourceBundle;
6
+
7
+public class BusinessConstant {
8
+
9
+    public enum Identity{
10
+        A("A","自然的崇拜者"), B("B","洒脱的冒险家"), C("C","文化的朝圣者"),D("D","心灵的按摩师");
11
+
12
+        Identity(String key,String value){
13
+            this.key = key;
14
+            this.value = value;
15
+        }
16
+        public String key;
17
+        public String value;
18
+
19
+        public static String getValue(String key) {
20
+            if (key==null) return null;
21
+            for (Identity d : Identity.values()){
22
+                if (key.equals(d.key)) {
23
+                    return d.value;
24
+                }
25
+            }
26
+            return key;
27
+        }
28
+    }
29
+
30
+    public static Map<Integer, String> describeMap = new HashMap<>(16,1);
31
+    public static Map<Integer, String> destinationMap = new HashMap<>(16,1);
32
+    static {
33
+        describeMap.put(1,"在山西挖煤挖到300000斤");
34
+        describeMap.put(2,"做环卫工打扫400个公厕坑位");
35
+        describeMap.put(3,"去动物园完成200次小脑斧近身喂食");
36
+        describeMap.put(4,"埋伏在巷子口专业碰瓷150次");
37
+        describeMap.put(5,"出演神剧龙套装死1800次");
38
+        describeMap.put(6,"在鬼屋扮鬼被人毒打900次");
39
+        describeMap.put(7,"在路边卖掉12000张煎饼果子");
40
+        describeMap.put(8,"帮狗粮工厂试吃1111罐狗粮");
41
+        describeMap.put(9,"在澡堂搭毛巾帮人搓澡1700次");
42
+        describeMap.put(10,"骑三轮车拉完800个胖太太客人");
43
+        describeMap.put(11,"沿街收破烂走过600条街");
44
+        describeMap.put(12,"劝退300位斯巴达广场舞大妈");
45
+        describeMap.put(13,"猫在后厨边哭边刷30000个盘子");
46
+        describeMap.put(14,"去民政局门口卖唱500首分手快乐");
47
+        describeMap.put(15,"去黑帮老大家催收到200万欠款");
48
+        describeMap.put(16,"下乡给4000头公猪做绝育手术");
49
+        destinationMap.put(1,"随着脚蹼滑动我开始下潜,世界越来越静谧,一个庞大的珊瑚王国占据眼前所有视线,色彩斑斓的珊瑚宝宝们正在开演盛大的舞台剧。");
50
+        destinationMap.put(2,"我站在自由女神像前,摆出了一样的姿势拍照纪念,这座见证了美国历史的雕像,在自由、民主的口号下高举火炬照亮了最深沉的夜。");
51
+        destinationMap.put(3,"我迈步走近了佛塔,双手合十虔诚祈祷,心灵的一切杂念此刻都先放下,耳边只剩下风的私语和寺庙的诵经声,这是心灵的修行。");
52
+        destinationMap.put(4,"我被告知获得了超能力,可以瞬移到世界上任何一个景点旅行,于是兴致勃勃地打包了行李拿上了相机,然后,梦醒了。");
53
+        destinationMap.put(5,"我从新西兰皇后镇15000英尺的飞机上纵身跃下,云朵在身边穿行,身体在空中舒展,大地变换了新奇的角度,这就是高空速降。");
54
+        destinationMap.put(6,"我喘着气爬到了长白山腰处,回首望去,身后是苍茫的林海,远处的天池波光粼粼,山顶层层云雾缭绕,敢问山中可有仙人修炼长生。");
55
+        destinationMap.put(7,"我席地盘坐在蒙古大草原的篝火边,饮下一口马奶酒,在主人悠扬的马头琴声中悠悠哼着草原小调,草原的夜空繁星无际,雄伟辽阔。");
56
+        destinationMap.put(8,"我坐在小酒馆的窗边,拿起酒杯小酌一口,窗外街上的游人行色匆匆,手指轻敲桌面打着节奏,轻声慢和一首回忆纯真的童谣。");
57
+        destinationMap.put(9,"我站在北极的冰原上仰头望向夜空,极光在天边摇曳,仿佛火狐狸经过时,尾巴扫过白雪而激起的花火,代表了幸运和希望。");
58
+        destinationMap.put(10,"大不列颠的夕阳将大本钟染成金黄色,我站在钟楼下,看着远处广场上飞起的鸽子,耳边响起英伦古典建筑上空浑厚的钟声。");
59
+        destinationMap.put(11,"我斜躺在近海的水屋里,环顾四周皆是湛蓝的大海,打开窗,海浪的声音温柔地抚摸着耳膜,千奇百怪的热带鱼在身下梭巡起舞。");
60
+        destinationMap.put(12,"我踩着轻快的步子下楼散步,期间共被广场舞大妈挡道7次,被业主的狗狂追10次,被小区的熊孩子撞飞8次,最后狼狈不堪逃回家。");
61
+        destinationMap.put(13,"我艰难地踩着雪崖攀上了最后一米,立足在珠峰之巅,风雪仍在咆哮,缺氧让人窒息,但是征服生命禁区后的心灵感觉自由无比。");
62
+        destinationMap.put(14,"我把遮沙的面罩重新带好,抬头望向面前的胡夫金字塔,斑驳的石砖满是风沙的痕迹,狮身人面像在旁沉默守护着最古老的文明荣光。");
63
+        destinationMap.put(15,"我乘坐探险者一号飞船顺利着陆,跨出舱的第一步激起了飘扬的火星尘,这是整个太阳系最高的山脉,能看到远处蓝宝石般的地球。");
64
+        destinationMap.put(16,"我头上搭着白毛巾,泡在樱花树下的露天温泉中,水面热气蒸腾,远处富士山顶白雪皑皑,空中樱花瓣打着旋缓缓飘落在水面上。");
65
+    }
66
+}

+ 0 - 13
src/main/java/com/yingying/tourist/business/BusinessYml.java

@@ -1,13 +0,0 @@
1
-package com.yingying.tourist.business;
2
-
3
-import org.springframework.beans.factory.annotation.Value;
4
-import org.springframework.stereotype.Component;
5
-
6
-@Component
7
-public class BusinessYml {
8
-    @Value("${session.domain}")private String COOKIEDOMAIN;
9
-
10
-    public String getCookieDomain() {
11
-        return COOKIEDOMAIN;
12
-    }
13
-}

+ 7 - 0
src/main/java/com/yingying/tourist/common/WeChatConstants.java

@@ -0,0 +1,7 @@
1
+package com.yingying.tourist.common;
2
+
3
+public class WeChatConstants {
4
+	
5
+	public static String WECHAT_REDIRECT_URI = "http://wx.yingyinglicai.com/index";
6
+
7
+}

+ 13 - 12
src/main/java/com/yingying/tourist/domain/Question.java

@@ -1,12 +1,13 @@
1
-package com.yingying.tourist.domain;
2
-
3
-import lombok.Data;
4
-
5
-@Data
6
-public class Question {
7
-    private Integer id;
8
-    private String questionPath;
9
-    private String resultDestination;
10
-    private String resultOutter;
11
-    private String resultInner;
12
-}
1
+package com.yingying.tourist.domain;
2
+
3
+import lombok.Data;
4
+
5
+@Data
6
+public class Question {
7
+    private Integer id;
8
+    private String questionPath;
9
+    private Integer resultOrder;
10
+    private String resultDestination;
11
+    private String resultOutter;
12
+    private String resultInner;
13
+}

+ 69 - 0
src/main/java/com/yingying/tourist/interceptor/WeChatInterceptor.java

@@ -0,0 +1,69 @@
1
+package com.yingying.tourist.interceptor;
2
+
3
+import java.net.URLEncoder;
4
+
5
+import javax.servlet.http.HttpServletRequest;
6
+import javax.servlet.http.HttpServletResponse;
7
+
8
+import org.springframework.beans.factory.annotation.Value;
9
+import org.springframework.stereotype.Component;
10
+import org.springframework.web.servlet.HandlerInterceptor;
11
+import org.springframework.web.servlet.ModelAndView;
12
+
13
+import com.alibaba.fastjson.JSONObject;
14
+import com.yingying.tourist.common.WeChatConstants;
15
+
16
+@Component
17
+public class WeChatInterceptor implements HandlerInterceptor {
18
+
19
+	@Value("${weixin.appid}")
20
+	private String appid;
21
+	@Value("${weixin.authorization}")
22
+	private Boolean authorization;
23
+
24
+	@Override
25
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
26
+			throws Exception {
27
+		String result = "";
28
+		
29
+		System.out.println(result);
30
+		
31
+		// 判断是否需要微信授权
32
+		if (authorization) {
33
+			// 判断是否来自微信浏览器
34
+			String ua = ((HttpServletRequest) request).getHeader("user-agent").toLowerCase();
35
+			if (ua.contains("micromessenger")) {
36
+				String redirectUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid
37
+						+ "&redirect_uri=" + URLEncoder.encode(WeChatConstants.WECHAT_REDIRECT_URI, "utf-8")
38
+						+ "&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect";
39
+				JSONObject redirectJson = new JSONObject();
40
+				redirectJson.put("redirectUrl", redirectUrl);
41
+				response.setContentType("application/json");
42
+				response.getWriter().write(redirectJson.toString());
43
+				response.getWriter().flush();
44
+				return false;
45
+			} else {
46
+				// 非微信浏览器
47
+				return true;
48
+			}
49
+		} else {
50
+			return true;
51
+		}
52
+
53
+	}
54
+
55
+	@Override
56
+	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
57
+			ModelAndView modelAndView) throws Exception {
58
+		// TODO Auto-generated method stub
59
+
60
+	}
61
+
62
+	@Override
63
+	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
64
+			throws Exception {
65
+		// TODO Auto-generated method stub
66
+
67
+	}
68
+
69
+}

+ 76 - 86
src/main/java/com/yingying/tourist/request/SessionFilter.java

@@ -1,87 +1,77 @@
1
-package com.yingying.tourist.request;
2
-
3
-import java.io.IOException;
4
-import java.util.UUID;
5
-
6
-import javax.annotation.Resource;
7
-import javax.servlet.Filter;
8
-import javax.servlet.FilterChain;
9
-import javax.servlet.FilterConfig;
10
-import javax.servlet.ServletException;
11
-import javax.servlet.ServletRequest;
12
-import javax.servlet.ServletResponse;
13
-import javax.servlet.annotation.WebFilter;
14
-import javax.servlet.http.Cookie;
15
-import javax.servlet.http.HttpServletRequest;
16
-import javax.servlet.http.HttpServletResponse;
17
-
18
-import org.apache.commons.lang3.StringUtils;
19
-import org.springframework.core.annotation.Order;
20
-import org.springframework.stereotype.Component;
21
-import org.springframework.web.util.WebUtils;
22
-
23
-import com.alibaba.fastjson.JSONObject;
24
-import com.yingying.tourist.business.BusinessYml;
25
-import com.yingying.tourist.common.UrlUtils;
26
-
27
-import lombok.extern.slf4j.Slf4j;
28
-
29
-@Component
30
-@Order(2)
31
-@WebFilter(filterName = "SessionFilter", urlPatterns = "/*")
32
-@Slf4j
33
-public class SessionFilter implements Filter {
34
-	
35
-	@Resource
36
-	private BusinessYml businessYml;
37
-
38
-	@Override
39
-	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
40
-		// 检查sessionId的cookie是否存在,不存在即为新连接,需要初始化sessionId到cookie中
41
-		checkRemoteSession((HttpServletRequest) request, (HttpServletResponse) response);
42
-		chain.doFilter(request, response);
43
-	}
44
-
45
-	@Override
46
-	public void destroy() {
47
-	}
48
-
49
-	@Override
50
-	public void init(FilterConfig filterConfig) throws ServletException {
51
-		
52
-	}
53
-
54
-	private void checkRemoteSession(HttpServletRequest request, HttpServletResponse response) {
55
-		String sessionKey = null;
56
-		String token = request.getParameter("token");
57
-		log.info("token------>>>first:[{}]",token);
58
-        if (StringUtils.isEmpty(token)) {
59
-            String payload = UrlUtils.getRequestPayload(request);
60
-            if (!StringUtils.isEmpty(payload)) {
61
-                JSONObject jsonObject = JSONObject.parseObject(payload);
62
-                token = jsonObject.getString("token");
63
-            }
64
-        }
65
-		
66
-		if (StringUtils.isNotEmpty(token)) {
67
-			sessionKey = token;
68
-			log.info("sessionKey------>>>second:[{}]",sessionKey);
69
-		} else {
70
-			Cookie sessionKeyCookie = WebUtils.getCookie(request, SessionAuthorization.SESSION_KEY_COOKIE_NAME);
71
-			if (sessionKeyCookie == null) {
72
-				sessionKey = UUID.randomUUID().toString();
73
-				sessionKeyCookie = new Cookie(SessionAuthorization.SESSION_KEY_COOKIE_NAME, sessionKey);
74
-			} else {
75
-				sessionKey = sessionKeyCookie.getValue();
76
-			}
77
-			log.info("sessionKey------>>>third:[{}]",sessionKey);
78
-			sessionKeyCookie.setPath("/");
79
-			sessionKeyCookie.setDomain(businessYml.getCookieDomain());
80
-			sessionKeyCookie.setMaxAge(SessionAuthorization.DEFAULT_SESSION_COOKIE_EXPIRE);
81
-			sessionKeyCookie.setHttpOnly(true);
82
-			response.addCookie(sessionKeyCookie);
83
-		}
84
-		RequestSessionKey.putSessionKey(sessionKey);
85
-	}
86
-	
1
+package com.yingying.tourist.request;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.yingying.tourist.common.UrlUtils;
5
+import lombok.extern.slf4j.Slf4j;
6
+import org.apache.commons.lang3.StringUtils;
7
+import org.springframework.beans.factory.annotation.Value;
8
+import org.springframework.core.annotation.Order;
9
+import org.springframework.stereotype.Component;
10
+import org.springframework.web.util.WebUtils;
11
+
12
+import javax.servlet.*;
13
+import javax.servlet.annotation.WebFilter;
14
+import javax.servlet.http.Cookie;
15
+import javax.servlet.http.HttpServletRequest;
16
+import javax.servlet.http.HttpServletResponse;
17
+import java.io.IOException;
18
+import java.util.UUID;
19
+
20
+@Component
21
+@Order(2)
22
+@WebFilter(filterName = "SessionFilter", urlPatterns = "/*")
23
+@Slf4j
24
+public class SessionFilter implements Filter {
25
+
26
+	@Value("${session.domain}")private String COOKIEDOMAIN;
27
+
28
+	@Override
29
+	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
30
+		// 检查sessionId的cookie是否存在,不存在即为新连接,需要初始化sessionId到cookie中
31
+		checkRemoteSession((HttpServletRequest) request, (HttpServletResponse) response);
32
+		chain.doFilter(request, response);
33
+	}
34
+
35
+	@Override
36
+	public void destroy() {
37
+	}
38
+
39
+	@Override
40
+	public void init(FilterConfig filterConfig) throws ServletException {
41
+		
42
+	}
43
+
44
+	private void checkRemoteSession(HttpServletRequest request, HttpServletResponse response) {
45
+		String sessionKey = null;
46
+		String token = request.getParameter("token");
47
+		log.info("token------>>>first:[{}]",token);
48
+        if (StringUtils.isEmpty(token)) {
49
+            String payload = UrlUtils.getRequestPayload(request);
50
+            if (!StringUtils.isEmpty(payload)) {
51
+                JSONObject jsonObject = JSONObject.parseObject(payload);
52
+                token = jsonObject.getString("token");
53
+            }
54
+        }
55
+		
56
+		if (StringUtils.isNotEmpty(token)) {
57
+			sessionKey = token;
58
+			log.info("sessionKey------>>>second:[{}]",sessionKey);
59
+		} else {
60
+			Cookie sessionKeyCookie = WebUtils.getCookie(request, SessionAuthorization.SESSION_KEY_COOKIE_NAME);
61
+			if (sessionKeyCookie == null) {
62
+				sessionKey = UUID.randomUUID().toString();
63
+				sessionKeyCookie = new Cookie(SessionAuthorization.SESSION_KEY_COOKIE_NAME, sessionKey);
64
+			} else {
65
+				sessionKey = sessionKeyCookie.getValue();
66
+			}
67
+			log.info("sessionKey------>>>third:[{}]",sessionKey);
68
+			sessionKeyCookie.setPath("/");
69
+			sessionKeyCookie.setDomain(COOKIEDOMAIN);
70
+			sessionKeyCookie.setMaxAge(SessionAuthorization.DEFAULT_SESSION_COOKIE_EXPIRE);
71
+			sessionKeyCookie.setHttpOnly(true);
72
+			response.addCookie(sessionKeyCookie);
73
+		}
74
+		RequestSessionKey.putSessionKey(sessionKey);
75
+	}
76
+	
87 77
 }

+ 14 - 13
src/main/java/com/yingying/tourist/vo/QuestionVo.java

@@ -1,13 +1,14 @@
1
-package com.yingying.tourist.vo;
2
-
3
-import lombok.Data;
4
-
5
-@Data
6
-public class QuestionVo {
7
-    private String nickname;
8
-    private String resultDestination;
9
-    private String resultOutter;
10
-    private String resultInner;
11
-    private String resultIdentity;
12
-    private String resultDescribe;
13
-}
1
+package com.yingying.tourist.vo;
2
+
3
+import lombok.Data;
4
+
5
+@Data
6
+public class QuestionVo {
7
+    private String nickname;
8
+    private String resultDestination;
9
+    private String resultDestinationInfo;
10
+    private String resultOutter;
11
+    private String resultInner;
12
+    private String resultIdentity;
13
+    private String resultDescribe;
14
+}

+ 54 - 46
src/main/java/com/yingying/tourist/web/QuestionController.java

@@ -1,46 +1,54 @@
1
-package com.yingying.tourist.web;
2
-
3
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
4
-import com.yingying.tourist.business.BusinessConstant;
5
-import com.yingying.tourist.common.Util;
6
-import com.yingying.tourist.domain.Question;
7
-import com.yingying.tourist.domain.User;
8
-import com.yingying.tourist.exception.ErrorCode;
9
-import com.yingying.tourist.result.MessageResult;
10
-import com.yingying.tourist.service.QuestionService;
11
-import com.yingying.tourist.service.UserService;
12
-import com.yingying.tourist.vo.QuestionVo;
13
-import org.springframework.beans.BeanUtils;
14
-import org.springframework.beans.factory.annotation.Autowired;
15
-import org.springframework.web.bind.annotation.GetMapping;
16
-import org.springframework.web.bind.annotation.RestController;
17
-
18
-@RestController
19
-public class QuestionController {
20
-
21
-    @Autowired
22
-    private QuestionService questionService;
23
-
24
-    @Autowired
25
-    private UserService userService;
26
-
27
-    @GetMapping("question/pick")
28
-    public MessageResult<QuestionVo> question(String openid, String pickOne, String pickTwo, String pickThird, String pickFourth){
29
-        if (Util.isNull(openid) || Util.isNull(pickOne) || Util.isNull(pickTwo) || Util.isNull(pickThird) || Util.isNull(pickFourth)) {
30
-            return new MessageResult<QuestionVo>().failure(ErrorCode.PARAMETERS_ERROR);
31
-        }
32
-        QuestionVo questionVo = new QuestionVo();
33
-        String pick = pickOne + pickTwo + pickThird;
34
-        EntityWrapper<Question> questionWrapper = new EntityWrapper<>();
35
-        questionWrapper.eq("question_path", pick);
36
-        Question question = questionService.selectOne(questionWrapper);
37
-        EntityWrapper<User> userWrapper = new EntityWrapper<>();
38
-        userWrapper.eq("openid", openid);
39
-        User user = userService.selectOne(userWrapper);
40
-        BeanUtils.copyProperties(question, questionVo);
41
-        questionVo.setResultDescribe(BusinessConstant.describeMap.get(Util.getRandomInt(1,16)));
42
-        questionVo.setResultIdentity(BusinessConstant.Identity.getValue(pickFourth));
43
-        questionVo.setNickname(user.getNickname());
44
-        return new MessageResult<QuestionVo>().ok(questionVo);
45
-    }
46
-}
1
+package com.yingying.tourist.web;
2
+
3
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
4
+import com.yingying.tourist.business.BusinessConstant;
5
+import com.yingying.tourist.common.Util;
6
+import com.yingying.tourist.domain.Question;
7
+import com.yingying.tourist.domain.User;
8
+import com.yingying.tourist.exception.ErrorCode;
9
+import com.yingying.tourist.result.MessageResult;
10
+import com.yingying.tourist.service.QuestionService;
11
+import com.yingying.tourist.service.UserService;
12
+import com.yingying.tourist.vo.QuestionVo;
13
+import org.springframework.beans.BeanUtils;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.web.bind.annotation.GetMapping;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import java.util.Arrays;
19
+import java.util.List;
20
+
21
+@RestController
22
+public class QuestionController {
23
+
24
+    @Autowired
25
+    private QuestionService questionService;
26
+
27
+    @Autowired
28
+    private UserService userService;
29
+
30
+    @GetMapping("question/pick")
31
+    public MessageResult<QuestionVo> question(String openid, String pick){
32
+        if (Util.isNull(pick)) {
33
+            return new MessageResult<QuestionVo>().failure(ErrorCode.PARAMETERS_ERROR);
34
+        }
35
+        QuestionVo questionVo = new QuestionVo();
36
+        String[] pickList = pick.split(",");
37
+        String pickLast = pickList[3];
38
+        String pickBegin = pickList[0] + pickList[1] + pickList[2];
39
+        EntityWrapper<Question> questionWrapper = new EntityWrapper<>();
40
+        questionWrapper.eq("question_path", pickBegin);
41
+        Question question = questionService.selectOne(questionWrapper);
42
+        BeanUtils.copyProperties(question, questionVo);
43
+        questionVo.setResultDestinationInfo(BusinessConstant.destinationMap.get(question.getResultOrder()));
44
+        questionVo.setResultDescribe(BusinessConstant.describeMap.get(Util.getRandomInt(1,16)));
45
+        questionVo.setResultIdentity(BusinessConstant.Identity.getValue(pickLast));
46
+        if (Util.isNotNull(openid)) {
47
+            EntityWrapper<User> userWrapper = new EntityWrapper<>();
48
+            userWrapper.eq("openid", openid);
49
+            User user = userService.selectOne(userWrapper);
50
+            questionVo.setNickname(user.getNickname());
51
+        }
52
+        return new MessageResult<QuestionVo>().ok(questionVo);
53
+    }
54
+}