xiangpei
7 天以前 b1383a4dcd8c1b228174e28fb8331ee078115cb8
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
package cn.lili.controller.common;
 
import cn.lili.common.utils.IpHelper;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
 
/**
 * 管理端,IP接口
 *
 * @author Chopper
 * @since 2020-02-25 14:10:16
 */
@RestController
@Api(tags = "获取IP信息以及天气")
@RequestMapping("/common/common/ip")
public class IpInfoManagerController {
    @Autowired
    private IpHelper ipHelper;
 
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    @ApiOperation(value = "IP及天气相关信息")
    public ResultMessage<Object> upload(HttpServletRequest request) {
 
        String result = ipHelper.getIpCity(request);
        return ResultUtil.data(result);
    }
}