wp-go/plugins/posts.go

19 lines
359 B
Go
Raw Normal View History

2022-09-23 13:46:34 +00:00
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)
2022-09-26 08:35:38 +00:00
p.Push(Digest)
2022-09-23 13:46:34 +00:00
return p
}
func ApplyPlugin(p *Plugin[models.WpPosts], post *models.WpPosts) {
p.post = post
p.Next()
p.index = -1
}