wp-go/plugins/posts.go

19 lines
338 B
Go
Raw Normal View History

2022-09-23 13:46:34 +00:00
package plugins
import (
"github.com/gin-gonic/gin"
2022-11-05 02:32:57 +00:00
"github/fthvgb1/wp-go/models/wp"
2022-09-23 13:46:34 +00:00
)
2022-11-05 14:40:02 +00:00
func NewPostPlugin(ctx *gin.Context, scene uint) *Plugin[wp.Posts] {
p := NewPlugin[wp.Posts](nil, -1, nil, scene, ctx)
2022-09-26 08:35:38 +00:00
p.Push(Digest)
2022-09-23 13:46:34 +00:00
return p
}
2022-11-05 14:40:02 +00:00
func ApplyPlugin(p *Plugin[wp.Posts], post *wp.Posts) {
2022-09-23 13:46:34 +00:00
p.post = post
p.Next()
p.index = -1
}