|
@@ -3,10 +3,12 @@ package com.yingying.tourist.web;
|
3
|
3
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
4
|
4
|
import com.yingying.tourist.business.BusinessConstant;
|
5
|
5
|
import com.yingying.tourist.common.Util;
|
|
6
|
+import com.yingying.tourist.domain.Config;
|
6
|
7
|
import com.yingying.tourist.domain.Question;
|
7
|
8
|
import com.yingying.tourist.domain.User;
|
8
|
9
|
import com.yingying.tourist.exception.ErrorCode;
|
9
|
10
|
import com.yingying.tourist.result.MessageResult;
|
|
11
|
+import com.yingying.tourist.service.ConfigService;
|
10
|
12
|
import com.yingying.tourist.service.QuestionService;
|
11
|
13
|
import com.yingying.tourist.service.UserService;
|
12
|
14
|
import com.yingying.tourist.vo.QuestionVo;
|
|
@@ -15,9 +17,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
15
|
17
|
import org.springframework.web.bind.annotation.GetMapping;
|
16
|
18
|
import org.springframework.web.bind.annotation.RestController;
|
17
|
19
|
|
18
|
|
-import java.util.Arrays;
|
19
|
|
-import java.util.List;
|
20
|
|
-
|
21
|
20
|
@RestController
|
22
|
21
|
public class QuestionController {
|
23
|
22
|
|
|
@@ -27,6 +26,9 @@ public class QuestionController {
|
27
|
26
|
@Autowired
|
28
|
27
|
private UserService userService;
|
29
|
28
|
|
|
29
|
+ @Autowired
|
|
30
|
+ private ConfigService configService;
|
|
31
|
+
|
30
|
32
|
@GetMapping("question/pick")
|
31
|
33
|
public MessageResult<QuestionVo> question(String openid, String pick){
|
32
|
34
|
if (Util.isNull(pick)) {
|
|
@@ -43,6 +45,10 @@ public class QuestionController {
|
43
|
45
|
questionVo.setResultDestinationInfo(BusinessConstant.destinationMap.get(question.getResultOrder()));
|
44
|
46
|
questionVo.setResultDescribe(BusinessConstant.describeMap.get(Util.getRandomInt(1,16)));
|
45
|
47
|
questionVo.setResultIdentity(BusinessConstant.Identity.getValue(pickLast));
|
|
48
|
+ EntityWrapper<Config> configWrapper = new EntityWrapper<>();
|
|
49
|
+ configWrapper.eq("config_key", "h5_supernatant_show");
|
|
50
|
+ Config config = configService.selectOne(configWrapper);
|
|
51
|
+ questionVo.setShow("1".equals(config.getConfigValue()));
|
46
|
52
|
if (Util.isNotNull(openid)) {
|
47
|
53
|
EntityWrapper<User> userWrapper = new EntityWrapper<>();
|
48
|
54
|
userWrapper.eq("openid", openid);
|