重构项目结构,将 orm 和 rds 包迁移到 web/globals

This commit is contained in:
2025-05-10 16:59:41 +08:00
parent 37e6e58816
commit d256359681
60 changed files with 363 additions and 349 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"errors"
"fmt"
"platform/pkg/rds"
g "platform/web/globals"
"strconv"
"strings"
"time"
@@ -50,7 +50,7 @@ func (s *IdService) GenSerial(ctx context.Context) (string, error) {
// 使用Redis事务确保原子操作
var sequence int64
err := rds.Client.Watch(ctx, func(tx *redis.Tx) error {
err := g.Redis.Watch(ctx, func(tx *redis.Tx) error {
// 获取当前序列号
currentVal, err := tx.Get(ctx, key).Int64()