package com.ssm.controller;

import com.ssm.core.util.IpUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * 测试线上项目是否成功启动
 */

@Controller
@RequestMapping("/test")
@ResponseBody
public class TestController {
    @RequestMapping("/testStart")
    public String login(){
        return "index";
    }


    @RequestMapping("/getIp")

    public String MethodName(HttpServletRequest request){
        System.out.println(request.getRemoteAddr());
        String ip = IpUtil.getIpAddress(request);
        return ip;
    }

}
