update example

This commit is contained in:
kevin
2020-09-27 11:10:21 +08:00
parent bc831b75dd
commit 54e9d01312
15 changed files with 138 additions and 23 deletions

View File

@@ -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"
)

View File

@@ -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"
)

View File

@@ -2,9 +2,10 @@
package handler
import (
"bookstore/api/internal/svc"
"net/http"
"bookstore/api/internal/svc"
"github.com/tal-tech/go-zero/rest"
)

View File

@@ -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
}
}

View File

@@ -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
}
}