feat: migrate serevices
Some checks failed
build quyun / Build (push) Failing after 2m50s

This commit is contained in:
2025-12-19 19:05:12 +08:00
parent 005585c53b
commit 557a641f41
71 changed files with 5626 additions and 280 deletions

View File

@@ -8,6 +8,8 @@ import (
"context"
"time"
"quyun/v2/pkg/fields"
"go.ipao.vip/gen"
"go.ipao.vip/gen/types"
"gorm.io/gorm"
@@ -17,17 +19,17 @@ const TableNameUser = "users"
// User mapped from table <users>
type User struct {
ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp without time zone;not null;default:now()" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp without time zone;not null;default:now()" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp without time zone" json:"deleted_at"`
Status int16 `gorm:"column:status;type:smallint;not null" json:"status"`
OpenID string `gorm:"column:open_id;type:character varying(128);not null" json:"open_id"`
Username string `gorm:"column:username;type:character varying(128);not null" json:"username"`
Avatar string `gorm:"column:avatar;type:text" json:"avatar"`
Metas types.JSON `gorm:"column:metas;type:jsonb;not null;default:{}" json:"metas"`
AuthToken types.JSON `gorm:"column:auth_token;type:jsonb;not null;default:{}" json:"auth_token"`
Balance int64 `gorm:"column:balance;type:bigint;not null" json:"balance"`
ID int64 `gorm:"column:id;type:bigint;primaryKey;autoIncrement:true" json:"id"`
CreatedAt time.Time `gorm:"column:created_at;type:timestamp without time zone;not null;default:now()" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp without time zone;not null;default:now()" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp without time zone" json:"deleted_at"`
Status fields.UserStatus `gorm:"column:status;type:smallint;not null" json:"status"`
OpenID string `gorm:"column:open_id;type:character varying(128);not null" json:"open_id"`
Username string `gorm:"column:username;type:character varying(128);not null" json:"username"`
Avatar string `gorm:"column:avatar;type:text" json:"avatar"`
Metas types.JSONType[fields.UserMetas] `gorm:"column:metas;type:jsonb;not null;default:{}" json:"metas"`
AuthToken types.JSONType[fields.UserAuthToken] `gorm:"column:auth_token;type:jsonb;not null;default:{}" json:"auth_token"`
Balance int64 `gorm:"column:balance;type:bigint;not null" json:"balance"`
}
// Quick operations without importing query package