Browse Source

collect statistic v1 fix

master
gsd 1 year ago
parent
commit
9417591af3
  1. 4
      src/main/java/app/annotations/impl/CollectStatisticAspect.java
  2. 1
      src/main/java/app/entities/db/CollectableStatistic.java

4
src/main/java/app/annotations/impl/CollectStatisticAspect.java

@ -34,8 +34,6 @@ public class CollectStatisticAspect {
@Before("@annotation(app.annotations.interfaces.CollectStatistic)")
public void before() {
CollectableStatistic st = new CollectableStatistic(request);
collectStatisticService.add(st);
logger.info(st.toString());
collectStatisticService.add(new CollectableStatistic(request));
}
}

1
src/main/java/app/entities/db/CollectableStatistic.java

@ -24,6 +24,7 @@ public class CollectableStatistic {
public CollectableStatistic(HttpServletRequest request) {
this.client_ip = request.getHeader("X-Forwarded-For");
if (this.client_ip != null) this.client_ip = this.client_ip.split(",")[0];
this.method = request.getMethod();
this.path = request.getRequestURI();
this.query = request.getQueryString();

Loading…
Cancel
Save