You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
668 B
31 lines
668 B
2 years ago
|
package com.ynxbd.wx.ext.bean;
|
||
|
|
||
|
import javax.servlet.http.HttpServletRequest;
|
||
|
|
||
|
public enum ExtServerEnum {
|
||
|
SERVER("127.0.0.1", 8080), // 自己
|
||
|
|
||
|
BI_SERVER("200.200.200.9", 8088);
|
||
|
|
||
|
public final String IP;
|
||
|
|
||
|
public final int PORT;
|
||
|
|
||
|
ExtServerEnum(String IP, Integer PORT) {
|
||
|
this.IP = IP;
|
||
|
this.PORT = PORT;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
* 获取第三方请求路径
|
||
|
* @param request 请求
|
||
|
* @return 请求路径
|
||
|
*/
|
||
|
public static String getUrl(HttpServletRequest request) {
|
||
|
return "http://" + ExtServerEnum.SERVER.IP+ ":" + ExtServerEnum.SERVER.PORT + request.getServletPath();
|
||
|
}
|
||
|
|
||
|
}
|