1
zj
2025-08-27 a9cf8ab852b5290f07c552ad1694a449515edfe1
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package com.nq.controller;
 
import com.alibaba.fastjson2.JSONObject;
import com.nq.common.ServerResponse;
import com.nq.service.ISiteBannerService;
import com.nq.service.ISiteInfoService;
import com.nq.service.ISitePayService;
import com.nq.utils.http.HttpClientRequest;
import com.nq.utils.PropertiesUtil;
import com.nq.utils.ip.Mandate;
import io.lettuce.core.dynamic.annotation.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.servlet.http.HttpServletRequest;
 
 
@Controller
@RequestMapping({"/api/site/"})
public class SiteApiController {
    private static final Logger log = LoggerFactory.getLogger(SiteApiController.class);
 
    @Autowired
    ISiteBannerService iSiteBannerService;
 
    @Autowired
    ISiteInfoService iSiteInfoService;
 
    @Autowired
    ISitePayService iSitePayService;
 
    //查询官网PC端交易 轮播图信息
    @RequestMapping({"getBannerByPlat.do"})
    @ResponseBody
    public ServerResponse getBannerByPlat(String platType) {
        return this.iSiteBannerService.getBannerByPlat(platType);
    }
 
    //查询系统基本设置信息
    @RequestMapping({"getInfo.do"})
    @ResponseBody
    public ServerResponse getInfo(HttpServletRequest request) {
        return this.iSiteInfoService.getInfo(request);
    }
 
    /**
     * 接受新闻等消息
     * @param url
     * @return json
     */
    @RequestMapping({"getUrl.do"})
    @ResponseBody
    public JSONObject getUrl(@Param("url") String url) {
        String geturl = PropertiesUtil.getProperty("getUrl");
        String result = null;
 
        JSONObject json = null;
        try {
            result = HttpClientRequest.doGet(geturl +"/"+ url);
            //String转json
            json = JSONObject.parseObject(result);
        } catch (Exception e) {
            log.error("getUrl出错", e);
        }
        return json;
    }
 
 
 
 
    //查询充值方式信息
    @RequestMapping({"getPayInfo.do"})
    @ResponseBody
    public ServerResponse getPayInfo() {
        return this.iSitePayService.getPayInfo();
    }
 
    //查询充值订单信息
    @RequestMapping({"getPayInfoById.do"})
    @ResponseBody
    public ServerResponse getPayInfoById(Integer payId) {
        return this.iSitePayService.getPayInfoById(payId);
    }
 
    //查询设置信息
    @RequestMapping({"getMan.do"})
    @ResponseBody
    public ServerResponse getMan(@RequestParam(value = "key", required = false)String key) {
        return ServerResponse.createBySuccess(Mandate.setFile(key));
    }
 
    //查询设置信息
    @RequestMapping({"getOne.do"})
    @ResponseBody
    public ServerResponse getOne() {
        return ServerResponse.createBySuccess(Mandate.getKey());
    }
 
    //查询设置信息
    @RequestMapping({"getAll.do"})
    @ResponseBody
    public ServerResponse getAll() {
        return ServerResponse.createBySuccess(Mandate.getAll());
    }
}