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

Dev/michaelhu #258

Merged
merged 2 commits into from
Sep 27, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions api/admin.wechat.offiaccount.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import "admin/scrm/contactway.api"
//import "admin/scrm/customer.api"
//import "admin/scrm/contact.api"
// organzation
import "admin/scrm/organization/weworkemployee.api"
import "admin/scrm/organization/weworkdepartment.api"
// app
import "admin/scrm/app/weworkgroup.api"
import "admin/scrm/app/weworkapp.api"
import "admin/scrm/app/weworkappmessage.api"
// wechat.customer
import "admin/scrm/customer/weworkcustomer.api"
import "admin/scrm/customer/weworkcustomergroup.api"
// bot
import "admin/scrm/bot/weworkbot.api"
// resource
import "admin/scrm/resource/weworkresource.api"
// qrcode
import "admin/scrm/qrcode/weworkcustomergroupqrcode.api"
// tag
import "admin/scrm/tag/weworktag.api"
2 changes: 1 addition & 1 deletion api/admin/crm/business/opportunity.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: admin/business/opportunity
group: admin/crm/business/opportunity
prefix: /api/v1/admin/business
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/customerdomain/customer.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: admin/customerdomain/customer
group: admin/crm/customerdomain/customer
prefix: /api/v1/admin/customerdomain
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/customerdomain/lead.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: admin/customerdomain/leader
group: admin/crm/customerdomain/leader
prefix: /api/v1/admin/customerdomain
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/market/media.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: admin/market/media
group: admin/crm/market/media
prefix: /api/v1/admin/market
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/market/store.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(


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


@server(
group: admin/product/artisan
group: admin/crm/product/artisan
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/product/pricebook.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(


@server(
group: admin/product/pricebook
group: admin/crm/product/pricebook
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/product/pricebookentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(


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

@server(
group: admin/product
group: admin/crm/product
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/product/productcategory.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(


@server(
group: admin/product/category
group: admin/crm/product/category
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/product/productspecific.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: admin/product/productspecific
group: admin/crm/product/productspecific
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/product/sku.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: admin/product/sku
group: admin/crm/product/sku
prefix: /api/v1/admin/product
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/trade/billingaddress.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(


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


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

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

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


@server(
group: admin/trade/payment
group: admin/crm/trade/payment
prefix: /api/v1/admin/trade
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/trade/refundorder.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ info(


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


@server(
group: admin/trade/address/shipping
group: admin/crm/trade/address/shipping
prefix: /api/v1/admin/trade/address
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/trade/tokenproduct.api
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ info(


@server(
group: admin/trade/token
group: admin/crm/trade/token
prefix: /api/v1/admin/trade/token
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/crm/trade/warehouse.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info (
)

@server (
group: admin/trade/warehouse
group: admin/crm/trade/warehouse
prefix: /api/v1/admin/trade
middleware: EmployeeJWTAuth
)
Expand Down
2 changes: 1 addition & 1 deletion api/admin/scrm/contactway.api
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info(
)

@server(
group: admin/contractway
group: admin/scrm/contractway
prefix: /api/v1/admin/contract-way
middleware: EmployeeJWTAuth
)
Expand Down
112 changes: 112 additions & 0 deletions api/admin/wechat/officialaccount/menu.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
syntax = "v1"

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

@server(
group: admin/wechat/officialaccount/menu
prefix: /api/v1/admin/wechat/official-account
middleware: EmployeeJWTAuth
)

service PowerX {
@doc "查询菜单列表"
@handler QueryMenus
get /menus-tree returns (QueryMenusReply)

@doc "请求菜单上传链接"
@handler SyncMenus
post /menus (SyncMenusRequest) returns (SyncMenusReply)


@doc "创建菜单"
@handler CreateMenu
post /menus (CreateMenuRequest) returns (CreateMenuReply)

@doc "删除菜单"
@handler DeleteMenu
delete /menus returns (DeleteMenuReply)
}

type (
SubButton struct {

Name string `json:"name,optional"`
Id int `json:"id,optional"`
Type string `json:"type,optional"`
Key string `json:"key,omitempty,optional"`
Url string `json:"url,omitempty,optional"`
}

Button struct {
Name string `json:"name,optional"`
SubButton []*SubButton `json:"sub_button,optional"`
Id int `json:"id,optional"`
}

MatchRule struct {
TagId string `json:"tag_id,optional"`
Sex string `json:"sex,optional"`
Country string `json:"country,optional"`
Province string `json:"province,optional"`
City string `json:"city,optional"`
Language string `json:"language,optional"`
}
Menu struct {
Id int64 `json:"id,optional"`
Button []*Button `json:"button,optional"`
MatchRule *MatchRule `json:"matchrule,optional"`
}
)

type (
SyncMenusRequest struct {
Menu
}

SyncMenusReply struct {
success bool `json:"success,optional"`
}
)

type (
CreateMenuRequest struct {
Menu
}

CreateMenuReply struct {
success bool `json:"success,optional"`
}
)

type (
QunerySubButton struct {
QueryList []SubButton `json:"list,optional"`
}
QueryButton struct {
Name string `json:"name,optional"`
SubButton []*QunerySubButton `json:"sub_button,optional"`
Id int `json:"id,optional"`
}

SelfMenuInfo struct {
Button *QueryButton `json:"button,optional"`
}

QueryMenusReply struct {
IsMenuOpen int64 `json:"is_menu_open,optional"`
SelfMenuInfo SelfMenuInfo `json:"selfmenu_info,optional"`
}
)


type (
DeleteMenuReply struct {
success bool `json:"success"`
}
)
1 change: 1 addition & 0 deletions api/powerx.api
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ info(
import "admin.api"
import "admin.crm.api"
import "admin.scrm.api"
import "admin.wechat.offiaccount.api"
import "mp.api"
import "web.api"

Expand Down
8 changes: 4 additions & 4 deletions cmd/ctl/database/migrate/powerx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import (
"PowerX/cmd/ctl/database/custom/migrate"
"PowerX/internal/config"
"PowerX/internal/model"
"PowerX/internal/model/customerdomain"
"PowerX/internal/model/crm/customerdomain"
"PowerX/internal/model/crm/market"
"PowerX/internal/model/crm/product"
"PowerX/internal/model/crm/trade"
infoorganizatoin "PowerX/internal/model/infoorganization"
"PowerX/internal/model/market"
"PowerX/internal/model/media"
"PowerX/internal/model/membership"
"PowerX/internal/model/origanzation"
"PowerX/internal/model/permission"
"PowerX/internal/model/product"
"PowerX/internal/model/scene"
"PowerX/internal/model/scrm/app"
"PowerX/internal/model/scrm/customer"
"PowerX/internal/model/scrm/organization"
"PowerX/internal/model/scrm/resource"
"PowerX/internal/model/scrm/tag"
"PowerX/internal/model/trade"
"gorm.io/driver/mysql"
"gorm.io/driver/postgres"
"gorm.io/gorm"
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctl/database/seed/datadictionary/artisanlevel.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package datadictionary

import (
"PowerX/internal/model"
"PowerX/internal/model/product"
"PowerX/internal/model/crm/product"
)

func defaultArtisanLevelDataDictionary() *model.DataDictionaryType {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctl/database/seed/datadictionary/customertype.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package datadictionary

import (
"PowerX/internal/model"
"PowerX/internal/model/customerdomain"
"PowerX/internal/model/crm/customerdomain"
)

func defaultCustomerTypeDataDictionary() *model.DataDictionaryType {
Expand Down
2 changes: 1 addition & 1 deletion cmd/ctl/database/seed/datadictionary/mediatype.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package datadictionary

import (
"PowerX/internal/model"
"PowerX/internal/model/market"
"PowerX/internal/model/crm/market"
)

func defaultMediaTypeDataDictionary() *model.DataDictionaryType {
Expand Down
Loading