feat(server): admin 批次列表/作废改指 codes 库新表,清理被取代的旧 store 方法(#codes-lib)

This commit is contained in:
wangjia
2026-07-10 14:53:29 +08:00
parent d1e2fed563
commit ef4ed47759
3 changed files with 58 additions and 18 deletions
+5 -15
View File
@@ -43,21 +43,12 @@ const (
// SubscriptionRow mirrors the `subscriptions` DB row.
type SubscriptionRow struct {
ID int64
UserID int64
PlanID int64
PlanCode PlanCode
ExpiresAt time.Time
Source string
}
// BatchRow mirrors the `code_batches` DB row.
type BatchRow struct {
ID int64
Channel BatchChannel
CreatedBy string
Note sql.NullString
CreatedAt time.Time
UserID int64
PlanID int64
PlanCode PlanCode
ExpiresAt time.Time
Source string
}
// Store wraps a *sql.DB and exposes all database operations needed by the
@@ -248,4 +239,3 @@ func (s *Store) MintOne(ctx context.Context, codeHash string, ent libcodes.Entit
func (s *Store) BeginTx(ctx context.Context) (*sql.Tx, error) {
return s.db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelReadCommitted})
}