Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact(mp): remove middleware for shop,media,datadictionary etc api a… #270

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/mp/dictionary.api
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "../admin/dictionary.api"
@server(
group: mp/dictionary
prefix: /api/v1/mp/dictionary
middleware: MPCustomerJWTAuth
// middleware: MPCustomerJWTAuth
)

service PowerX {
Expand Down
2 changes: 1 addition & 1 deletion api/mp/market/media.api
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "../../admin/crm/market/media.api"
@server(
group: mp/crm/market/media
prefix: /api/v1/mp/market
middleware: MPCustomerJWTAuth
// middleware: MPCustomerJWTAuth
)

service PowerX {
Expand Down
2 changes: 1 addition & 1 deletion api/mp/market/store.api
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "../../admin/crm/market/store.api"
@server(
group: mp/crm/market/store
prefix: /api/v1/mp/market
middleware: MPCustomerJWTAuth
// middleware: MPCustomerJWTAuth
)


Expand Down
2 changes: 1 addition & 1 deletion api/mp/product/product.api
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "../../admin/crm/product/product.api"
@server(
group: mp/crm/product
prefix: /api/v1/mp/product
middleware: MPCustomerJWTAuth
// middleware: MPCustomerJWTAuth
)


Expand Down
2 changes: 1 addition & 1 deletion api/mp/product/productcategory.api
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import "../../admin/crm/product/productstatistics.api"
@server(
group: mp/crm/product
prefix: /api/v1/mp/product
middleware: MPCustomerJWTAuth
// middleware: MPCustomerJWTAuth
)

service PowerX {
Expand Down
2 changes: 1 addition & 1 deletion api/mp/product/productstatistics.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
@server(
group: mp/crm/product/productstatistics
prefix: /api/v1/mp/product
middleware: MPCustomerJWTAuth
// middleware: MPCustomerJWTAuth
)

service PowerX {
Expand Down
21 changes: 21 additions & 0 deletions internal/handler/plugin/listpluginfrontendrouteshandler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package plugin

import (
"net/http"

"PowerX/internal/logic/plugin"
"PowerX/internal/svc"
"github.com/zeromicro/go-zero/rest/httpx"
)

func ListPluginFrontendRoutesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := plugin.NewListPluginFrontendRoutesLogic(r.Context(), svcCtx)
resp, err := l.ListPluginFrontendRoutes()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}
28 changes: 28 additions & 0 deletions internal/handler/plugin/listpluginhandler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package plugin

import (
"net/http"

"PowerX/internal/logic/plugin"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)

func ListPluginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ListPluginRequest
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}

l := plugin.NewListPluginLogic(r.Context(), svcCtx)
resp, err := l.ListPlugin(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}
28 changes: 28 additions & 0 deletions internal/handler/plugin/registerpluginhandler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package plugin

import (
"net/http"

"PowerX/internal/logic/plugin"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)

func RegisterPluginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.RegisterPluginRequest
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}

l := plugin.NewRegisterPluginLogic(r.Context(), svcCtx)
resp, err := l.RegisterPlugin(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}
174 changes: 80 additions & 94 deletions internal/handler/routes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading