wp-go/plugins/posts.go
2023-01-12 18:17:34 +08:00

19 lines
340 B
Go

package plugins
import (
"github.com/gin-gonic/gin"
"github/fthvgb1/wp-go/internal/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
}