fix
This commit is contained in:
@@ -11,22 +11,22 @@ import (
|
||||
"fusenapi/server/product/internal/types"
|
||||
)
|
||||
|
||||
func CaculateProductPriceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
func CalculateProductPriceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
var req types.CaculateProductPriceReq
|
||||
var req types.CalculateProductPriceReq
|
||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// 创建一个业务逻辑层实例
|
||||
l := logic.NewCaculateProductPriceLogic(r.Context(), svcCtx)
|
||||
l := logic.NewCalculateProductPriceLogic(r.Context(), svcCtx)
|
||||
|
||||
rl := reflect.ValueOf(l)
|
||||
basic.BeforeLogic(w, r, rl)
|
||||
|
||||
resp := l.CaculateProductPrice(&req, userinfo)
|
||||
resp := l.CalculateProductPrice(&req, userinfo)
|
||||
|
||||
if !basic.AfterLogic(w, r, rl, resp) {
|
||||
basic.NormalAfterLogic(w, r, resp)
|
||||
@@ -79,8 +79,8 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
},
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/api/product/caculate_product_price",
|
||||
Handler: CaculateProductPriceHandler(serverCtx),
|
||||
Path: "/api/product/calculate_product_price",
|
||||
Handler: CalculateProductPriceHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
Method: http.MethodGet,
|
||||
|
||||
Reference in New Issue
Block a user