Class Schedule


  • @Component
    @PropertySource("classpath:properties/directory.properties")
    public class Schedule
    extends java.lang.Object
    스케쥴러 클래스
    Version:
    1.0
    Author:
    WooYoung Lee
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String pathStorage
      DB에 저장된 모든 json 파일을 저장할 경로
      java.lang.String pathTo
      json 디렉토리의 파일이 저장되는 디렉토리 경로
      파일이 디비에 저장되는 디렉토리
    • Constructor Summary

      Constructors 
      Constructor Description
      Schedule()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkUserLoginTime()
      매일 오전 9시에 회원을 검사하여 마지막 로그인이 6개월 전이라면 회원탈퇴 3개월 전이라면 계정 만료
      boolean CompareDate​(java.lang.String first, java.lang.String second)
      첫번째 인자의 날짜와 두번째 인자의 날짜를 비교하여 첫번째 날짜가 더 최근이라면 false 반환
      java.lang.String plusMonth​(java.lang.String date, int num)
      문자열 형식의 날짜와 숫자를 받아 날짜에 숫자 개월만큼 더해서 문자열로 반환
      void watchDir()
      10분마다 디렉토리를 감시하며 json 파일을 DB에 파싱
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pathTo

        @Value("${input.uploadJson.directory}")
        public java.lang.String pathTo
        json 디렉토리의 파일이 저장되는 디렉토리 경로
        파일이 디비에 저장되는 디렉토리
      • pathStorage

        @Value("${input.jsonStorage.directory}")
        public java.lang.String pathStorage
        DB에 저장된 모든 json 파일을 저장할 경로
    • Constructor Detail

      • Schedule

        public Schedule()
    • Method Detail

      • watchDir

        @Scheduled(fixedDelay=600000L)
        public void watchDir()
                      throws java.lang.Exception
        10분마다 디렉토리를 감시하며 json 파일을 DB에 파싱
        Throws:
        java.lang.Exception - 예외처리
      • checkUserLoginTime

        @Scheduled(cron="0 0 9 * * *")
        public void checkUserLoginTime()
                                throws java.lang.Exception
        매일 오전 9시에 회원을 검사하여 마지막 로그인이 6개월 전이라면 회원탈퇴 3개월 전이라면 계정 만료
        Throws:
        java.lang.Exception - 예외처리
      • CompareDate

        public boolean CompareDate​(java.lang.String first,
                                   java.lang.String second)
        첫번째 인자의 날짜와 두번째 인자의 날짜를 비교하여 첫번째 날짜가 더 최근이라면 false 반환
        Parameters:
        first - 비교할 첫번째 날짜
        second - 비교할 두번째 날짜
        Returns:
        first가 더 예전날짜라면 true , second가 더 예전 날짜라면 false
      • plusMonth

        public java.lang.String plusMonth​(java.lang.String date,
                                          int num)
        문자열 형식의 날짜와 숫자를 받아 날짜에 숫자 개월만큼 더해서 문자열로 반환
        Parameters:
        date - 문자열 형식의 날짜
        num - 더해줄 월 수
        Returns:
        date에 num 개월 만큼 더한 날짜