Refactor order and tenant ledger models to use consts for Currency and Type fields; add new UserStatus values; implement comprehensive test cases for content, creator, order, super, and wallet services.

This commit is contained in:
2025-12-29 14:21:20 +08:00
parent d648a1e45b
commit 8fa3d18a9c
30 changed files with 2251 additions and 85 deletions

View File

@@ -30,7 +30,7 @@ func newContentAccess(db *gorm.DB, opts ...gen.DOOption) contentAccessQuery {
_contentAccessQuery.UserID = field.NewInt64(tableName, "user_id")
_contentAccessQuery.ContentID = field.NewInt64(tableName, "content_id")
_contentAccessQuery.OrderID = field.NewInt64(tableName, "order_id")
_contentAccessQuery.Status = field.NewString(tableName, "status")
_contentAccessQuery.Status = field.NewField(tableName, "status")
_contentAccessQuery.RevokedAt = field.NewTime(tableName, "revoked_at")
_contentAccessQuery.CreatedAt = field.NewTime(tableName, "created_at")
_contentAccessQuery.UpdatedAt = field.NewTime(tableName, "updated_at")
@@ -49,7 +49,7 @@ type contentAccessQuery struct {
UserID field.Int64
ContentID field.Int64
OrderID field.Int64
Status field.String
Status field.Field
RevokedAt field.Time
CreatedAt field.Time
UpdatedAt field.Time
@@ -74,7 +74,7 @@ func (c *contentAccessQuery) updateTableName(table string) *contentAccessQuery {
c.UserID = field.NewInt64(table, "user_id")
c.ContentID = field.NewInt64(table, "content_id")
c.OrderID = field.NewInt64(table, "order_id")
c.Status = field.NewString(table, "status")
c.Status = field.NewField(table, "status")
c.RevokedAt = field.NewTime(table, "revoked_at")
c.CreatedAt = field.NewTime(table, "created_at")
c.UpdatedAt = field.NewTime(table, "updated_at")