update VisitsScheduling

pull/2/head
郑杰 2018-12-27 00:02:08 +08:00
parent 6375f682b5
commit 27b92496fc
2 changed files with 8 additions and 4 deletions

View File

@ -18,9 +18,9 @@ public class VisitsScheduling {
private VisitsService visitsService; private VisitsService visitsService;
/** /**
* 001 * 0
*/ */
@Scheduled(cron = "1 0 0 * * ?") @Scheduled(cron = "0 0 0 * * ?")
public void save(){ public void save(){
visitsService.save(); visitsService.save();
} }

View File

@ -3,6 +3,8 @@ package me.zhengjie.system.repository;
import me.zhengjie.system.domain.User; import me.zhengjie.system.domain.User;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
/** /**
* @author jie * @author jie
@ -15,12 +17,14 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
* @param username * @param username
* @return * @return
*/ */
User findByUsername(String username); @Query("from User u join fetch u.roles where u.username = :username")
User findByUsername(@Param("username") String username);
/** /**
* findByEmail * findByEmail
* @param email * @param email
* @return * @return
*/ */
User findByEmail(String email); @Query("from User u join fetch u.roles where u.email = :email")
User findByEmail(@Param("email") String email);
} }