pusher/biz/service/add.go
timerzz 4ec0cd1564
Some checks failed
Build image / build (push) Failing after 4m48s
feat 测试
2024-05-20 17:57:25 +08:00

28 lines
665 B
Go

package service
import (
"context"
"gitea.timerzz.com/kedaya_haitao/pusher/biz/dal/postgres"
config "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/config"
push "gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/push"
)
type AddService struct {
ctx context.Context
} // NewAddService new AddService
func NewAddService(ctx context.Context) *AddService {
return &AddService{ctx: ctx}
}
// Run create note info
func (s *AddService) Run(req *config.PusherConfig) (resp *push.Resp, err error) {
// Finish your business logic.
resp = push.NewResp()
err = postgres.DB.Create(req).Error
if err != nil {
resp.Code = 100
resp.Msg = err.Error()
}
return
}