wp-go/plugins/posts.go
2022-09-23 21:46:34 +08:00

19 lines
359 B
Go

package plugins
import (
"github.com/gin-gonic/gin"
"github/fthvgb1/wp-go/models"
)
func NewPostPlugin(ctx *gin.Context, scene uint) *Plugin[models.WpPosts] {
p := NewPlugin[models.WpPosts](nil, -1, nil, scene, ctx)
p.Push(Except)
return p
}
func ApplyPlugin(p *Plugin[models.WpPosts], post *models.WpPosts) {
p.post = post
p.Next()
p.index = -1
}