models

package
v0.0.0-...-d993e0e Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

* @Author: drowningwhale [email protected] * @Date: 2023-09-30 14:05:09 * @LastEditors: drowningwhale [email protected] * @LastEditTime: 2023-10-04 11:52:08 * @FilePath: \bluebell\models\param.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE

* @Author: drowningwhale [email protected] * @Date: 2023-09-30 10:19:49 * @LastEditors: drowningwhale [email protected] * @LastEditTime: 2023-10-01 17:06:59 * @FilePath: \go-coursed:\Data\Gitee\bluebell\models\user.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        int32 `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt
	IsDeleted bool
	gorm.Model
}

type Community

type Community struct {
	BaseModel
	CommunityId   int    `json:"community_id" gorm:"index:idx_community_id;type:int(10);not null"`
	CommunityName string `json:"community_name" gorm:"index:idx_community_name;type:varchar(128);not null"`
	Introduction  string `json:"introduction" gorm:"type:varchar(256);not null"`
}

type CommunityDetail

type CommunityDetail struct {
	BaseModel
	CommunityId   int    `json:"community_id" gorm:"index:idx_community_id;type:int(10);not null"`
	CommunityName string `json:"community_name" gorm:"index:idx_community_name;type:varchar(128);not null"`
	Introduction  string `json:"introduction" gorm:"type:varchar(256);not null"`
}

type CommunityList

type CommunityList struct {
	CommunityId  int    `json:"community_name" gorm:"index:idx_community_name;type:varchar(128);not null"`
	Introduction string `json:"introduction" gorm:"type:varchar(256);not null"`
}

type ParamLogin

type ParamLogin struct {
	UserName string `json:"username" binding:"required"`
	PassWord string `json:"password" binding:"required"`
}

type ParamPostList

type ParamPostList struct {
	Page     int    `form:"page" binding:"required"`
	PageSize int    `form:"pagesize" binding:"required"`
	Order    string `form:"order" binding:"required"`
}

type ParamSignUp

type ParamSignUp struct {
	UserName   string `json:"username" binding:"required"`
	PassWord   string `json:"password" binding:"required"`
	RePassWord string `json:"re_password" binding:"required,eqfield=PassWord"`
}

type Post

type Post struct {
	BaseModel
	PostId      int    `json:"post_id" gorm:"index:idx_post_id;bigint(20);not null;commit '帖子id'"`
	Title       string `json:"title" gorm:"varchar(128);not null;commit '标题'" binding:"required"`
	Content     string `json:"content" gorm:"varchar(8192);not null;commit '内容'" binding:"required"`
	AuthorId    int    `json:"author_id" gorm:"index:idx_author_id;bigint(20);not null;commit '作者的用户id'"`
	CommunityId int    `json:"community_id" gorm:"index:idx_community_id;bigint(20);not null;commit '所属社区'" binding:"required"`
	Status      int    `json:"status" gorm:"default:1;tinyint(4);not null;commit '帖子状态'"`
}

type PostDetail

type PostDetail struct {
	Post          Post
	UserName      string `json:"user_name"`
	CommunityName string `json:"community_name"`
	Introduction  string `json:"introduction"`
}

type PostDetail2

type PostDetail2 struct {
	Post          Post
	UserName      string `json:"user_name"`
	CommunityName string `json:"community_name"`
	Introduction  string `json:"introduction"`
	VoteNum       int64  `json:"vote_num"`
}

type User

type User struct {
	BaseModel
	UserId   int    `gorm:"index:idx_user_id;type:bigint(20);not null"`
	UserName string `gorm:"column:username;index:idx_username;type:varchar(64);not null"`
	PassWord string `gorm:"column:password;type:longtext;not null"`
	Email    string `gorm:"type:varchar(64)"`
	Gender   string `gorm:"type:tinyint(4);not null;default:0"`
}

type Vote

type Vote struct {
	//userID
	PostId    string `json:"post_id" binding:"required"`
	Direction int8   `json:"direction,string" binding:"oneof=1 0 -1"`
}

Directories

Path Synopsis
* @Author: drowningwhale [email protected] * @Date: 2023-10-01 16:30:07 * @LastEditors: drowningwhale [email protected] * @LastEditTime: 2023-10-01 16:34:39 * @FilePath: \bluebell\models\create\main.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Author: drowningwhale [email protected] * @Date: 2023-10-01 16:30:07 * @LastEditors: drowningwhale [email protected] * @LastEditTime: 2023-10-01 16:34:39 * @FilePath: \bluebell\models\create\main.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Author: drowningwhale [email protected] * @Date: 2023-09-30 10:43:08 * @LastEditors: drowningwhale [email protected] * @LastEditTime: 2023-10-02 16:05:30 * @FilePath: \bluebell\models\main\main.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Author: drowningwhale [email protected] * @Date: 2023-09-30 10:43:08 * @LastEditors: drowningwhale [email protected] * @LastEditTime: 2023-10-02 16:05:30 * @FilePath: \bluebell\models\main\main.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE

Jump to

Keyboard shortcuts

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