pusher/handler.go
2024-05-17 18:02:10 +08:00

34 lines
1000 B
Go

package main
import (
"context"
"gitea.timerzz.com/kedaya_haitao/pusher/biz/service"
config "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/config"
push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push"
)
// PushServiceImpl implements the last service interface defined in the IDL.
type PushServiceImpl struct{}
// Push implements the PushServiceImpl interface.
func (s *PushServiceImpl) Push(ctx context.Context, req *push.PushReq) (resp *push.PushResp, err error) {
resp, err = service.NewPushService(ctx).Run(req)
return resp, err
}
// Add implements the PushServiceImpl interface.
func (s *PushServiceImpl) Add(ctx context.Context, req *config.PushConfig) (err error) {
err = service.NewAddService(ctx).Run(req)
return err
}
// List implements the PushServiceImpl interface.
func (s *PushServiceImpl) List(ctx context.Context, req *push.ListPusherRequest) (resp *push.ListPusherResponse, err error) {
resp, err = service.NewListService(ctx).Run(req)
return resp, err
}