Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sh-ds
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李良停
sh-ds
Commits
6bf2ca8f
Commit
6bf2ca8f
authored
Jan 28, 2021
by
喻春霖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed
parent
e8588db7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
3 deletions
+67
-3
LogStatisticsController.java
.../authcenter/agent/controller/LogStatisticsController.java
+40
-0
application.yml
eden-authcenter-agent/src/main/resources/application.yml
+1
-1
bootstrap.yml
eden-authcenter-agent/src/main/resources/bootstrap.yml
+1
-1
alpha-framework-api-2.0.6.0014.jar
eden-authcenter-log/lib/alpha-framework-api-2.0.6.0014.jar
+0
-0
AuthLogDao.java
...va/com/chineseall/eden/authcenter/log/dao/AuthLogDao.java
+11
-1
AuthLogService.java
...hineseall/eden/authcenter/log/service/AuthLogService.java
+4
-0
AuthLogServiceImpl.java
.../eden/authcenter/log/service/impl/AuthLogServiceImpl.java
+10
-0
No files found.
eden-authcenter-agent/src/main/java/com/chineseall/eden/authcenter/agent/controller/LogStatisticsController.java
View file @
6bf2ca8f
...
...
@@ -2,10 +2,12 @@ package com.chineseall.eden.authcenter.agent.controller;
import
cn.sh.chineseall.framework.api.MapMessage
;
import
cn.sh.chineseall.framework.core.util.CollectionUtils
;
import
cn.sh.chineseall.framework.lang.calendar.DateUtils
;
import
com.chineseall.eden.authcenter.agent.client.ClientItem
;
import
com.chineseall.eden.authcenter.agent.client.OauthClient
;
import
com.chineseall.eden.authcenter.agent.oauth.OauthConfig
;
import
com.chineseall.eden.authcenter.agent.vo.StatItem
;
import
com.chineseall.eden.authcenter.log.model.AuthLog
;
import
com.chineseall.eden.authcenter.log.service.AuthLogService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -357,5 +359,43 @@ public class LogStatisticsController {
return
MapMessage
.
successMessage
().
add
(
"data"
,
result
);
}
/**
* 认证接入的APP
*
* @return
*/
@RequestMapping
(
"sourcedata"
)
@ResponseBody
public
MapMessage
sourcedata
()
{
int
i
=
1
;
for
(;;){
List
<
AuthLog
>
authLogs
=
authLogService
.
listLogWithPage
(
i
,
100
);
if
(
CollectionUtils
.
isEmpty
(
authLogs
)){
break
;
}
authLogs
.
forEach
(
item
->
{
Date
createTime
=
item
.
getCreateTime
();
if
(
null
==
item
.
getYearMonthDay
()){
item
.
setYearMonthDay
(
DateUtils
.
format
(
createTime
,
"yyyy-MM-dd"
));
}
if
(
null
==
item
.
getYearMonth
())
{
item
.
setYearMonth
(
DateUtils
.
format
(
createTime
,
"yyyy-MM"
));
}
if
(
null
==
item
.
getYear
())
{
item
.
setYear
(
DateUtils
.
format
(
createTime
,
"yyyy"
));
}
if
(
null
==
item
.
getClientId
()){
if
(
item
.
getReturnUrl
()!=
null
&&
item
.
getReturnUrl
().
contains
(
"readinglab.etextbook.cn"
)){
item
.
setClientId
(
"readingroomClientId"
);
}
else
{
item
.
setClientId
(
"testClentId"
);
}
}
authLogService
.
replace
(
item
);
});
i
++;
}
return
MapMessage
.
successMessage
();
}
}
\ No newline at end of file
eden-authcenter-agent/src/main/resources/application.yml
View file @
6bf2ca8f
...
...
@@ -51,7 +51,7 @@ oauth:
logoutSuccessUrl
:
https://ds-test.etextbook.cn/authcenter/auth/logoutsuccess
oauthclient
:
clients
:
-
clientName
:
上海运营中心
-
clientName
:
数字教材
clientId
:
testClentId
clientSecret
:
testClientSecret
# - clientName: 接入样例
...
...
eden-authcenter-agent/src/main/resources/bootstrap.yml
View file @
6bf2ca8f
...
...
@@ -49,7 +49,7 @@ oauth:
logoutSuccessUrl
:
https://ds.etextbook.cn/authcenter/auth/logoutsuccess
oauthclient
:
clients
:
-
clientName
:
上海运营中心
-
clientName
:
数字教材
clientId
:
testClentId
clientSecret
:
testClientSecret
# - clientName: 接入样例
...
...
eden-authcenter-log/lib/alpha-framework-api-2.0.6.0014.jar
0 → 100644
View file @
6bf2ca8f
File added
eden-authcenter-log/src/main/java/com/chineseall/eden/authcenter/log/dao/AuthLogDao.java
View file @
6bf2ca8f
package
com
.
chineseall
.
eden
.
authcenter
.
log
.
dao
;
import
cn.sh.chineseall.framework.core.repackaged.org.springframework.data.domain.PageRequest
;
import
cn.sh.chineseall.framework.core.repackaged.org.springframework.data.domain.Pageable
;
import
cn.sh.chineseall.framework.core.repackaged.org.springframework.data.domain.Sort
;
import
cn.sh.chineseall.framework.dao.core.hql.Criteria
;
import
cn.sh.chineseall.framework.dao.core.hql.Query
;
import
cn.sh.chineseall.framework.dao.mongo.dao.StaticCacheDimensionDocumentMongoDao
;
import
com.chineseall.eden.authcenter.log.model.AuthLog
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -68,4 +70,12 @@ public class AuthLogDao extends StaticCacheDimensionDocumentMongoDao<AuthLog, St
Query
query
=
Query
.
query
(
criteria
);
return
count
(
query
);
}
public
List
<
AuthLog
>
listLogWithPage
(
int
pageNo
,
int
pageSize
)
{
Criteria
criteria
=
new
Criteria
();
Query
query
=
new
Query
(
criteria
);
Sort
sort
=
new
Sort
(
Sort
.
Direction
.
ASC
,
"createTime"
);
Pageable
pageable
=
new
PageRequest
(
pageNo
-
1
,
pageSize
,
sort
);
return
query
(
query
.
with
(
pageable
));
}
}
eden-authcenter-log/src/main/java/com/chineseall/eden/authcenter/log/service/AuthLogService.java
View file @
6bf2ca8f
...
...
@@ -18,4 +18,8 @@ public interface AuthLogService {
List
<
String
>
distinct
(
String
key
,
Map
<
String
,
Object
>
prams
);
long
count
(
Map
<
String
,
Object
>
prams
);
void
replace
(
AuthLog
authLog
);
public
List
<
AuthLog
>
listLogWithPage
(
int
pageNo
,
int
pageSize
);
}
eden-authcenter-log/src/main/java/com/chineseall/eden/authcenter/log/service/impl/AuthLogServiceImpl.java
View file @
6bf2ca8f
...
...
@@ -53,4 +53,14 @@ public class AuthLogServiceImpl implements AuthLogService {
public
long
count
(
Map
<
String
,
Object
>
prams
)
{
return
authLogDao
.
count
(
prams
);
}
@Override
public
void
replace
(
AuthLog
authLog
)
{
authLogDao
.
replace
(
authLog
);
}
@Override
public
List
<
AuthLog
>
listLogWithPage
(
int
pageNo
,
int
pageSize
)
{
return
authLogDao
.
listLogWithPage
(
pageNo
,
pageSize
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment