model

package
v0.0.0-...-048bef2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 5 Imported by: 0

README

Models

数据模型层

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB   *gorm.DB
	Once sync.Once
)

Functions

func GetDB

func GetDB() *gorm.DB

GetDB get a db instance

func Init

func Init() (*gorm.DB, func())

Init init db

Types

type CommentContentModel

type CommentContentModel struct {
	CommentId  int64  `gorm:"column:comment_id" json:"comment_id"`
	Content    string `gorm:"column:content" json:"content"`
	DeviceType string `gorm:"column:device_type" json:"device_type"`
	IP         string `gorm:"column:ip" json:"ip"`
	CreatedAt  int64  `gorm:"column:created_at" json:"created_at"`
	UpdatedAt  int64  `gorm:"column:updated_at" json:"updated_at"`
}

func (*CommentContentModel) TableName

func (c *CommentContentModel) TableName() string

TableName sets the insert table name for this struct type

type CommentHotModel

type CommentHotModel struct {
	CommentId int64 `gorm:"column:comment_id" json:"comment_id"`
	PostID    int64 `gorm:"column:post_id" json:"post_id"`
	RootID    int64 `gorm:"column:root_id" json:"root_id"`
	ParentID  int64 `gorm:"column:parent_id" json:"parent_id"`
	UserID    int64 `gorm:"column:user_id" json:"user_id"`
	Score     int   `gorm:"column:score" json:"score"`
	DelFlag   int   `gorm:"column:del_flag" json:"del_flag"`
	CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
	UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"`
}

func (*CommentHotModel) TableName

func (c *CommentHotModel) TableName() string

TableName sets the insert table name for this struct type

type CommentInfoModel

type CommentInfoModel struct {
	ID         int64 `gorm:"column:id" json:"id"`
	PostId     int64 `gorm:"column:post_id" json:"post_id"`
	Type       int   `gorm:"column:type" json:"type"`
	UserId     int64 `gorm:"column:user_id" json:"user_id"`
	RootId     int64 `gorm:"column:root_id" json:"root_id"`
	ParentId   int64 `gorm:"column:parent_id" json:"parent_id"`
	LikeCount  int   `gorm:"column:like_count" json:"like_count"`
	ReplyCount int   `gorm:"column:reply_count" json:"reply_count"`
	Score      int   `gorm:"column:score" json:"score"`
	ToUID      int64 `gorm:"column:to_uid" json:"to_uid"`
	DelFlag    int   `gorm:"column:del_flag" json:"del_flag"`
	CreatedAt  int64 `gorm:"column:created_at" json:"created_at"`
	UpdatedAt  int64 `gorm:"column:updated_at" json:"updated_at"`
}

func (*CommentInfoModel) TableName

func (c *CommentInfoModel) TableName() string

TableName sets the insert table name for this struct type

type CommentLatestModel

type CommentLatestModel struct {
	CommentId int64 `gorm:"column:comment_id" json:"comment_id"`
	PostID    int64 `gorm:"column:post_id" json:"post_id"`
	RootID    int64 `gorm:"column:root_id" json:"root_id"`
	ParentID  int64 `gorm:"column:parent_id" json:"parent_id"`
	UserID    int64 `gorm:"column:user_id" json:"user_id"`
	DelFlag   int   `gorm:"column:del_flag" json:"del_flag"`
	CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
	UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"`
}

func (*CommentLatestModel) TableName

func (c *CommentLatestModel) TableName() string

TableName sets the insert table name for this struct type

type PostHotModel

type PostHotModel struct {
	PostID    int64 `gorm:"column:post_id" json:"post_id"`
	UserID    int64 `gorm:"column:user_id" json:"user_id"`
	Score     int   `gorm:"column:score" json:"score"`
	DelFlag   int   `gorm:"column:del_flag" json:"del_flag"`
	CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
}

func (*PostHotModel) TableName

func (p *PostHotModel) TableName() string

TableName sets the insert table name for this struct type

type PostInfoModel

type PostInfoModel struct {
	ID           int64   `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
	PostType     int     `gorm:"column:post_type" json:"post_type"`
	UserId       int64   `gorm:"column:user_id" json:"user_id"`
	Title        string  `gorm:"column:title" json:"title"`
	Content      string  `gorm:"column:content" json:"content"`
	ViewCount    int     `gorm:"column:view_count" json:"view_count"`
	LikeCount    int     `gorm:"column:like_count" json:"like_count"`
	CommentCount int     `gorm:"column:comment_count" json:"comment_count"`
	CollectCount int     `gorm:"column:collect_count" json:"collect_count"`
	ShareCount   int     `gorm:"column:share_count" json:"share_count"`
	Longitude    float64 `gorm:"column:longitude" json:"longitude"`
	Latitude     float64 `gorm:"column:latitude" json:"latitude"`
	Position     string  `gorm:"column:position" json:"position"`
	DelFlag      int     `gorm:"column:del_flag" json:"del_flag"`
	Visible      int     `gorm:"column:visible" json:"visible"`
	CreatedAt    int64   `gorm:"column:created_at" json:"created_at"`
	UpdatedAt    int64   `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt    int64   `gorm:"column:deleted_at" json:"deleted_at"`
}

func (*PostInfoModel) TableName

func (p *PostInfoModel) TableName() string

TableName sets the insert table name for this struct type

type PostLatestModel

type PostLatestModel struct {
	PostID    int64 `gorm:"column:post_id" json:"post_id"`
	UserID    int64 `gorm:"column:user_id" json:"user_id"`
	DelFlag   int   `gorm:"column:del_flag" json:"del_flag"`
	CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
}

func (*PostLatestModel) TableName

func (p *PostLatestModel) TableName() string

TableName sets the insert table name for this struct type

type UserCommentModel

type UserCommentModel struct {
	ID        int64 `gorm:"column:id" json:"id"`
	CommentID int64 `gorm:"column:comment_id" json:"comment_id"`
	UserID    int64 `gorm:"column:user_id" json:"user_id"`
	DelFlag   int   `gorm:"column:del_flag" json:"del_flag"`
	CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
}

func (*UserCommentModel) TableName

func (u *UserCommentModel) TableName() string

TableName sets the insert table name for this struct type

type UserLikeModel

type UserLikeModel struct {
	ID        int64 `gorm:"column:id" json:"id"`
	ObjType   int64 `gorm:"column:obj_type" json:"obj_type"`
	ObjID     int64 `gorm:"column:obj_id" json:"obj_id"`
	UserID    int64 `gorm:"column:user_id" json:"user_id"`
	Status    int   `gorm:"column:status" json:"status"`
	CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
	UpdatedAt int64 `gorm:"column:updated_at" json:"updated_at"`
}

func (*UserLikeModel) TableName

func (u *UserLikeModel) TableName() string

TableName sets the insert table name for this struct type

type UserPostModel

type UserPostModel struct {
	ID        int64 `gorm:"column:id" json:"id"`
	UserID    int64 `gorm:"column:user_id" json:"user_id"`
	PostID    int64 `gorm:"column:post_id" json:"post_id"`
	DelFlag   int   `gorm:"column:del_flag" json:"del_flag"`
	CreatedAt int64 `gorm:"column:created_at" json:"created_at"`
}

func (*UserPostModel) TableName

func (u *UserPostModel) TableName() string

TableName sets the insert table name for this struct type

Jump to

Keyboard shortcuts

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