Enum Class ResetType

All Implemented Interfaces:
Serializable, Comparable<ResetType>, Constable

public enum ResetType extends Enum<ResetType>
統一紀錄系統(_acc_char_log)的「重置週期」維度:一筆計數多久依日曆邊界自動歸零。

CharacterLogManager 用來決定計數的有效期。重置一律以 MySQL 伺服器本機時間 (部署於 Asia/Taipei)的日曆邊界為準,而非滾動視窗(最近 24 小時/7 天/30 天):

  • DAY —— 每日 00:00 歸零。
  • WEEK —— 每週一 00:00 歸零(以週一為一週之始)。
  • MON —— 每月 1 日 00:00 歸零。
  • NEVER —— 永不歸零(永久累計)。

實作上,CharacterLogManager 以「該筆紀錄的 last_update 是否落在當前週期起點 之後」判定有效性,且起點完全由 MySQL 日期函式於伺服器端計算(CURDATE() 等),與寫入時的 NOW() 同屬一個時區框架、不受 JDBC 時區轉換影響。跨越週期邊界後第一次寫入即就地重置、 讀取則回傳 0,因此每個鍵恆為單一資料列、不會累積歷史列。

  • Enum Constant Details

    • DAY

      public static final ResetType DAY
      每日重置:每日 00:00(伺服器本機時間)歸零。
    • WEEK

      public static final ResetType WEEK
      每週重置:每週一 00:00 歸零。
    • MON

      public static final ResetType MON
      每月重置:每月 1 日 00:00 歸零。
    • NEVER

      public static final ResetType NEVER
      永不重置:永久累計,不歸零。
  • Method Details

    • values

      public static ResetType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ResetType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null