pusher/biz/service/push.go
timerzz c16e02a7ea
All checks were successful
Build image / build (push) Successful in 1m21s
feat push可以不传id
2024-11-29 21:53:59 +08:00

28 lines
614 B
Go

package service
import (
"context"
push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push"
"gitea.timerzz.com/kedaya_haitao/pusher/pushers"
)
type PushService struct {
ctx context.Context
} // NewPushService new PushService
func NewPushService(ctx context.Context) *PushService {
return &PushService{ctx: ctx}
}
// Run create note info
func (s *PushService) Run(req *push.PushReq) (resp *push.Resp, err error) {
// Finish your business logic.
resp = push.NewResp()
err = pushers.Push(s.ctx, req.Ids, req.Title, req.Content)
if err != nil {
resp.Code = 100
resp.Msg = err.Error()
}
return
}