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

虚拟币和会籍模块 #283

Merged
merged 1 commit into from
Feb 3, 2024
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
1 change: 1 addition & 0 deletions api/admin.crm.api
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "admin/crm/customerdomain/lead.api"
import "admin/crm/customerdomain/customer.api"
import "admin/crm/customerdomain/registercode.api"
import "admin/crm/membership/membership.api"
import "admin/crm/market/media.api"
import "admin/crm/market/store.api"
import "admin/crm/market/mgm.api"
Expand Down
4 changes: 2 additions & 2 deletions api/admin/crm/customerdomain/customer.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ info(
service PowerX {
@doc "查询客户"
@handler GetCustomer
get /customers/:id (GetCustomerReqeuest) returns (GetCustomerReply)
get /customers/:id (GetCustomerRequest) returns (GetCustomerReply)

@doc "获取客户分页列表"
@handler ListCustomersPage
Expand Down Expand Up @@ -78,7 +78,7 @@ type (
)

type (
GetCustomerReqeuest {
GetCustomerRequest {
Id int64 `path:"id"`
}

Expand Down
4 changes: 2 additions & 2 deletions api/admin/crm/customerdomain/lead.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ info(
service PowerX {
@doc "查询线索"
@handler GetLead
get /leads/:id (GetLeadReqeuest) returns (GetLeadReply)
get /leads/:id (GetLeadRequest) returns (GetLeadReply)

@doc "获取线索分页列表"
@handler ListLeadsPage
Expand Down Expand Up @@ -76,7 +76,7 @@ type (
)

type (
GetLeadReqeuest {
GetLeadRequest {
Id int64 `path:"id"`
}

Expand Down
4 changes: 2 additions & 2 deletions api/admin/crm/customerdomain/registercode.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ info(
service PowerX {
@doc "查询注册码"
@handler GetRegisterCode
get /register-codes/:id (GetRegisterCodeReqeuest) returns (GetRegisterCodeReply)
get /register-codes/:id (GetRegisterCodeRequest) returns (GetRegisterCodeReply)

@doc "获取注册码分页列表"
@handler ListRegisterCodesPage
Expand Down Expand Up @@ -57,7 +57,7 @@ type (
)

type (
GetRegisterCodeReqeuest {
GetRegisterCodeRequest {
Id int64 `path:"id"`
}

Expand Down
161 changes: 161 additions & 0 deletions api/admin/crm/market/brandstory.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
syntax = "v1"

info(
title: "品牌故事"
desc: "品牌故事"
author: "MichaelHu"
email: "[email protected]"
version: "v1"
)


@server(
group: admin/crm/market/brandstory
prefix: /api/v1/admin/market
middleware: EmployeeJWTAuth
)

service PowerX {
@doc "查询品牌故事列表"
@handler ListStoresPage
get /brand-stories/page-list (ListStoresPageRequest) returns (ListStoresPageReply)

@doc "查询品牌故事详情"
@handler GetStore
get /brand-stories/:id (GetStoreRequest) returns (GetStoreReply)


@doc "创建品牌故事"
@handler CreateStore
post /brand-stories (CreateStoreRequest) returns (CreateStoreReply)


@doc "全量品牌故事"
@handler PutStore
put /brand-stories/:id (PutStoreRequest) returns (PutStoreReply)


@doc "删除品牌故事"
@handler DeleteStore
delete /brand-stories/:id (DeleteStoreRequest) returns (DeleteStoreReply)


}

type (
StoreArtisanSpecific {
ArtisanId int64 `json:"artisanId,optional"`
}



StoreArtisan {
EmployeeId int64 `json:"employeeId,optional"`
Name string `json:"name,optional"`
Level int8 `json:"level,optional"`
Gender bool `json:"gender,optional"`
birthday string `json:"birthday,optional"`
PhoneNumber string `json:"phoneNumber,optional"`
CoverURL string `json:"coverURL,optional"`
WorkNo string `json:"workNo,optional"`
Email string `json:"email,optional"`
Experience string `json:"experience,optional"`
Specialty string `json:"specialty,optional"`
Certificate string `json:"certificate,optional"`
Address string `json:"address,optional"`
ArtisanSpecific StoreArtisanSpecific `json:"artisanSpecific,optional"`
}

Store {
Id int64 `json:"id,optional"`
Name string `json:"name"`
StoreEmployeeId int64 `json:"storeEmployeeId,optional"`
ContactNumber string `json:"contactNumber"`
Email string `json:"email,optional"`
Address string `json:"address"`
Description string `json:"description,optional"`
Longitude float32 `json:"longitude,optional"`
Latitude float32 `json:"latitude,optional"`
StartWork string `json:"startWork,optional"`
EndWork string `json:"endWork,optional"`
Artisans []*StoreArtisan `json:"artisans,optional"`
CreatedAt string `json:"createdAt,optional"`

CoverImageId int64 `json:"coverImageId,optional"`
CoverImage *MediaResource `json:"coverImage,optional"`
DetailImageIds []int64 `json:"detailImageIds,optional"`
DetailImages []*MediaResource `json:"detailImages,optional"`
}
)
type (
ListStoresPageRequest struct {
Ids []int64 `form:"ids,optional"`
LikeName string `form:"likeName,optional"`
OrderBy string `form:"orderBy,optional"`
PageIndex int `form:"pageIndex,optional"`
PageSize int `form:"pageSize,optional"`
}


ListStoresPageReply struct {
List []*Store `json:"list"`
PageIndex int `json:"pageIndex"`
PageSize int `json:"pageSize"`
Total int64 `json:"total"`
}
)

type (
CreateStoreRequest struct {
Store
}

CreateStoreReply struct {
StoreId int64 `json:"id"`
}
)

type (
GetStoreRequest struct {
StoreId int64 `path:"id"`
}

GetStoreReply struct {
*Store
}
)


type (
PutStoreRequest struct {
StoreId int64 `path:"id"`
Store
}

PutStoreReply struct {
*Store
}
)


type (
DeleteStoreRequest struct {
StoreId int64 `path:"id"`
}

DeleteStoreReply struct {
StoreId int64 `json:"id"`
}
)


type (
AssignStoreManagerRequest {
Id int64 `path:"id"`
EmployeeId int64 `json:"employeeId"`
}

AssignStoreManagerReply {
Store
}
)
11 changes: 0 additions & 11 deletions api/admin/crm/market/store.api
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ type (
ArtisanId int64 `json:"artisanId,optional"`
}

// StoreImage {
// Id int64 `json:"id,optional"`
// Filename string `json:"filename,optional"`
// Size int64 `json:"size,optional"`
// Url string `json:"url,optional"`
// BucketName string `json:"bucketName,optional"`
// IsLocalStored bool `json:"isLocalStored,optional"`
// ContentType string `json:"contentType,optional"`
// ResourceType string `json:"resourceType,optional"`
// }

StoreArtisan {
EmployeeId int64 `json:"employeeId,optional"`
Name string `json:"name,optional"`
Expand Down
49 changes: 49 additions & 0 deletions api/admin/crm/membership/membership.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
syntax = "v1"

info(
title: "会籍管理"
desc: "会籍管理"
author: "MichaelHu"
email: "[email protected]"
version: "v1"
)

@server(
group: admin/crm/membership
prefix: /api/v1/admin/membership
middleware: EmployeeJWTAuth
)

service PowerX {
@doc "查询会籍"
@handler GetCustomer
get /customers/:id (GetMembershipRequest) returns (GetMembershipReply)
}

type (
Membership {
Id int64 `json:"id,optional"`

Name string `json:"name,optional"`
MainMembershipId int64 `json:"mainMembershipId,optional"`
OrderId int64 `json:"orderId,optional"`
OrderItemId int64 `json:"orderItemId,optional"`
CustomerId int64 `json:"customerId,optional"`
ProductId int64 `json:"productId,optional"`
StartDate string `json:"startDate,optional"`
EndDate string `json:"endDate,optional"`
Status int `json:"status,optional"`
Type int `json:"type,optional"`
ExtendPeriod bool `json:"extendPeriod,optional"`
Plan int `json:"plan,optional"`

}

GetMembershipRequest{
Id int64 `path:"id"`
}

GetMembershipReply {
*Membership
}
)
4 changes: 4 additions & 0 deletions api/mp.api
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import "mp/dictionary.api"
import "mp/customerdomain/authcustomer.api"
import "mp/customerdomain/customer.api"
import "mp/membership/membership.api"
import "mp/market/store.api"
import "mp/market/media.api"
import "mp/product/artisan.api"
Expand All @@ -12,3 +14,5 @@ import "mp/trade/shippingaddress.api"
import "mp/trade/deliveryaddress.api"
import "mp/trade/billingaddress.api"
import "mp/trade/payment.api"
import "mp/trade/token.api"
import "mp/infoorganization/category.api"
12 changes: 12 additions & 0 deletions api/mp/customerdomain/authcustomer.api
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ info(


service PowerX {
@doc "微信小程序Token验证"
@handler ValidToken
get /validToken (MPValidTokenRequest) returns (MPValidTokenReply)

@doc "微信小程序登录"
@handler Login
post /login (MPCustomerLoginRequest) returns (MPCustomerLoginAuthReply)
Expand All @@ -32,6 +36,14 @@ service PowerX {


type (
MPValidTokenRequest {
Token string `form:"token"`
}
MPValidTokenReply {
Valid bool `json:"valid"`
Reason string `json:"reason"`
}

MPCustomerLoginRequest {
Code string `json:"code"`
}
Expand Down
26 changes: 26 additions & 0 deletions api/mp/customerdomain/customer.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "v1"

info(
title: "客户服务"
desc: "客户服务"
author: "MichaelHu"
email: "[email protected]"
version: "v1"
)


@server(
group: mp/crm/customer
prefix: /api/v1/mp/customer
middleware: MPCustomerJWTAuth, MPCustomerGet
)

service PowerX {
@doc "获取用户信息"
@handler GetUserInfo
get /user-info returns (GetUserInfoReplyForMP)
}

type GetUserInfoReplyForMP{
*Customer
}
Loading
Loading