post_plugin

package
v0.0.0-...-ea214e1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAction

func CreateAction(c *gin.Context)

func IndexAction

func IndexAction(c *gin.Context)

func Routes

func Routes(r *gin.RouterGroup)

func ShowAction

func ShowAction(c *gin.Context)

func ToggleFavoriteAction

func ToggleFavoriteAction(c *gin.Context)

func ToggleLikeAction

func ToggleLikeAction(c *gin.Context)

func TogglePostAction

func TogglePostAction(userId int64, action string, postId int64) (int64, error)

Types

type CreateParams

type CreateParams struct {
	NodeId  int64  `json:"node_id"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Fee     int    `json:"fee"`
	Tags    string `json:"tags"` // 使用英文逗号分隔
}

type Post

type Post struct {
	Id        int64
	UserId    int64
	NodeId    int64
	Title     string
	Content   string
	Fee       int
	CreatedAt time.Time
	UpdatedAt time.Time
}

func CreatePost

func CreatePost(title, content string, user_id, node_id int64, fee int, tags []string) (*Post, error)

func (*Post) RelId

func (p *Post) RelId() int64

func (*Post) RelType

func (p *Post) RelType() string

func (Post) TableName

func (p Post) TableName() string

type PostResp

type PostResp struct {
	Id        int64
	UserId    int64
	NodeId    int64
	Title     string
	Content   string
	Fee       int
	CreatedAt utils.Timestamp
	UpdatedAt utils.Timestamp
}

func (PostResp) Fields

func (pr PostResp) Fields() []string

type ShowParams

type ShowParams struct {
	Id int64 `form:"id"`
}

type ToggleFavoriteParams

type ToggleFavoriteParams struct {
	PostId int64 `form:"id"`
}

type ToggleLikeParams

type ToggleLikeParams struct {
	PostId int64 `form:"id"`
}

Jump to

Keyboard shortcuts

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