Commit 7d262b38 authored by 喻春霖's avatar 喻春霖

add resove stat

parent 734ec4a7
package com.chineseall.eden.authcenter.agent.client; package com.chineseall.eden.authcenter.agent.client;
import cn.sh.chineseall.framework.core.util.CollectionUtils;
import lombok.Data; import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* Created by yuchunlin on 2019/5/28. * Created by yuchunlin on 2019/5/28.
...@@ -18,4 +20,16 @@ public class OauthClient { ...@@ -18,4 +20,16 @@ public class OauthClient {
private List<ClientItem> clients; private List<ClientItem> clients;
public ClientItem getClientItem(String clientId){
if (CollectionUtils.isNotEmpty(clients)){
for (ClientItem item : clients) {
if (Objects.equals(item.getClientId(),clientId)){
return item;
}
}
}
return null;
}
} }
...@@ -6,5 +6,5 @@ import lombok.Data; ...@@ -6,5 +6,5 @@ import lombok.Data;
public class StatItem { public class StatItem {
private String code; private String code;
private String name; private String name;
private Integer count; private long count;
} }
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var baseUrl = "https://ds-test.etextbook.cn/"; var baseUrl = "/";
new Vue({ new Vue({
el: '#app', el: '#app',
data: { data: {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<artifactId>alpha-framework-dao-mongo</artifactId> <artifactId>alpha-framework-dao-mongo</artifactId>
<version>2.0.6.0014</version> <version>2.0.6.0014</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${project.basedir}/lib/alpha-framework-dao-mongo-2.0.6.0014.jar</systemPath> <systemPath>${project.basedir}/lib/alpha-framework-dao-mongo-2.0.8.0006.jar</systemPath>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -7,6 +7,7 @@ import com.chineseall.eden.authcenter.log.model.AuthLog; ...@@ -7,6 +7,7 @@ import com.chineseall.eden.authcenter.log.model.AuthLog;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
@Component @Component
...@@ -46,4 +47,25 @@ public class AuthLogDao extends StaticCacheDimensionDocumentMongoDao<AuthLog, St ...@@ -46,4 +47,25 @@ public class AuthLogDao extends StaticCacheDimensionDocumentMongoDao<AuthLog, St
Query query = Query.query(criteria); Query query = Query.query(criteria);
return count(query); return count(query);
} }
public List<String> distinct(String key, Map<String, Object> params){
Criteria criteria = new Criteria();
if (null != params && params.size() > 0){
params.forEach((k,v)->{
criteria.and(k).is(v);
});
}
return super.distinct(key,new Query(criteria),String.class);
}
public long count(Map<String, Object> params){
Criteria criteria = new Criteria();
if (null != params && params.size() > 0){
params.forEach((k,v)->{
criteria.and(k).is(v);
});
}
Query query = Query.query(criteria);
return count(query);
}
} }
...@@ -2,6 +2,7 @@ package com.chineseall.eden.authcenter.log.service; ...@@ -2,6 +2,7 @@ package com.chineseall.eden.authcenter.log.service;
import com.chineseall.eden.authcenter.log.model.AuthLog; import com.chineseall.eden.authcenter.log.model.AuthLog;
import java.util.List;
import java.util.Map; import java.util.Map;
public interface AuthLogService { public interface AuthLogService {
...@@ -13,4 +14,8 @@ public interface AuthLogService { ...@@ -13,4 +14,8 @@ public interface AuthLogService {
Long countLoginByParams(Map<String, Object> params); Long countLoginByParams(Map<String, Object> params);
Long countLogoutByParams(Map<String, Object> params); Long countLogoutByParams(Map<String, Object> params);
List<String> distinct(String key, Map<String, Object> prams);
long count(Map<String,Object> prams);
} }
...@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
...@@ -42,4 +43,14 @@ public class AuthLogServiceImpl implements AuthLogService { ...@@ -42,4 +43,14 @@ public class AuthLogServiceImpl implements AuthLogService {
public Long countLogoutByParams(Map<String, Object> params) { public Long countLogoutByParams(Map<String, Object> params) {
return authLogDao.countLogoutByParams(params); return authLogDao.countLogoutByParams(params);
} }
@Override
public List<String> distinct(String key, Map<String, Object> prams) {
return authLogDao.distinct(key,prams);
}
@Override
public long count(Map<String, Object> prams) {
return authLogDao.count(prams);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment