접근 url 파라미터 추출 추가

master
mjkhan21 9 months ago
parent 5b5baf6979
commit 0188c094e2

@ -1,6 +1,7 @@
package cokr.xit.foundation; package cokr.xit.foundation;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
/** () . /** () .
*/ */
@ -12,6 +13,7 @@ public class Access {
sessionID, sessionID,
action, action,
ipAddress; ipAddress;
private Map<String, String[]> params;
private boolean private boolean
newSession, newSession,
mobile, mobile,
@ -90,6 +92,22 @@ public class Access {
return this; return this;
} }
/** .
* @return
*/
public Map<String, String[]> getParams() {
return params;
}
/** .
* @param params
* @return Access
*/
public Access setParams(Map<String, String[]> params) {
this.params = params;
return this;
}
/** Access . /** Access .
* @return Access * @return Access
*/ */

@ -19,14 +19,61 @@ public class DataFormat extends AbstractComponent {
return !isEmpty(str) ? str.substring(0, 3) + "-" + str.substring(3, 5) + "-" + str.substring(5) : ""; return !isEmpty(str) ? str.substring(0, 3) + "-" + str.substring(3, 5) + "-" + str.substring(5) : "";
} }
/**yyyyMMdd, yyMMdd yyyy-MM-dd .
* @param obj yyyyMMdd, yyMMdd
* @return yyyy-MM-dd
*/
public static final String yyyy_mm_dd(Object obj) {
if (isEmpty(obj)) return "";
String str = obj.toString();
int length = str.length(),
pos = length - 2;
String
day = str.substring(pos),
month = str.substring(pos = pos - 2, pos + 2),
year = str.substring(0, pos);
return String.format("%s-%s-%s", year, month, day);
}
/**HHmmss HH:mm:ss .
* @param obj HHmmss
* @return HH:mm:ss
*/
public static final String hh_mm_ss(Object obj) {
if (isEmpty(obj)) return "";
/**'-' (yyyy-MM-dd) . String str = obj.toString();
* @param str '-' int length = str.length(),
* @return '-' pos = length - 2;
String
ss = str.substring(pos),
mm = str.substring(pos = pos - 2, pos + 2),
hh = str.substring(0, pos);
return String.format("%s:%s:%s", hh, mm, ss);
}
/**yyyyMMddHHmmss, yyMMddHHmmss yyyy-MM-dd HH:mm:ss .
* @param obj yyyyMMddHHmmss, yyMMddHHmmss
* @return yyyy-MM-dd HH:mm:ss
*/ */
public static final String yyyy_mm_dd(String str) { public static final String yyyy_MM_dd_HH_mm_ss(Object obj) {
if (isEmpty(str)) return ""; if (isEmpty(obj)) return "";
return str.substring(0, 4) + "-" + str.substring(4, 6) + "-" + str.substring(6); String str = obj.toString();
int length = str.length(),
pos = length - 6;
try {
String
date = str.substring(0, pos),
time = str.substring(pos);
return yyyy_mm_dd(date) + " " + hh_mm_ss(time);
} catch (Exception e) {
return str;
}
} }
} }

@ -40,6 +40,7 @@ public class AccessFilter implements Filter {
Access access = new Access() Access access = new Access()
.setAction(action) .setAction(action)
.setParams(hreq.getParameterMap())
.setNewSession(session == null || session.isNew()) .setNewSession(session == null || session.isNew())
.setMobile(hreq.getHeader("User-Agent").contains("Mobi")) .setMobile(hreq.getHeader("User-Agent").contains("Mobi"))
.setSessionID(session != null ? session.getId() : null) .setSessionID(session != null ? session.getId() : null)

Loading…
Cancel
Save