model

package
v0.0.0-...-7604275 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameDevice = "device"
View Source
const TableNameDeviceAck = "device_ack"
View Source
const TableNameFeed = "feed"
View Source
const TableNameFeedImage = "feed_image"
View Source
const TableNameFeedLike = "feed_like"
View Source
const TableNameFeedVideo = "feed_video"
View Source
const TableNameGid = "gid"
View Source
const TableNameGoadminMenu = "goadmin_menu"
View Source
const TableNameGoadminOperationLog = "goadmin_operation_log"
View Source
const TableNameGoadminPermission = "goadmin_permissions"
View Source
const TableNameGoadminRole = "goadmin_roles"
View Source
const TableNameGoadminRoleMenu = "goadmin_role_menu"
View Source
const TableNameGoadminRolePermission = "goadmin_role_permissions"
View Source
const TableNameGoadminRoleUser = "goadmin_role_users"
View Source
const TableNameGoadminSession = "goadmin_session"
View Source
const TableNameGoadminSite = "goadmin_site"
View Source
const TableNameGoadminUser = "goadmin_users"
View Source
const TableNameGoadminUserPermission = "goadmin_user_permissions"
View Source
const TableNameGroup = "group"
View Source
const TableNameGroupUser = "group_user"
View Source
const TableNameMessageContent = "message_content"
View Source
const TableNameMessageIndex = "message_index"
View Source
const TableNameUser = "user"

Variables

This section is empty.

Functions

func Pager

func Pager(page uint64, pageSize uint64) func(db *gorm.DB) *gorm.DB

func QueryPager

func QueryPager(db *gorm.DB, model interface{}, rows interface{}, order string, page uint64, pageSize uint64, where string, whereValue ...interface{}) (*pager.Pager, error)

Types

type Device

type Device struct {
	ID            int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`                        // 自增主键
	DeviceID      int64     `gorm:"column:device_id;not null" json:"device_id"`                               // 设备id
	AppID         int64     `gorm:"column:app_id;not null" json:"app_id"`                                     // app_id
	UserID        int64     `gorm:"column:user_id;not null" json:"user_id"`                                   // 账户id
	Type          int32     `gorm:"column:type;not null" json:"type"`                                         // 设备类型,1:Android;2:IOS;3:Windows; 4:MacOS;5:Web
	Brand         string    `gorm:"column:brand;not null" json:"brand"`                                       // 手机厂商
	Model         string    `gorm:"column:model;not null" json:"model"`                                       // 机型
	SystemVersion string    `gorm:"column:system_version;not null" json:"system_version"`                     // 系统版本
	SdkVersion    string    `gorm:"column:sdk_version;not null" json:"sdk_version"`                           // app版本
	Status        int32     `gorm:"column:status;not null" json:"status"`                                     // 在线状态,0:离线;1:在线
	ConnAddr      string    `gorm:"column:conn_addr;not null" json:"conn_addr"`                               // 连接层服务器地址
	ConnFd        int64     `gorm:"column:conn_fd;not null" json:"conn_fd"`                                   // TCP连接对应的文件描述符
	CreateTime    time.Time `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP" json:"create_time"` // 创建时间
	UpdateTime    time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP" json:"update_time"` // 更新时间
}

Device mapped from table <device>

func (*Device) TableName

func (*Device) TableName() string

TableName Device's table name

type DeviceAck

type DeviceAck struct {
	ID         int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`                        // 自增主键
	DeviceID   int64     `gorm:"column:device_id;not null" json:"device_id"`                               // 设备id
	Ack        int64     `gorm:"column:ack;not null" json:"ack"`                                           // 收到消息确认号
	CreateTime time.Time `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP" json:"create_time"` // 创建时间
	UpdateTime time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP" json:"update_time"` // 更新时间
}

DeviceAck mapped from table <device_ack>

func (*DeviceAck) TableName

func (*DeviceAck) TableName() string

TableName DeviceAck's table name

type Feed

type Feed struct {
	ID           int64          `gorm:"column:id;primaryKey" json:"id"`                       // 动态 ID
	UserID       int64          `gorm:"column:user_id;not null" json:"user_id"`               // 用户ID
	Content      string         `gorm:"column:content;not null" json:"content"`               // 动态内容
	Type         int32          `gorm:"column:type;not null" json:"type"`                     // 动态类型
	LikeCount    int32          `gorm:"column:like_count;not null" json:"like_count"`         // 动态点赞数
	ViewCount    int32          `gorm:"column:view_count;not null" json:"view_count"`         // 动态阅读数
	CommentCount int32          `gorm:"column:comment_count;not null" json:"comment_count"`   // 动态评论数
	Operator     int64          `gorm:"column:operator;not null" json:"operator"`             // 审核人
	Remark       string         `gorm:"column:remark;not null" json:"remark"`                 // 备注
	Hot          int64          `gorm:"column:hot;not null" json:"hot"`                       // 热门排序值
	IsEnable     int32          `gorm:"column:is_enable;not null;default:1" json:"is_enable"` // 是否启用
	ReviewStatus int32          `gorm:"column:review_status;not null" json:"review_status"`   // 审核状态 0-未审核 1-已审核 2-未通过
	CreatedAt    time.Time      `gorm:"column:created_at" json:"created_at"`
	UpdatedAt    time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

Feed mapped from table <feed>

func (*Feed) TableName

func (*Feed) TableName() string

TableName Feed's table name

type FeedImage

type FeedImage struct {
	ID        int64          `gorm:"column:id;primaryKey" json:"id"`         // ID
	FeedID    int64          `gorm:"column:feed_id;not null" json:"feed_id"` // 动态ID
	ImgURL    string         `gorm:"column:img_url;not null" json:"img_url"` // 图片URL
	CreatedAt time.Time      `gorm:"column:created_at" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

FeedImage mapped from table <feed_image>

func (*FeedImage) TableName

func (*FeedImage) TableName() string

TableName FeedImage's table name

type FeedLike

type FeedLike struct {
	ID        int64          `gorm:"column:id;primaryKey" json:"id"`         // ID
	FeedID    int64          `gorm:"column:feed_id;not null" json:"feed_id"` // 动态ID
	UserID    int64          `gorm:"column:user_id;not null" json:"user_id"` // 用户ID
	CreatedAt time.Time      `gorm:"column:created_at" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

FeedLike mapped from table <feed_like>

func (*FeedLike) TableName

func (*FeedLike) TableName() string

TableName FeedLike's table name

type FeedVideo

type FeedVideo struct {
	ID        int32          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	FeedID    int32          `gorm:"column:feed_id;not null" json:"feed_id"`     // 所属动态id
	VideoURL  string         `gorm:"column:video_url;not null" json:"video_url"` // 视频URL
	CoverURL  string         `gorm:"column:cover_url;not null" json:"cover_url"` // 视频封面URL
	Height    int32          `gorm:"column:height;not null" json:"height"`       // 视频高度
	Width     int32          `gorm:"column:width;not null" json:"width"`         // 视频宽度
	Duration  float32        `gorm:"column:duration;not null" json:"duration"`   // 视频时长
	CreatedAt time.Time      `gorm:"column:created_at" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

FeedVideo mapped from table <feed_video>

func (*FeedVideo) TableName

func (*FeedVideo) TableName() string

TableName FeedVideo's table name

type Gid

type Gid struct {
	ID          int64     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`                        // 自增主键
	BusinessID  string    `gorm:"column:business_id;not null" json:"business_id"`                           // 业务id
	MaxID       int64     `gorm:"column:max_id;not null" json:"max_id"`                                     // 最大id
	Step        int32     `gorm:"column:step;not null;default:1000" json:"step"`                            // 步长
	Description string    `gorm:"column:description;not null" json:"description"`                           // 描述
	CreateTime  time.Time `gorm:"column:create_time;not null;default:CURRENT_TIMESTAMP" json:"create_time"` // 创建时间
	UpdateTime  time.Time `gorm:"column:update_time;not null;default:CURRENT_TIMESTAMP" json:"update_time"` // 更新时间
}

Gid mapped from table <gid>

func (*Gid) TableName

func (*Gid) TableName() string

TableName Gid's table name

type GoadminMenu

type GoadminMenu struct {
	ID         int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	ParentID   int32     `gorm:"column:parent_id;not null" json:"parent_id"`
	Type       int32     `gorm:"column:type;not null" json:"type"`
	Order      int32     `gorm:"column:order;not null" json:"order"`
	Title      string    `gorm:"column:title;not null" json:"title"`
	Icon       string    `gorm:"column:icon;not null" json:"icon"`
	URI        string    `gorm:"column:uri;not null" json:"uri"`
	Header     string    `gorm:"column:header" json:"header"`
	PluginName string    `gorm:"column:plugin_name;not null" json:"plugin_name"`
	UUID       string    `gorm:"column:uuid" json:"uuid"`
	CreatedAt  time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt  time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminMenu mapped from table <goadmin_menu>

func (*GoadminMenu) TableName

func (*GoadminMenu) TableName() string

TableName GoadminMenu's table name

type GoadminOperationLog

type GoadminOperationLog struct {
	ID        int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UserID    int32     `gorm:"column:user_id;not null" json:"user_id"`
	Path      string    `gorm:"column:path;not null" json:"path"`
	Method    string    `gorm:"column:method;not null" json:"method"`
	IP        string    `gorm:"column:ip;not null" json:"ip"`
	Input     string    `gorm:"column:input;not null" json:"input"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminOperationLog mapped from table <goadmin_operation_log>

func (*GoadminOperationLog) TableName

func (*GoadminOperationLog) TableName() string

TableName GoadminOperationLog's table name

type GoadminPermission

type GoadminPermission struct {
	ID         int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name       string    `gorm:"column:name;not null" json:"name"`
	Slug       string    `gorm:"column:slug;not null" json:"slug"`
	HTTPMethod string    `gorm:"column:http_method" json:"http_method"`
	HTTPPath   string    `gorm:"column:http_path;not null" json:"http_path"`
	CreatedAt  time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt  time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminPermission mapped from table <goadmin_permissions>

func (*GoadminPermission) TableName

func (*GoadminPermission) TableName() string

TableName GoadminPermission's table name

type GoadminRole

type GoadminRole struct {
	ID        int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Slug      string    `gorm:"column:slug;not null" json:"slug"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminRole mapped from table <goadmin_roles>

func (*GoadminRole) TableName

func (*GoadminRole) TableName() string

TableName GoadminRole's table name

type GoadminRoleMenu

type GoadminRoleMenu struct {
	RoleID    int32     `gorm:"column:role_id;not null" json:"role_id"`
	MenuID    int32     `gorm:"column:menu_id;not null" json:"menu_id"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminRoleMenu mapped from table <goadmin_role_menu>

func (*GoadminRoleMenu) TableName

func (*GoadminRoleMenu) TableName() string

TableName GoadminRoleMenu's table name

type GoadminRolePermission

type GoadminRolePermission struct {
	RoleID       int32     `gorm:"column:role_id;primaryKey" json:"role_id"`
	PermissionID int32     `gorm:"column:permission_id;primaryKey" json:"permission_id"`
	CreatedAt    time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt    time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminRolePermission mapped from table <goadmin_role_permissions>

func (*GoadminRolePermission) TableName

func (*GoadminRolePermission) TableName() string

TableName GoadminRolePermission's table name

type GoadminRoleUser

type GoadminRoleUser struct {
	RoleID    int32     `gorm:"column:role_id;primaryKey" json:"role_id"`
	UserID    int32     `gorm:"column:user_id;primaryKey" json:"user_id"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminRoleUser mapped from table <goadmin_role_users>

func (*GoadminRoleUser) TableName

func (*GoadminRoleUser) TableName() string

TableName GoadminRoleUser's table name

type GoadminSession

type GoadminSession struct {
	ID        int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Sid       string    `gorm:"column:sid;not null" json:"sid"`
	Values    string    `gorm:"column:values;not null" json:"values"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminSession mapped from table <goadmin_session>

func (*GoadminSession) TableName

func (*GoadminSession) TableName() string

TableName GoadminSession's table name

type GoadminSite

type GoadminSite struct {
	ID          int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Key         string    `gorm:"column:key" json:"key"`
	Value       string    `gorm:"column:value" json:"value"`
	Description string    `gorm:"column:description" json:"description"`
	State       int32     `gorm:"column:state;not null" json:"state"`
	CreatedAt   time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminSite mapped from table <goadmin_site>

func (*GoadminSite) TableName

func (*GoadminSite) TableName() string

TableName GoadminSite's table name

type GoadminUser

type GoadminUser struct {
	ID            int32     `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Username      string    `gorm:"column:username;not null" json:"username"`
	Password      string    `gorm:"column:password;not null" json:"password"`
	Name          string    `gorm:"column:name;not null" json:"name"`
	Avatar        string    `gorm:"column:avatar" json:"avatar"`
	RememberToken string    `gorm:"column:remember_token" json:"remember_token"`
	CreatedAt     time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt     time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminUser mapped from table <goadmin_users>

func (*GoadminUser) TableName

func (*GoadminUser) TableName() string

TableName GoadminUser's table name

type GoadminUserPermission

type GoadminUserPermission struct {
	UserID       int32     `gorm:"column:user_id;primaryKey" json:"user_id"`
	PermissionID int32     `gorm:"column:permission_id;primaryKey" json:"permission_id"`
	CreatedAt    time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt    time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
}

GoadminUserPermission mapped from table <goadmin_user_permissions>

func (*GoadminUserPermission) TableName

func (*GoadminUserPermission) TableName() string

TableName GoadminUserPermission's table name

type Group

type Group struct {
	ID           int64          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` // 自增主键
	Name         string         `gorm:"column:name;not null" json:"name"`                  // 群组名称
	Introduction string         `gorm:"column:introduction;not null" json:"introduction"`  // 群组简介
	Extra        string         `gorm:"column:extra;not null" json:"extra"`                // 附加属性
	AtavarURL    string         `gorm:"column:atavar_url;not null" json:"atavar_url"`      // 头像
	UserID       int64          `gorm:"column:user_id;not null" json:"user_id"`            // 群主ID
	CreatedAt    time.Time      `gorm:"column:created_at" json:"created_at"`               // 创建时间
	UpdatedAt    time.Time      `gorm:"column:updated_at" json:"updated_at"`               // 更新时间
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`               // 删除时间
}

Group mapped from table <group>

func (*Group) TableName

func (*Group) TableName() string

TableName Group's table name

type GroupUser

type GroupUser struct {
	ID           int64          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`    // 自增主键
	GroupID      int64          `gorm:"column:group_id;not null" json:"group_id"`             // 组id
	UserID       int64          `gorm:"column:user_id;not null" json:"user_id"`               // 用户id
	UserShowName string         `gorm:"column:user_show_name;not null" json:"user_show_name"` // 用户在群组的昵称
	Extra        string         `gorm:"column:extra;not null" json:"extra"`                   // 附加属性
	CreatedAt    time.Time      `gorm:"column:created_at" json:"created_at"`                  // 创建时间
	UpdatedAt    time.Time      `gorm:"column:updated_at" json:"updated_at"`                  // 更新时间
	DeletedAt    gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`                  // 删除时间
}

GroupUser mapped from table <group_user>

func (*GroupUser) TableName

func (*GroupUser) TableName() string

TableName GroupUser's table name

type MessageContent

type MessageContent struct {
	ID        int64          `gorm:"column:id;primaryKey" json:"id"`
	Type      int32          `gorm:"column:type;not null" json:"type"`    // 消息类型
	Body      string         `gorm:"column:body;not null" json:"body"`    // 内容
	Extra     string         `gorm:"column:extra;not null" json:"extra"`  // 扩展
	CreatedAt time.Time      `gorm:"column:created_at" json:"created_at"` // 创建时间
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at"` // 更新时间
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"` // 删除时间
}

MessageContent mapped from table <message_content>

func (*MessageContent) TableName

func (*MessageContent) TableName() string

TableName MessageContent's table name

type MessageIndex

type MessageIndex struct {
	ID               int64          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	SenderID         int64          `gorm:"column:sender_id;not null" json:"sender_id"`                   // 发送人ID
	ReceiverID       int64          `gorm:"column:receiver_id;not null" json:"receiver_id"`               // 接收人ID
	MessageContentID int64          `gorm:"column:message_content_id;not null" json:"message_content_id"` // 消息ID
	GroupID          int64          `gorm:"column:group_id;not null" json:"group_id"`                     // 群ID
	Status           int32          `gorm:"column:status;not null;default:1" json:"status"`               // 状态:1-待送达,2-已送到,3-已确认,0-已删除
	CreatedAt        time.Time      `gorm:"column:created_at" json:"created_at"`                          // 创建时间
	UpdatedAt        time.Time      `gorm:"column:updated_at" json:"updated_at"`                          // 更新时间
	DeletedAt        gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`                          // 删除时间
}

MessageIndex mapped from table <message_index>

func (*MessageIndex) TableName

func (*MessageIndex) TableName() string

TableName MessageIndex's table name

type User

type User struct {
	ID        int64          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` // 自增主键
	Nickname  string         `gorm:"column:nickname;not null" json:"nickname"`          // 昵称
	Password  string         `gorm:"column:password;not null" json:"password"`          // 密码
	Gender    string         `gorm:"column:gender;not null" json:"gender"`              // 性别,0:未知;1:男;2:女
	AvatarURL string         `gorm:"column:avatar_url;not null" json:"avatar_url"`      // 用户头像链接
	Extra     string         `gorm:"column:extra;not null" json:"extra"`                // 附加属性
	CreatedAt time.Time      `gorm:"column:created_at" json:"created_at"`               // 创建时间
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at"`               // 更新时间
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`               // 删除时间
}

User mapped from table <user>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL