update example
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"bookstore/api/internal/logic"
|
||||
"bookstore/api/internal/svc"
|
||||
"bookstore/api/internal/types"
|
||||
"net/http"
|
||||
|
||||
"github.com/tal-tech/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"bookstore/api/internal/logic"
|
||||
"bookstore/api/internal/svc"
|
||||
"bookstore/api/internal/types"
|
||||
"net/http"
|
||||
|
||||
"github.com/tal-tech/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"bookstore/api/internal/svc"
|
||||
"net/http"
|
||||
|
||||
"bookstore/api/internal/svc"
|
||||
|
||||
"github.com/tal-tech/go-zero/rest"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bookstore/api/internal/svc"
|
||||
"bookstore/api/internal/types"
|
||||
"bookstore/rpc/add/adder"
|
||||
"context"
|
||||
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
)
|
||||
@@ -35,4 +36,4 @@ func (l *AddLogic) Add(req types.AddReq) (*types.AddResp, error) {
|
||||
return &types.AddResp{
|
||||
Ok: resp.Ok,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bookstore/api/internal/svc"
|
||||
"bookstore/api/internal/types"
|
||||
"bookstore/rpc/check/checker"
|
||||
"context"
|
||||
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
)
|
||||
@@ -25,7 +26,7 @@ func NewCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) CheckLogic {
|
||||
|
||||
func (l *CheckLogic) Check(req types.CheckReq) (*types.CheckResp, error) {
|
||||
resp, err := l.svcCtx.Checker.Check(l.ctx, &checker.CheckReq{
|
||||
Book: req.Book,
|
||||
Book: req.Book,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -35,4 +36,4 @@ func (l *CheckLogic) Check(req types.CheckReq) (*types.CheckResp, error) {
|
||||
Found: resp.Found,
|
||||
Price: resp.Price,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user