Air
2024-11-04 29c405353029f033e187e8dc033b93385365ee43
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package com.nova.sankuai.controller.v2;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nova.sankuai.domain.entity.SystemParam;
import com.nova.sankuai.domain.vo.EnumParamsVo;
import com.nova.sankuai.domain.vo.channel.ChannelConfigVo;
import com.nova.sankuai.infra.utils.ResultJson;
import com.nova.sankuai.service.IChannelInfoService;
import com.nova.sankuai.service.ISystemParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.List;
 
/**
 * @author weikangdi
 * @create 2021/12/20
 */
@Api(tags = "系统配置V2")
@RestController
@RequestMapping(value = "/api/v2/systemConfig")
@AllArgsConstructor
@Slf4j
public class SystemConfigV2Controller {
 
    private final IChannelInfoService channelInfoService;
 
    private final ISystemParamService systemParamService;
 
    private final static String HZFQ_APPID= "8de20a2a-4b11-4570-a6c8-7fc8b7191f36";
    //private final static String QURONG_APPID= "3d3d21bf-3a99-461f-9a2d-6763f88e3393";
 
    @GetMapping(value = "/getConfig")
    @ApiOperation(value = "获取配置信息")
    public ResultJson<ChannelConfigVo> getConfig(String appId, HttpServletRequest request) {
        ChannelConfigVo configParams = channelInfoService.getChannelInfoByKey(appId, request);
        return ResultJson.ok(configParams);
    }
 
    @GetMapping(value = "/getEnumParams")
    @ApiOperation(value = "获取系统枚举信息")
    public ResultJson<List<EnumParamsVo>> getEnumParams(String code) {
        List<EnumParamsVo> params = systemParamService.getEnumParams(code);
        return ResultJson.ok(params);
    }
 
    @GetMapping(value = "/getOnlineServiceUrl")
    @ApiOperation(value = "获取在线客服链接")
    public ResultJson<String> getOnlineServiceUrl(String appId) {
        log.info("客服链接AppId: {}",appId);
        String url = "https://ykf-weixin01.7moor.com/wapchat.html?accessId=0a043e50-4a64-11ef-8b85-491e10dcec05&fromUrl=hhttsl&urlTitle=APP&language=ZHCN&wechatOrAppImplant=true";
        // 我的测试
//        String url = "https://tjdyxkjyxgs.qiyukf.com/client?k=22775c5cd6e71e3b4151aa24f590adbf&wp=1&robotShuntSwitch=0";
        // 我的测试 完
       /* if (Objects.equals(HZFQ_APPID, appId.trim())) {
            url = "https://tjdyxkjyxgs.qiyukf.com/client?k=22775c5cd6e71e3b4151aa24f590adbf&wp=1&robotShuntSwitch=0";
        }*/
        return ResultJson.ok(url);
    }
 
    @GetMapping(value = "/getMyH5State")
    @ApiOperation(value = "获取系统设置的我的H5生效状态")
    public ResultJson<Integer> getMyH5State() {
        QueryWrapper<SystemParam> wrapper = new QueryWrapper<>();
        wrapper.ge("id", 0);
        SystemParam param = systemParamService.getOne(wrapper);
        return ResultJson.ok(param.getMyH5());
    }
 
}