pusher/biz/service/push.go

28 lines
614 B
Go
Raw Normal View History

2024-05-17 18:02:10 +08:00
package service
import (
"context"
2024-11-29 21:53:59 +08:00
2024-05-17 18:02:10 +08:00
push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push"
2024-05-20 17:57:25 +08:00
"gitea.timerzz.com/kedaya_haitao/pusher/pushers"
2024-05-17 18:02:10 +08:00
)
type PushService struct {
ctx context.Context
} // NewPushService new PushService
func NewPushService(ctx context.Context) *PushService {
return &PushService{ctx: ctx}
}
// Run create note info
2024-05-20 17:57:25 +08:00
func (s *PushService) Run(req *push.PushReq) (resp *push.Resp, err error) {
2024-05-17 18:02:10 +08:00
// Finish your business logic.
2024-05-20 17:57:25 +08:00
resp = push.NewResp()
err = pushers.Push(s.ctx, req.Ids, req.Title, req.Content)
if err != nil {
resp.Code = 100
resp.Msg = err.Error()
}
2024-05-17 18:02:10 +08:00
return
}