Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
27b92496
Commit
27b92496
authored
Dec 27, 2018
by
郑杰
Browse files
update VisitsScheduling
parent
6375f682
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/me/zhengjie/monitor/config/VisitsScheduling.java
View file @
27b92496
...
...
@@ -18,9 +18,9 @@ public class VisitsScheduling {
private
VisitsService
visitsService
;
/**
* 每天0
:01
运行
* 每天0
点
运行
*/
@Scheduled
(
cron
=
"
1
0 0 * * ?"
)
@Scheduled
(
cron
=
"
0
0 0 * * ?"
)
public
void
save
(){
visitsService
.
save
();
}
...
...
src/main/java/me/zhengjie/system/repository/UserRepository.java
View file @
27b92496
...
...
@@ -3,6 +3,8 @@ package me.zhengjie.system.repository;
import
me.zhengjie.system.domain.User
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.query.Param
;
/**
* @author jie
...
...
@@ -15,12 +17,14 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
* @param username
* @return
*/
User
findByUsername
(
String
username
);
@Query
(
"from User u join fetch u.roles where u.username = :username"
)
User
findByUsername
(
@Param
(
"username"
)
String
username
);
/**
* findByEmail
* @param email
* @return
*/
User
findByEmail
(
String
email
);
@Query
(
"from User u join fetch u.roles where u.email = :email"
)
User
findByEmail
(
@Param
(
"email"
)
String
email
);
}
Write
Preview
Supports
Markdown
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