pusher/handler.go

40 lines
1.3 KiB
Go
Raw Normal View History

2024-05-17 18:02:10 +08:00
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.
2024-05-20 17:57:25 +08:00
func (s *PushServiceImpl) Push(ctx context.Context, req *push.PushReq) (resp *push.Resp, err error) {
2024-05-17 18:02:10 +08:00
resp, err = service.NewPushService(ctx).Run(req)
return resp, err
}
// Add implements the PushServiceImpl interface.
2024-05-20 17:57:25 +08:00
func (s *PushServiceImpl) Add(ctx context.Context, req *config.PusherConfig) (resp *push.Resp, err error) {
resp, err = service.NewAddService(ctx).Run(req)
2024-05-17 18:02:10 +08:00
2024-05-20 17:57:25 +08:00
return resp, err
2024-05-17 18:02:10 +08:00
}
// 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
}
2024-05-20 17:57:25 +08:00
// GetPusherOptions implements the PushServiceImpl interface.
func (s *PushServiceImpl) GetPusherOptions(ctx context.Context) (resp *push.GetPusherOptionsResponse, err error) {
resp, err = service.NewGetPusherOptionsService(ctx).Run()
return resp, err
}