wp-go/plugins/posts.go

19 lines
346 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 02:32:57 +00:00
func NewPostPlugin(ctx *gin.Context, scene uint) *Plugin[wp.WpPosts] {
p := NewPlugin[wp.WpPosts](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 02:32:57 +00:00
func ApplyPlugin(p *Plugin[wp.WpPosts], post *wp.WpPosts) {
2022-09-23 13:46:34 +00:00
p.post = post
p.Next()
p.index = -1
}