✨ optimized image list interface
This commit is contained in:
@@ -117,6 +117,7 @@ func main() {
|
||||
scaUserMessage := g.GenerateModel("sca_user_message", fieldOpts...)
|
||||
scaStorageAlbum := g.GenerateModel("sca_storage_album", fieldOpts...)
|
||||
scaStorageLocation := g.GenerateModel("sca_storage_location", fieldOpts...)
|
||||
scaStorageThumb := g.GenerateModel("sca_storage_thumb", fieldOpts...)
|
||||
|
||||
g.ApplyBasic(
|
||||
scaAuthMenu,
|
||||
@@ -137,6 +138,7 @@ func main() {
|
||||
scaUserMessage,
|
||||
scaStorageAlbum,
|
||||
scaStorageLocation,
|
||||
scaStorageThumb,
|
||||
)
|
||||
|
||||
g.Execute()
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaAuthMenu = "sca_auth_menu"
|
||||
|
||||
// ScaAuthMenu mapped from table <sca_auth_menu>
|
||||
// ScaAuthMenu 菜单表
|
||||
type ScaAuthMenu struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键ID;primary_key" json:"id,string"` // 主键ID
|
||||
MenuName string `gorm:"column:menu_name;type:varchar(64);comment:名称" json:"menu_name"` // 名称
|
||||
|
@@ -6,7 +6,7 @@ package model
|
||||
|
||||
const TableNameScaAuthPermissionRule = "sca_auth_permission_rule"
|
||||
|
||||
// ScaAuthPermissionRule mapped from table <sca_auth_permission_rule>
|
||||
// ScaAuthPermissionRule 接口权限表
|
||||
type ScaAuthPermissionRule struct {
|
||||
ID int64 `gorm:"column:id;type:int(11);primaryKey;autoIncrement:true;primary_key" json:"id,string"`
|
||||
Ptype string `gorm:"column:ptype;type:varchar(100);uniqueIndex:idx_sca_auth_permission_rule,priority:1;index:IDX_sca_auth_permission_rule_ptype,priority:1" json:"ptype"`
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaAuthRole = "sca_auth_role"
|
||||
|
||||
// ScaAuthRole mapped from table <sca_auth_role>
|
||||
// ScaAuthRole 角色表
|
||||
type ScaAuthRole struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键ID;primary_key" json:"id,string"` // 主键ID
|
||||
RoleName string `gorm:"column:role_name;type:varchar(32);not null;comment:角色名称" json:"role_name"` // 角色名称
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaAuthUser = "sca_auth_user"
|
||||
|
||||
// ScaAuthUser mapped from table <sca_auth_user>
|
||||
// ScaAuthUser 用户表
|
||||
type ScaAuthUser struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;uniqueIndex:id,priority:1;comment:自增ID;primary_key" json:"id,string"` // 自增ID
|
||||
UID string `gorm:"column:uid;type:varchar(50);not null;uniqueIndex:uid,priority:1;comment:唯一ID" json:"uid"` // 唯一ID
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaAuthUserDevice = "sca_auth_user_device"
|
||||
|
||||
// ScaAuthUserDevice mapped from table <sca_auth_user_device>
|
||||
// ScaAuthUserDevice 用户设备表
|
||||
type ScaAuthUserDevice struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键ID;primary_key" json:"id,string"` // 主键ID
|
||||
UserID string `gorm:"column:user_id;type:varchar(20);not null;comment:用户ID" json:"user_id"` // 用户ID
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaAuthUserSocial = "sca_auth_user_social"
|
||||
|
||||
// ScaAuthUserSocial mapped from table <sca_auth_user_social>
|
||||
// ScaAuthUserSocial 第三方登录信息表
|
||||
type ScaAuthUserSocial struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键ID;primary_key" json:"id,string"` // 主键ID
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);not null;comment:用户ID" json:"user_id"` // 用户ID
|
||||
|
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
const TableNameScaCommentLike = "sca_comment_likes"
|
||||
|
||||
// ScaCommentLike mapped from table <sca_comment_likes>
|
||||
// ScaCommentLike 评论点赞表
|
||||
type ScaCommentLike struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键id;primary_key" json:"id,string"` // 主键id
|
||||
TopicID string `gorm:"column:topic_id;type:varchar(50);not null;comment:话题ID" json:"topic_id"` // 话题ID
|
||||
|
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
const TableNameScaCommentReply = "sca_comment_reply"
|
||||
|
||||
// ScaCommentReply mapped from table <sca_comment_reply>
|
||||
// ScaCommentReply 评论表
|
||||
type ScaCommentReply struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;uniqueIndex:id,priority:1;comment:主键id;primary_key" json:"id,string"` // 主键id
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);not null;comment:评论用户id" json:"user_id"` // 评论用户id
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaMessageReport = "sca_message_report"
|
||||
|
||||
// ScaMessageReport mapped from table <sca_message_report>
|
||||
// ScaMessageReport 评论举报表
|
||||
type ScaMessageReport struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
UserID string `gorm:"column:user_id;type:varchar(20);comment:用户Id" json:"user_id"` // 用户Id
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaStorageAlbum = "sca_storage_album"
|
||||
|
||||
// ScaStorageAlbum mapped from table <sca_storage_album>
|
||||
// ScaStorageAlbum 相册信息表
|
||||
type ScaStorageAlbum struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);comment:用户ID" json:"user_id"` // 用户ID
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaStorageConfig = "sca_storage_config"
|
||||
|
||||
// ScaStorageConfig mapped from table <sca_storage_config>
|
||||
// ScaStorageConfig 用户存储配置表
|
||||
type ScaStorageConfig struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);not null;comment:用户ID" json:"user_id"` // 用户ID
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaStorageInfo = "sca_storage_info"
|
||||
|
||||
// ScaStorageInfo mapped from table <sca_storage_info>
|
||||
// ScaStorageInfo 文件存储信息表
|
||||
type ScaStorageInfo struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);not null;comment:用户ID" json:"user_id"` // 用户ID
|
||||
@@ -24,6 +24,7 @@ type ScaStorageInfo struct {
|
||||
FileType string `gorm:"column:file_type;type:varchar(50);comment:文件类型" json:"file_type"` // 文件类型
|
||||
Width float64 `gorm:"column:width;type:double;comment:宽" json:"width"` // 宽
|
||||
Height float64 `gorm:"column:height;type:double;comment:高" json:"height"` // 高
|
||||
ThumbID int64 `gorm:"column:thumb_id;type:bigint(20);comment:缩略图id" json:"thumb_id"` // 缩略图id
|
||||
Category string `gorm:"column:category;type:varchar(50);comment:分类" json:"category"` // 分类
|
||||
Tag string `gorm:"column:tag;type:varchar(255);comment:标签" json:"tag"` // 标签
|
||||
Type string `gorm:"column:type;type:varchar(50);comment:类型" json:"type"` // 类型
|
||||
|
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
const TableNameScaStorageLocation = "sca_storage_location"
|
||||
|
||||
// ScaStorageLocation mapped from table <sca_storage_location>
|
||||
// ScaStorageLocation 文件地理位置信息表
|
||||
type ScaStorageLocation struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);comment:用户id" json:"user_id"` // 用户id
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaStorageTag = "sca_storage_tag"
|
||||
|
||||
// ScaStorageTag mapped from table <sca_storage_tag>
|
||||
// ScaStorageTag 标签表
|
||||
type ScaStorageTag struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
FileID int64 `gorm:"column:file_id;type:bigint(20);comment:文件ID" json:"file_id"` // 文件ID
|
||||
|
31
app/auth/model/mysql/model/sca_storage_thumb.gen.go
Normal file
31
app/auth/model/mysql/model/sca_storage_thumb.gen.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const TableNameScaStorageThumb = "sca_storage_thumb"
|
||||
|
||||
// ScaStorageThumb mapped from table <sca_storage_thumb>
|
||||
type ScaStorageThumb struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);not null;comment:用户ID" json:"user_id"` // 用户ID
|
||||
ThumbPath string `gorm:"column:thumb_path;type:text;comment:缩略图路径" json:"thumb_path"` // 缩略图路径
|
||||
ThumbW float64 `gorm:"column:thumb_w;type:double;comment:缩略图宽" json:"thumb_w"` // 缩略图宽
|
||||
ThumbH float64 `gorm:"column:thumb_h;type:double;comment:缩略图高" json:"thumb_h"` // 缩略图高
|
||||
ThumbSize float64 `gorm:"column:thumb_size;type:double;comment:缩略图大小" json:"thumb_size"` // 缩略图大小
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;autoCreateTime;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp;autoUpdateTime;comment:更新时间" json:"updated_at"` // 更新时间
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp;comment:删除时间" json:"deleted_at"` // 删除时间
|
||||
}
|
||||
|
||||
// TableName ScaStorageThumb's table name
|
||||
func (*ScaStorageThumb) TableName() string {
|
||||
return TableNameScaStorageThumb
|
||||
}
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaUserFollow = "sca_user_follows"
|
||||
|
||||
// ScaUserFollow mapped from table <sca_user_follows>
|
||||
// ScaUserFollow 用户关注表
|
||||
type ScaUserFollow struct {
|
||||
FollowerID string `gorm:"column:follower_id;type:varchar(50);not null;comment:关注者" json:"follower_id"` // 关注者
|
||||
FolloweeID string `gorm:"column:followee_id;type:varchar(50);not null;comment:被关注者" json:"followee_id"` // 被关注者
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaUserLevel = "sca_user_level"
|
||||
|
||||
// ScaUserLevel mapped from table <sca_user_level>
|
||||
// ScaUserLevel 用户等级表
|
||||
type ScaUserLevel struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
UserID string `gorm:"column:user_id;type:varchar(50);comment:用户Id" json:"user_id"` // 用户Id
|
||||
|
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
const TableNameScaUserMessage = "sca_user_message"
|
||||
|
||||
// ScaUserMessage mapped from table <sca_user_message>
|
||||
// ScaUserMessage 用户消息表
|
||||
type ScaUserMessage struct {
|
||||
ID int64 `gorm:"column:id;type:bigint(20);primaryKey;autoIncrement:true;comment:主键;primary_key" json:"id,string"` // 主键
|
||||
TopicID string `gorm:"column:topic_id;type:varchar(50);comment:话题Id" json:"topic_id"` // 话题Id
|
||||
|
@@ -23,11 +23,11 @@ func NewMySQL(url string, maxOpenConn int, maxIdleConn int, client *redis.Client
|
||||
Logger: logger.New(
|
||||
log.New(os.Stdout, "\r\n", log.LstdFlags),
|
||||
logger.Config{
|
||||
SlowThreshold: time.Second, // 慢sql日志
|
||||
LogLevel: logger.Error, // 级别
|
||||
Colorful: true, // 颜色
|
||||
IgnoreRecordNotFoundError: true, // 忽略RecordNotFoundError
|
||||
ParameterizedQueries: true, // 格式化SQL语句
|
||||
SlowThreshold: time.Second, // 慢sql日志
|
||||
LogLevel: logger.Info, // 级别
|
||||
Colorful: true, // 颜色
|
||||
IgnoreRecordNotFoundError: true, // 忽略RecordNotFoundError
|
||||
ParameterizedQueries: true, // 格式化SQL语句
|
||||
}),
|
||||
})
|
||||
if err != nil {
|
||||
@@ -41,7 +41,7 @@ func NewMySQL(url string, maxOpenConn int, maxIdleConn int, client *redis.Client
|
||||
sqlDB.SetMaxIdleConns(maxIdleConn)
|
||||
useDB := query.Use(db)
|
||||
// migrate
|
||||
Migrate(db)
|
||||
//Migrate(db)
|
||||
// cache
|
||||
gormCache, err := cache.NewGorm2Cache(&config.CacheConfig{
|
||||
CacheLevel: config.CacheLevelAll,
|
||||
|
@@ -32,6 +32,7 @@ var (
|
||||
ScaStorageLocation *scaStorageLocation
|
||||
ScaStorageTag *scaStorageTag
|
||||
ScaStorageTagInfo *scaStorageTagInfo
|
||||
ScaStorageThumb *scaStorageThumb
|
||||
ScaUserFollow *scaUserFollow
|
||||
ScaUserLevel *scaUserLevel
|
||||
ScaUserMessage *scaUserMessage
|
||||
@@ -54,6 +55,7 @@ func SetDefault(db *gorm.DB, opts ...gen.DOOption) {
|
||||
ScaStorageLocation = &Q.ScaStorageLocation
|
||||
ScaStorageTag = &Q.ScaStorageTag
|
||||
ScaStorageTagInfo = &Q.ScaStorageTagInfo
|
||||
ScaStorageThumb = &Q.ScaStorageThumb
|
||||
ScaUserFollow = &Q.ScaUserFollow
|
||||
ScaUserLevel = &Q.ScaUserLevel
|
||||
ScaUserMessage = &Q.ScaUserMessage
|
||||
@@ -77,6 +79,7 @@ func Use(db *gorm.DB, opts ...gen.DOOption) *Query {
|
||||
ScaStorageLocation: newScaStorageLocation(db, opts...),
|
||||
ScaStorageTag: newScaStorageTag(db, opts...),
|
||||
ScaStorageTagInfo: newScaStorageTagInfo(db, opts...),
|
||||
ScaStorageThumb: newScaStorageThumb(db, opts...),
|
||||
ScaUserFollow: newScaUserFollow(db, opts...),
|
||||
ScaUserLevel: newScaUserLevel(db, opts...),
|
||||
ScaUserMessage: newScaUserMessage(db, opts...),
|
||||
@@ -101,6 +104,7 @@ type Query struct {
|
||||
ScaStorageLocation scaStorageLocation
|
||||
ScaStorageTag scaStorageTag
|
||||
ScaStorageTagInfo scaStorageTagInfo
|
||||
ScaStorageThumb scaStorageThumb
|
||||
ScaUserFollow scaUserFollow
|
||||
ScaUserLevel scaUserLevel
|
||||
ScaUserMessage scaUserMessage
|
||||
@@ -126,6 +130,7 @@ func (q *Query) clone(db *gorm.DB) *Query {
|
||||
ScaStorageLocation: q.ScaStorageLocation.clone(db),
|
||||
ScaStorageTag: q.ScaStorageTag.clone(db),
|
||||
ScaStorageTagInfo: q.ScaStorageTagInfo.clone(db),
|
||||
ScaStorageThumb: q.ScaStorageThumb.clone(db),
|
||||
ScaUserFollow: q.ScaUserFollow.clone(db),
|
||||
ScaUserLevel: q.ScaUserLevel.clone(db),
|
||||
ScaUserMessage: q.ScaUserMessage.clone(db),
|
||||
@@ -158,6 +163,7 @@ func (q *Query) ReplaceDB(db *gorm.DB) *Query {
|
||||
ScaStorageLocation: q.ScaStorageLocation.replaceDB(db),
|
||||
ScaStorageTag: q.ScaStorageTag.replaceDB(db),
|
||||
ScaStorageTagInfo: q.ScaStorageTagInfo.replaceDB(db),
|
||||
ScaStorageThumb: q.ScaStorageThumb.replaceDB(db),
|
||||
ScaUserFollow: q.ScaUserFollow.replaceDB(db),
|
||||
ScaUserLevel: q.ScaUserLevel.replaceDB(db),
|
||||
ScaUserMessage: q.ScaUserMessage.replaceDB(db),
|
||||
@@ -180,6 +186,7 @@ type queryCtx struct {
|
||||
ScaStorageLocation IScaStorageLocationDo
|
||||
ScaStorageTag IScaStorageTagDo
|
||||
ScaStorageTagInfo IScaStorageTagInfoDo
|
||||
ScaStorageThumb IScaStorageThumbDo
|
||||
ScaUserFollow IScaUserFollowDo
|
||||
ScaUserLevel IScaUserLevelDo
|
||||
ScaUserMessage IScaUserMessageDo
|
||||
@@ -202,6 +209,7 @@ func (q *Query) WithContext(ctx context.Context) *queryCtx {
|
||||
ScaStorageLocation: q.ScaStorageLocation.WithContext(ctx),
|
||||
ScaStorageTag: q.ScaStorageTag.WithContext(ctx),
|
||||
ScaStorageTagInfo: q.ScaStorageTagInfo.WithContext(ctx),
|
||||
ScaStorageThumb: q.ScaStorageThumb.WithContext(ctx),
|
||||
ScaUserFollow: q.ScaUserFollow.WithContext(ctx),
|
||||
ScaUserLevel: q.ScaUserLevel.WithContext(ctx),
|
||||
ScaUserMessage: q.ScaUserMessage.WithContext(ctx),
|
||||
|
@@ -46,6 +46,7 @@ func newScaAuthMenu(db *gorm.DB, opts ...gen.DOOption) scaAuthMenu {
|
||||
return _scaAuthMenu
|
||||
}
|
||||
|
||||
// scaAuthMenu 菜单表
|
||||
type scaAuthMenu struct {
|
||||
scaAuthMenuDo
|
||||
|
||||
|
@@ -41,6 +41,7 @@ func newScaAuthPermissionRule(db *gorm.DB, opts ...gen.DOOption) scaAuthPermissi
|
||||
return _scaAuthPermissionRule
|
||||
}
|
||||
|
||||
// scaAuthPermissionRule 接口权限表
|
||||
type scaAuthPermissionRule struct {
|
||||
scaAuthPermissionRuleDo
|
||||
|
||||
|
@@ -39,6 +39,7 @@ func newScaAuthRole(db *gorm.DB, opts ...gen.DOOption) scaAuthRole {
|
||||
return _scaAuthRole
|
||||
}
|
||||
|
||||
// scaAuthRole 角色表
|
||||
type scaAuthRole struct {
|
||||
scaAuthRoleDo
|
||||
|
||||
|
@@ -50,6 +50,7 @@ func newScaAuthUser(db *gorm.DB, opts ...gen.DOOption) scaAuthUser {
|
||||
return _scaAuthUser
|
||||
}
|
||||
|
||||
// scaAuthUser 用户表
|
||||
type scaAuthUser struct {
|
||||
scaAuthUserDo
|
||||
|
||||
|
@@ -50,6 +50,7 @@ func newScaAuthUserDevice(db *gorm.DB, opts ...gen.DOOption) scaAuthUserDevice {
|
||||
return _scaAuthUserDevice
|
||||
}
|
||||
|
||||
// scaAuthUserDevice 用户设备表
|
||||
type scaAuthUserDevice struct {
|
||||
scaAuthUserDeviceDo
|
||||
|
||||
|
@@ -41,6 +41,7 @@ func newScaAuthUserSocial(db *gorm.DB, opts ...gen.DOOption) scaAuthUserSocial {
|
||||
return _scaAuthUserSocial
|
||||
}
|
||||
|
||||
// scaAuthUserSocial 第三方登录信息表
|
||||
type scaAuthUserSocial struct {
|
||||
scaAuthUserSocialDo
|
||||
|
||||
|
@@ -38,6 +38,7 @@ func newScaCommentLike(db *gorm.DB, opts ...gen.DOOption) scaCommentLike {
|
||||
return _scaCommentLike
|
||||
}
|
||||
|
||||
// scaCommentLike 评论点赞表
|
||||
type scaCommentLike struct {
|
||||
scaCommentLikeDo
|
||||
|
||||
|
@@ -55,6 +55,7 @@ func newScaCommentReply(db *gorm.DB, opts ...gen.DOOption) scaCommentReply {
|
||||
return _scaCommentReply
|
||||
}
|
||||
|
||||
// scaCommentReply 评论表
|
||||
type scaCommentReply struct {
|
||||
scaCommentReplyDo
|
||||
|
||||
|
@@ -45,6 +45,7 @@ func newScaMessageReport(db *gorm.DB, opts ...gen.DOOption) scaMessageReport {
|
||||
return _scaMessageReport
|
||||
}
|
||||
|
||||
// scaMessageReport 评论举报表
|
||||
type scaMessageReport struct {
|
||||
scaMessageReportDo
|
||||
|
||||
|
@@ -41,6 +41,7 @@ func newScaStorageAlbum(db *gorm.DB, opts ...gen.DOOption) scaStorageAlbum {
|
||||
return _scaStorageAlbum
|
||||
}
|
||||
|
||||
// scaStorageAlbum 相册信息表
|
||||
type scaStorageAlbum struct {
|
||||
scaStorageAlbumDo
|
||||
|
||||
|
@@ -44,6 +44,7 @@ func newScaStorageConfig(db *gorm.DB, opts ...gen.DOOption) scaStorageConfig {
|
||||
return _scaStorageConfig
|
||||
}
|
||||
|
||||
// scaStorageConfig 用户存储配置表
|
||||
type scaStorageConfig struct {
|
||||
scaStorageConfigDo
|
||||
|
||||
|
@@ -37,6 +37,7 @@ func newScaStorageInfo(db *gorm.DB, opts ...gen.DOOption) scaStorageInfo {
|
||||
_scaStorageInfo.FileType = field.NewString(tableName, "file_type")
|
||||
_scaStorageInfo.Width = field.NewFloat64(tableName, "width")
|
||||
_scaStorageInfo.Height = field.NewFloat64(tableName, "height")
|
||||
_scaStorageInfo.ThumbID = field.NewInt64(tableName, "thumb_id")
|
||||
_scaStorageInfo.Category = field.NewString(tableName, "category")
|
||||
_scaStorageInfo.Tag = field.NewString(tableName, "tag")
|
||||
_scaStorageInfo.Type = field.NewString(tableName, "type")
|
||||
@@ -56,6 +57,7 @@ func newScaStorageInfo(db *gorm.DB, opts ...gen.DOOption) scaStorageInfo {
|
||||
return _scaStorageInfo
|
||||
}
|
||||
|
||||
// scaStorageInfo 文件存储信息表
|
||||
type scaStorageInfo struct {
|
||||
scaStorageInfoDo
|
||||
|
||||
@@ -70,6 +72,7 @@ type scaStorageInfo struct {
|
||||
FileType field.String // 文件类型
|
||||
Width field.Float64 // 宽
|
||||
Height field.Float64 // 高
|
||||
ThumbID field.Int64 // 缩略图id
|
||||
Category field.String // 分类
|
||||
Tag field.String // 标签
|
||||
Type field.String // 类型
|
||||
@@ -109,6 +112,7 @@ func (s *scaStorageInfo) updateTableName(table string) *scaStorageInfo {
|
||||
s.FileType = field.NewString(table, "file_type")
|
||||
s.Width = field.NewFloat64(table, "width")
|
||||
s.Height = field.NewFloat64(table, "height")
|
||||
s.ThumbID = field.NewInt64(table, "thumb_id")
|
||||
s.Category = field.NewString(table, "category")
|
||||
s.Tag = field.NewString(table, "tag")
|
||||
s.Type = field.NewString(table, "type")
|
||||
@@ -138,7 +142,7 @@ func (s *scaStorageInfo) GetFieldByName(fieldName string) (field.OrderExpr, bool
|
||||
}
|
||||
|
||||
func (s *scaStorageInfo) fillFieldMap() {
|
||||
s.fieldMap = make(map[string]field.Expr, 23)
|
||||
s.fieldMap = make(map[string]field.Expr, 24)
|
||||
s.fieldMap["id"] = s.ID
|
||||
s.fieldMap["user_id"] = s.UserID
|
||||
s.fieldMap["provider"] = s.Provider
|
||||
@@ -149,6 +153,7 @@ func (s *scaStorageInfo) fillFieldMap() {
|
||||
s.fieldMap["file_type"] = s.FileType
|
||||
s.fieldMap["width"] = s.Width
|
||||
s.fieldMap["height"] = s.Height
|
||||
s.fieldMap["thumb_id"] = s.ThumbID
|
||||
s.fieldMap["category"] = s.Category
|
||||
s.fieldMap["tag"] = s.Tag
|
||||
s.fieldMap["type"] = s.Type
|
||||
|
@@ -48,6 +48,7 @@ func newScaStorageLocation(db *gorm.DB, opts ...gen.DOOption) scaStorageLocation
|
||||
return _scaStorageLocation
|
||||
}
|
||||
|
||||
// scaStorageLocation 文件地理位置信息表
|
||||
type scaStorageLocation struct {
|
||||
scaStorageLocationDo
|
||||
|
||||
|
@@ -39,6 +39,7 @@ func newScaStorageTag(db *gorm.DB, opts ...gen.DOOption) scaStorageTag {
|
||||
return _scaStorageTag
|
||||
}
|
||||
|
||||
// scaStorageTag 标签表
|
||||
type scaStorageTag struct {
|
||||
scaStorageTagDo
|
||||
|
||||
|
412
app/auth/model/mysql/query/sca_storage_thumb.gen.go
Normal file
412
app/auth/model/mysql/query/sca_storage_thumb.gen.go
Normal file
@@ -0,0 +1,412 @@
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
// Code generated by gorm.io/gen. DO NOT EDIT.
|
||||
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gen/field"
|
||||
|
||||
"gorm.io/plugin/dbresolver"
|
||||
|
||||
"schisandra-album-cloud-microservices/app/auth/model/mysql/model"
|
||||
)
|
||||
|
||||
func newScaStorageThumb(db *gorm.DB, opts ...gen.DOOption) scaStorageThumb {
|
||||
_scaStorageThumb := scaStorageThumb{}
|
||||
|
||||
_scaStorageThumb.scaStorageThumbDo.UseDB(db, opts...)
|
||||
_scaStorageThumb.scaStorageThumbDo.UseModel(&model.ScaStorageThumb{})
|
||||
|
||||
tableName := _scaStorageThumb.scaStorageThumbDo.TableName()
|
||||
_scaStorageThumb.ALL = field.NewAsterisk(tableName)
|
||||
_scaStorageThumb.ID = field.NewInt64(tableName, "id")
|
||||
_scaStorageThumb.UserID = field.NewString(tableName, "user_id")
|
||||
_scaStorageThumb.ThumbPath = field.NewString(tableName, "thumb_path")
|
||||
_scaStorageThumb.ThumbW = field.NewFloat64(tableName, "thumb_w")
|
||||
_scaStorageThumb.ThumbH = field.NewFloat64(tableName, "thumb_h")
|
||||
_scaStorageThumb.ThumbSize = field.NewFloat64(tableName, "thumb_size")
|
||||
_scaStorageThumb.CreatedAt = field.NewTime(tableName, "created_at")
|
||||
_scaStorageThumb.UpdatedAt = field.NewTime(tableName, "updated_at")
|
||||
_scaStorageThumb.DeletedAt = field.NewField(tableName, "deleted_at")
|
||||
|
||||
_scaStorageThumb.fillFieldMap()
|
||||
|
||||
return _scaStorageThumb
|
||||
}
|
||||
|
||||
type scaStorageThumb struct {
|
||||
scaStorageThumbDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int64 // 主键
|
||||
UserID field.String // 用户ID
|
||||
ThumbPath field.String // 缩略图路径
|
||||
ThumbW field.Float64 // 缩略图宽
|
||||
ThumbH field.Float64 // 缩略图高
|
||||
ThumbSize field.Float64 // 缩略图大小
|
||||
CreatedAt field.Time // 创建时间
|
||||
UpdatedAt field.Time // 更新时间
|
||||
DeletedAt field.Field // 删除时间
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
func (s scaStorageThumb) Table(newTableName string) *scaStorageThumb {
|
||||
s.scaStorageThumbDo.UseTable(newTableName)
|
||||
return s.updateTableName(newTableName)
|
||||
}
|
||||
|
||||
func (s scaStorageThumb) As(alias string) *scaStorageThumb {
|
||||
s.scaStorageThumbDo.DO = *(s.scaStorageThumbDo.As(alias).(*gen.DO))
|
||||
return s.updateTableName(alias)
|
||||
}
|
||||
|
||||
func (s *scaStorageThumb) updateTableName(table string) *scaStorageThumb {
|
||||
s.ALL = field.NewAsterisk(table)
|
||||
s.ID = field.NewInt64(table, "id")
|
||||
s.UserID = field.NewString(table, "user_id")
|
||||
s.ThumbPath = field.NewString(table, "thumb_path")
|
||||
s.ThumbW = field.NewFloat64(table, "thumb_w")
|
||||
s.ThumbH = field.NewFloat64(table, "thumb_h")
|
||||
s.ThumbSize = field.NewFloat64(table, "thumb_size")
|
||||
s.CreatedAt = field.NewTime(table, "created_at")
|
||||
s.UpdatedAt = field.NewTime(table, "updated_at")
|
||||
s.DeletedAt = field.NewField(table, "deleted_at")
|
||||
|
||||
s.fillFieldMap()
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *scaStorageThumb) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
||||
_f, ok := s.fieldMap[fieldName]
|
||||
if !ok || _f == nil {
|
||||
return nil, false
|
||||
}
|
||||
_oe, ok := _f.(field.OrderExpr)
|
||||
return _oe, ok
|
||||
}
|
||||
|
||||
func (s *scaStorageThumb) fillFieldMap() {
|
||||
s.fieldMap = make(map[string]field.Expr, 9)
|
||||
s.fieldMap["id"] = s.ID
|
||||
s.fieldMap["user_id"] = s.UserID
|
||||
s.fieldMap["thumb_path"] = s.ThumbPath
|
||||
s.fieldMap["thumb_w"] = s.ThumbW
|
||||
s.fieldMap["thumb_h"] = s.ThumbH
|
||||
s.fieldMap["thumb_size"] = s.ThumbSize
|
||||
s.fieldMap["created_at"] = s.CreatedAt
|
||||
s.fieldMap["updated_at"] = s.UpdatedAt
|
||||
s.fieldMap["deleted_at"] = s.DeletedAt
|
||||
}
|
||||
|
||||
func (s scaStorageThumb) clone(db *gorm.DB) scaStorageThumb {
|
||||
s.scaStorageThumbDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
return s
|
||||
}
|
||||
|
||||
func (s scaStorageThumb) replaceDB(db *gorm.DB) scaStorageThumb {
|
||||
s.scaStorageThumbDo.ReplaceDB(db)
|
||||
return s
|
||||
}
|
||||
|
||||
type scaStorageThumbDo struct{ gen.DO }
|
||||
|
||||
type IScaStorageThumbDo interface {
|
||||
gen.SubQuery
|
||||
Debug() IScaStorageThumbDo
|
||||
WithContext(ctx context.Context) IScaStorageThumbDo
|
||||
WithResult(fc func(tx gen.Dao)) gen.ResultInfo
|
||||
ReplaceDB(db *gorm.DB)
|
||||
ReadDB() IScaStorageThumbDo
|
||||
WriteDB() IScaStorageThumbDo
|
||||
As(alias string) gen.Dao
|
||||
Session(config *gorm.Session) IScaStorageThumbDo
|
||||
Columns(cols ...field.Expr) gen.Columns
|
||||
Clauses(conds ...clause.Expression) IScaStorageThumbDo
|
||||
Not(conds ...gen.Condition) IScaStorageThumbDo
|
||||
Or(conds ...gen.Condition) IScaStorageThumbDo
|
||||
Select(conds ...field.Expr) IScaStorageThumbDo
|
||||
Where(conds ...gen.Condition) IScaStorageThumbDo
|
||||
Order(conds ...field.Expr) IScaStorageThumbDo
|
||||
Distinct(cols ...field.Expr) IScaStorageThumbDo
|
||||
Omit(cols ...field.Expr) IScaStorageThumbDo
|
||||
Join(table schema.Tabler, on ...field.Expr) IScaStorageThumbDo
|
||||
LeftJoin(table schema.Tabler, on ...field.Expr) IScaStorageThumbDo
|
||||
RightJoin(table schema.Tabler, on ...field.Expr) IScaStorageThumbDo
|
||||
Group(cols ...field.Expr) IScaStorageThumbDo
|
||||
Having(conds ...gen.Condition) IScaStorageThumbDo
|
||||
Limit(limit int) IScaStorageThumbDo
|
||||
Offset(offset int) IScaStorageThumbDo
|
||||
Count() (count int64, err error)
|
||||
Scopes(funcs ...func(gen.Dao) gen.Dao) IScaStorageThumbDo
|
||||
Unscoped() IScaStorageThumbDo
|
||||
Create(values ...*model.ScaStorageThumb) error
|
||||
CreateInBatches(values []*model.ScaStorageThumb, batchSize int) error
|
||||
Save(values ...*model.ScaStorageThumb) error
|
||||
First() (*model.ScaStorageThumb, error)
|
||||
Take() (*model.ScaStorageThumb, error)
|
||||
Last() (*model.ScaStorageThumb, error)
|
||||
Find() ([]*model.ScaStorageThumb, error)
|
||||
FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ScaStorageThumb, err error)
|
||||
FindInBatches(result *[]*model.ScaStorageThumb, batchSize int, fc func(tx gen.Dao, batch int) error) error
|
||||
Pluck(column field.Expr, dest interface{}) error
|
||||
Delete(...*model.ScaStorageThumb) (info gen.ResultInfo, err error)
|
||||
Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
|
||||
UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
|
||||
Updates(value interface{}) (info gen.ResultInfo, err error)
|
||||
UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
|
||||
UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
|
||||
UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
|
||||
UpdateFrom(q gen.SubQuery) gen.Dao
|
||||
Attrs(attrs ...field.AssignExpr) IScaStorageThumbDo
|
||||
Assign(attrs ...field.AssignExpr) IScaStorageThumbDo
|
||||
Joins(fields ...field.RelationField) IScaStorageThumbDo
|
||||
Preload(fields ...field.RelationField) IScaStorageThumbDo
|
||||
FirstOrInit() (*model.ScaStorageThumb, error)
|
||||
FirstOrCreate() (*model.ScaStorageThumb, error)
|
||||
FindByPage(offset int, limit int) (result []*model.ScaStorageThumb, count int64, err error)
|
||||
ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
|
||||
Scan(result interface{}) (err error)
|
||||
Returning(value interface{}, columns ...string) IScaStorageThumbDo
|
||||
UnderlyingDB() *gorm.DB
|
||||
schema.Tabler
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Debug() IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Debug())
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) WithContext(ctx context.Context) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.WithContext(ctx))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) ReadDB() IScaStorageThumbDo {
|
||||
return s.Clauses(dbresolver.Read)
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) WriteDB() IScaStorageThumbDo {
|
||||
return s.Clauses(dbresolver.Write)
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Session(config *gorm.Session) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Session(config))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Clauses(conds ...clause.Expression) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Clauses(conds...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Returning(value interface{}, columns ...string) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Returning(value, columns...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Not(conds ...gen.Condition) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Not(conds...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Or(conds ...gen.Condition) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Or(conds...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Select(conds ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Select(conds...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Where(conds ...gen.Condition) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Where(conds...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Order(conds ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Order(conds...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Distinct(cols ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Distinct(cols...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Omit(cols ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Omit(cols...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Join(table schema.Tabler, on ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Join(table, on...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) LeftJoin(table schema.Tabler, on ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.LeftJoin(table, on...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) RightJoin(table schema.Tabler, on ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.RightJoin(table, on...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Group(cols ...field.Expr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Group(cols...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Having(conds ...gen.Condition) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Having(conds...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Limit(limit int) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Limit(limit))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Offset(offset int) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Offset(offset))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Scopes(funcs...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Unscoped() IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Unscoped())
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Create(values ...*model.ScaStorageThumb) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return s.DO.Create(values)
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) CreateInBatches(values []*model.ScaStorageThumb, batchSize int) error {
|
||||
return s.DO.CreateInBatches(values, batchSize)
|
||||
}
|
||||
|
||||
// Save : !!! underlying implementation is different with GORM
|
||||
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
||||
func (s scaStorageThumbDo) Save(values ...*model.ScaStorageThumb) error {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
return s.DO.Save(values)
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) First() (*model.ScaStorageThumb, error) {
|
||||
if result, err := s.DO.First(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.ScaStorageThumb), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Take() (*model.ScaStorageThumb, error) {
|
||||
if result, err := s.DO.Take(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.ScaStorageThumb), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Last() (*model.ScaStorageThumb, error) {
|
||||
if result, err := s.DO.Last(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.ScaStorageThumb), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Find() ([]*model.ScaStorageThumb, error) {
|
||||
result, err := s.DO.Find()
|
||||
return result.([]*model.ScaStorageThumb), err
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.ScaStorageThumb, err error) {
|
||||
buf := make([]*model.ScaStorageThumb, 0, batchSize)
|
||||
err = s.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
||||
defer func() { results = append(results, buf...) }()
|
||||
return fc(tx, batch)
|
||||
})
|
||||
return results, err
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) FindInBatches(result *[]*model.ScaStorageThumb, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
||||
return s.DO.FindInBatches(result, batchSize, fc)
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Attrs(attrs ...field.AssignExpr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Attrs(attrs...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Assign(attrs ...field.AssignExpr) IScaStorageThumbDo {
|
||||
return s.withDO(s.DO.Assign(attrs...))
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Joins(fields ...field.RelationField) IScaStorageThumbDo {
|
||||
for _, _f := range fields {
|
||||
s = *s.withDO(s.DO.Joins(_f))
|
||||
}
|
||||
return &s
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Preload(fields ...field.RelationField) IScaStorageThumbDo {
|
||||
for _, _f := range fields {
|
||||
s = *s.withDO(s.DO.Preload(_f))
|
||||
}
|
||||
return &s
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) FirstOrInit() (*model.ScaStorageThumb, error) {
|
||||
if result, err := s.DO.FirstOrInit(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.ScaStorageThumb), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) FirstOrCreate() (*model.ScaStorageThumb, error) {
|
||||
if result, err := s.DO.FirstOrCreate(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return result.(*model.ScaStorageThumb), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) FindByPage(offset int, limit int) (result []*model.ScaStorageThumb, count int64, err error) {
|
||||
result, err = s.Offset(offset).Limit(limit).Find()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if size := len(result); 0 < limit && 0 < size && size < limit {
|
||||
count = int64(size + offset)
|
||||
return
|
||||
}
|
||||
|
||||
count, err = s.Offset(-1).Limit(-1).Count()
|
||||
return
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
||||
count, err = s.Count()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = s.Offset(offset).Limit(limit).Scan(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Scan(result interface{}) (err error) {
|
||||
return s.DO.Scan(result)
|
||||
}
|
||||
|
||||
func (s scaStorageThumbDo) Delete(models ...*model.ScaStorageThumb) (result gen.ResultInfo, err error) {
|
||||
return s.DO.Delete(models)
|
||||
}
|
||||
|
||||
func (s *scaStorageThumbDo) withDO(do gen.Dao) *scaStorageThumbDo {
|
||||
s.DO = *do.(*gen.DO)
|
||||
return s
|
||||
}
|
@@ -40,6 +40,7 @@ func newScaUserFollow(db *gorm.DB, opts ...gen.DOOption) scaUserFollow {
|
||||
return _scaUserFollow
|
||||
}
|
||||
|
||||
// scaUserFollow 用户关注表
|
||||
type scaUserFollow struct {
|
||||
scaUserFollowDo
|
||||
|
||||
|
@@ -44,6 +44,7 @@ func newScaUserLevel(db *gorm.DB, opts ...gen.DOOption) scaUserLevel {
|
||||
return _scaUserLevel
|
||||
}
|
||||
|
||||
// scaUserLevel 用户等级表
|
||||
type scaUserLevel struct {
|
||||
scaUserLevelDo
|
||||
|
||||
|
@@ -42,6 +42,7 @@ func newScaUserMessage(db *gorm.DB, opts ...gen.DOOption) scaUserMessage {
|
||||
return _scaUserMessage
|
||||
}
|
||||
|
||||
// scaUserMessage 用户消息表
|
||||
type scaUserMessage struct {
|
||||
scaUserMessageDo
|
||||
|
||||
|
Reference in New Issue
Block a user