Documentation
¶
Index ¶
- Constants
- func Pager(page uint64, pageSize uint64) func(db *gorm.DB) *gorm.DB
- func QueryPager(db *gorm.DB, model interface{}, rows interface{}, order string, page uint64, ...) (*pager.Pager, error)
- type Device
- type DeviceAck
- type Feed
- type FeedImage
- type FeedLike
- type FeedVideo
- type Gid
- type GoadminMenu
- type GoadminOperationLog
- type GoadminPermission
- type GoadminRole
- type GoadminRoleMenu
- type GoadminRolePermission
- type GoadminRoleUser
- type GoadminSession
- type GoadminSite
- type GoadminUser
- type GoadminUserPermission
- type Group
- type GroupUser
- type MessageContent
- type MessageIndex
- type User
Constants ¶
const TableNameDevice = "device"
const TableNameDeviceAck = "device_ack"
const TableNameFeed = "feed"
const TableNameFeedImage = "feed_image"
const TableNameFeedLike = "feed_like"
const TableNameFeedVideo = "feed_video"
const TableNameGid = "gid"
const TableNameGoadminMenu = "goadmin_menu"
const TableNameGoadminOperationLog = "goadmin_operation_log"
const TableNameGoadminPermission = "goadmin_permissions"
const TableNameGoadminRole = "goadmin_roles"
const TableNameGoadminRoleMenu = "goadmin_role_menu"
const TableNameGoadminRolePermission = "goadmin_role_permissions"
const TableNameGoadminRoleUser = "goadmin_role_users"
const TableNameGoadminSession = "goadmin_session"
const TableNameGoadminSite = "goadmin_site"
const TableNameGoadminUser = "goadmin_users"
const TableNameGoadminUserPermission = "goadmin_user_permissions"
const TableNameGroup = "group"
const TableNameGroupUser = "group_user"
const TableNameMessageContent = "message_content"
const TableNameMessageIndex = "message_index"
const TableNameUser = "user"
Variables ¶
This section is empty.
Functions ¶
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Source Files
¶
- base.method.go
- device.gen.go
- device_ack.gen.go
- feed.gen.go
- feed_image.gen.go
- feed_like.gen.go
- feed_video.gen.go
- gid.gen.go
- goadmin_menu.gen.go
- goadmin_operation_log.gen.go
- goadmin_permissions.gen.go
- goadmin_role_menu.gen.go
- goadmin_role_permissions.gen.go
- goadmin_role_users.gen.go
- goadmin_roles.gen.go
- goadmin_session.gen.go
- goadmin_site.gen.go
- goadmin_user_permissions.gen.go
- goadmin_users.gen.go
- group.gen.go
- group_user.gen.go
- message_content.gen.go
- message_index.gen.go
- user.gen.go