post

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePost

func CreatePost(c *gin.Context)

CreatePost

func DeletePost

func DeletePost(c *gin.Context)

DeletePost

func GetPostInfo

func GetPostInfo(c *gin.Context)

GetPostInfo

func GetPostInfoBySql

func GetPostInfoBySql(c *gin.Context)

GetPostInfoBySql

func Index

func Index(c *gin.Context)

Index

func UpdatePost

func UpdatePost(c *gin.Context)

UpdatePost

Types

type Post

type Post struct {
	Id          int       `json:"id"`
	Mobile      string    `json:"mobile"`
	UserName    string    `json:"userName"`
	Gender      string    `json:"gender"`
	Addr        string    `json:"addr"`
	Email       string    `json:"email"`
	Status      int       `json:"status"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

func (Post) TableName

func (Post) TableName() string

设置User的表名为`post`

type PostService

type PostService interface {
	GetPostInfo() (user Post, err error)
	GetPostInfoBySQL() (user Post, err error)
	CreatePost(user *Post) (err error)
	UpdatePost(userID int, user *Post) (err error)
	DeletePost(userID int) (err error)
}

func NewService

func NewService(mysql *gorm.DB) PostService

Jump to

Keyboard shortcuts

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