Skip to content

Commit

Permalink
Merge pull request #264 from ArtisanCloud/dev/michaelhu
Browse files Browse the repository at this point in the history
Dev/michaelhu
  • Loading branch information
Matrix-X committed Oct 10, 2023
2 parents 5362ffc + 370165c commit ff22649
Show file tree
Hide file tree
Showing 113 changed files with 265 additions and 132 deletions.
1 change: 1 addition & 0 deletions api/mp.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "mp/market/media.api"
import "mp/product/artisan.api"
import "mp/product/product.api"
import "mp/product/productcategory.api"
import "mp/product/productstatistics.api"
import "mp/trade/cart.api"
import "mp/trade/order.api"
import "mp/trade/shippingaddress.api"
Expand Down
2 changes: 1 addition & 1 deletion api/mp/customerdomain/authcustomer.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(
)

@server(
group: mp/customer/auth
group: mp/crm/customer/auth
prefix: /api/v1/mp/customer
)

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 @@ -11,7 +11,7 @@ info(
import "../../admin/crm/market/media.api"

@server(
group: mp/market/media
group: mp/crm/market/media
prefix: /api/v1/mp/market
middleware: MPCustomerJWTAuth
)
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 @@ -12,7 +12,7 @@ info(
import "../../admin/crm/market/store.api"

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

@server(
group: mp/product/artisan
group: mp/crm/product/artisan
prefix: /api/v1/mp/product
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 @@ -12,7 +12,7 @@ info(
import "../../admin/crm/product/product.api"

@server(
group: mp/product
group: mp/crm/product
prefix: /api/v1/mp/product
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 @@ -12,7 +12,7 @@ import "../../admin/crm/product/productcategory.api"
import "../../admin/crm/product/productstatistics.api"

@server(
group: mp/product
group: mp/crm/product
prefix: /api/v1/mp/product
middleware: MPCustomerJWTAuth
)
Expand Down
27 changes: 27 additions & 0 deletions api/mp/product/productstatistics.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
syntax = "v1"

info(
title: "产品统计"
desc: "产品统计"
author: "MichaelHu"
email: "[email protected]"
version: "v1"
)

@server(
group: mp/crm/product/productstatistics
prefix: /api/v1/mp/product
middleware: MPCustomerJWTAuth
)

service PowerX {
@doc "查询产品统计列表"
@handler ListProductStatisticsPage
get /product-statistics/page-list (ListProductStatisticsPageRequest) returns (ListProductStatisticsPageReply)

@doc "查询产品统计详情"
@handler GetProductStatistics
get /product-statistics/:id (GetProductStatisticsRequest) returns (GetProductStatisticsReply)

}

2 changes: 1 addition & 1 deletion api/mp/trade/billingaddress.api
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info(
import "./shippingaddress.api"

@server(
group: mp/trade/address/billing
group: mp/crm/trade/address/billing
prefix: /api/v1/mp/trade/address
middleware: MPCustomerJWTAuth, MPCustomerGet
)
Expand Down
2 changes: 1 addition & 1 deletion api/mp/trade/cart.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: mp/trade/cart
group: mp/crm/trade/cart
prefix: /api/v1/mp/trade
middleware: MPCustomerJWTAuth, MPCustomerGet
)
Expand Down
2 changes: 1 addition & 1 deletion api/mp/trade/deliveryaddress.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(
import "./shippingaddress.api"

@server(
group: mp/trade/address/delivery
group: mp/crm/trade/address/delivery
prefix: /api/v1/mp/trade/address
middleware: MPCustomerJWTAuth, MPCustomerGet
)
Expand Down
2 changes: 1 addition & 1 deletion api/mp/trade/logistics.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info (
)

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

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

@server(
group: mp/trade/payment
group: mp/crm/trade/payment
prefix: /api/v1/mp/trade
middleware: MPCustomerJWTAuth, MPCustomerGet
)
Expand Down
2 changes: 1 addition & 1 deletion api/mp/trade/shippingaddress.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(


@server(
group: mp/trade/address/shipping
group: mp/crm/trade/address/shipping
prefix: /api/v1/mp/trade/address
middleware: MPCustomerJWTAuth, MPCustomerGet
)
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module PowerX

go 1.21

//replace github.com/ArtisanCloud/PowerWeChat/v3 => ../../../PowerWechat/PowerWeChat

require (
github.com/ArtisanCloud/PowerLibs/v3 v3.0.15
github.com/ArtisanCloud/PowerSocialite/v3 v3.0.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package auth
import (
"net/http"

"PowerX/internal/logic/mp/customer/auth"
"PowerX/internal/logic/mp/crm/customer/auth"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package auth
import (
"net/http"

"PowerX/internal/logic/mp/customer/auth"
"PowerX/internal/logic/mp/crm/customer/auth"
"PowerX/internal/svc"
"github.com/zeromicro/go-zero/rest/httpx"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package auth
import (
"net/http"

"PowerX/internal/logic/mp/customer/auth"
"PowerX/internal/logic/mp/crm/customer/auth"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package media
import (
"net/http"

"PowerX/internal/logic/mp/market/media"
"PowerX/internal/logic/mp/crm/market/media"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package store
import (
"net/http"

"PowerX/internal/logic/mp/market/store"
"PowerX/internal/logic/mp/crm/market/store"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package artisan
import (
"net/http"

"PowerX/internal/logic/mp/product/artisan"
"PowerX/internal/logic/mp/crm/product/artisan"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package artisan
import (
"net/http"

"PowerX/internal/logic/mp/product/artisan"
"PowerX/internal/logic/mp/crm/product/artisan"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package product
import (
"net/http"

"PowerX/internal/logic/mp/product"
"PowerX/internal/logic/mp/crm/product"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package product
import (
"net/http"

"PowerX/internal/logic/mp/product"
"PowerX/internal/logic/mp/crm/product"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package product

import (
"PowerX/internal/logic/mp/product"
"net/http"

"PowerX/internal/logic/mp/crm/product"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package product

import (
"PowerX/internal/logic/mp/product"
"net/http"

"PowerX/internal/logic/mp/crm/product"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package category
package productstatistics

import (
"PowerX/internal/logic/mp/product"
"net/http"

"PowerX/internal/logic/mp/crm/product/productstatistics"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)

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

l := product.NewListProductCategoryTreeLogic(r.Context(), svcCtx)
resp, err := l.ListProductCategoryTree(&req)
l := productstatistics.NewGetProductStatisticsLogic(r.Context(), svcCtx)
resp, err := l.GetProductStatistics(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package product
package productstatistics

import (
"PowerX/internal/logic/mp/market/store"
"net/http"

"PowerX/internal/logic/mp/crm/product/productstatistics"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)

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

l := store.NewListStoresPageLogic(r.Context(), svcCtx)
resp, err := l.ListStoresPage(&req)
l := productstatistics.NewListProductStatisticsPageLogic(r.Context(), svcCtx)
resp, err := l.ListProductStatisticsPage(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package billing
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/billing"
"PowerX/internal/logic/mp/crm/trade/address/billing"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package billing
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/billing"
"PowerX/internal/logic/mp/crm/trade/address/billing"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package billing
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/billing"
"PowerX/internal/logic/mp/crm/trade/address/billing"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package billing
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/billing"
"PowerX/internal/logic/mp/crm/trade/address/billing"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package billing
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/billing"
"PowerX/internal/logic/mp/crm/trade/address/billing"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package billing
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/billing"
"PowerX/internal/logic/mp/crm/trade/address/billing"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package delivery
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/delivery"
"PowerX/internal/logic/mp/crm/trade/address/delivery"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package delivery
import (
"net/http"

"PowerX/internal/logic/mp/trade/address/delivery"
"PowerX/internal/logic/mp/crm/trade/address/delivery"
"PowerX/internal/svc"
"PowerX/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
Expand Down
Loading

0 comments on commit ff22649

Please sign in to comment.