add bookstore example
This commit is contained in:
26
example/bookstore/rpc/add/internal/server/adderserver.go
Executable file
26
example/bookstore/rpc/add/internal/server/adderserver.go
Executable file
@@ -0,0 +1,26 @@
|
||||
// Code generated by goctl. DO NOT EDIT!
|
||||
// Source: add.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"bookstore/rpc/add/internal/logic"
|
||||
"bookstore/rpc/add/internal/svc"
|
||||
add "bookstore/rpc/add/pb"
|
||||
"context"
|
||||
)
|
||||
|
||||
type AdderServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewAdderServer(svcCtx *svc.ServiceContext) *AdderServer {
|
||||
return &AdderServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *AdderServer) Add(ctx context.Context, in *add.AddReq) (*add.AddResp, error) {
|
||||
l := logic.NewAddLogic(ctx, s.svcCtx)
|
||||
return l.Add(in)
|
||||
}
|
||||
Reference in New Issue
Block a user