mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
791 B
39 lines
791 B
// Copyright 2023 ROC. All rights reserved.
|
|
// Use of this source code is governed by a MIT style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package base
|
|
|
|
import (
|
|
"github.com/alimy/tryst/event"
|
|
"github.com/rocboss/paopao-ce/internal/core/ms"
|
|
)
|
|
|
|
type pushPostToSearchEvent struct {
|
|
event.UnimplementedEvent
|
|
fn func(*ms.Post)
|
|
post *ms.Post
|
|
}
|
|
|
|
type pushAllPostToSearchEvent struct {
|
|
event.UnimplementedEvent
|
|
fn func() error
|
|
}
|
|
|
|
func (p *pushPostToSearchEvent) Name() string {
|
|
return "servants.base.pushPostToSearchEvent"
|
|
}
|
|
|
|
func (p *pushPostToSearchEvent) Action() (err error) {
|
|
p.fn(p.post)
|
|
return
|
|
}
|
|
|
|
func (p *pushAllPostToSearchEvent) Name() string {
|
|
return "servants.base.pushAllPostToSearchEvent"
|
|
}
|
|
|
|
func (p *pushAllPostToSearchEvent) Action() error {
|
|
return p.fn()
|
|
}
|