wp-go/plugins/posts.go
2022-11-05 22:40:02 +08:00

19 lines
338 B
Go

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