639 lines
18 KiB
Plaintext
639 lines
18 KiB
Plaintext
|
|
syntax = "v1"
|
||
|
|
|
||
|
|
info (
|
||
|
|
title: "Muyu WMS Gateway API"
|
||
|
|
desc: "Warehouse Management System API Gateway"
|
||
|
|
author: "muyu"
|
||
|
|
version: "1.0"
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Common Types ====================
|
||
|
|
type IdResp {
|
||
|
|
Id string `json:"id"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type PageReq {
|
||
|
|
Page int64 `form:"page,default=1"`
|
||
|
|
PageSize int64 `form:"pageSize,default=20"`
|
||
|
|
}
|
||
|
|
|
||
|
|
// ==================== Auth Types ====================
|
||
|
|
type (
|
||
|
|
LoginReq {
|
||
|
|
Username string `json:"username"`
|
||
|
|
Password string `json:"password"`
|
||
|
|
}
|
||
|
|
LoginResp {
|
||
|
|
Token string `json:"token"`
|
||
|
|
UserInfo UserInfo `json:"userInfo"`
|
||
|
|
}
|
||
|
|
ChangePasswordReq {
|
||
|
|
OldPassword string `json:"oldPassword"`
|
||
|
|
NewPassword string `json:"newPassword"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== User Types ====================
|
||
|
|
type (
|
||
|
|
UserInfo {
|
||
|
|
UserId string `json:"userId"`
|
||
|
|
Username string `json:"username"`
|
||
|
|
RealName string `json:"realName"`
|
||
|
|
Phone string `json:"phone"`
|
||
|
|
Email string `json:"email"`
|
||
|
|
Avatar string `json:"avatar"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
RoleId string `json:"roleId"`
|
||
|
|
RoleName string `json:"roleName"`
|
||
|
|
LastLoginTime string `json:"lastLoginTime"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
}
|
||
|
|
CreateUserReq {
|
||
|
|
Username string `json:"username"`
|
||
|
|
Password string `json:"password"`
|
||
|
|
RealName string `json:"realName"`
|
||
|
|
Phone string `json:"phone,optional"`
|
||
|
|
Email string `json:"email,optional"`
|
||
|
|
RoleId string `json:"roleId"`
|
||
|
|
}
|
||
|
|
UpdateUserReq {
|
||
|
|
RealName string `json:"realName,optional"`
|
||
|
|
Phone string `json:"phone,optional"`
|
||
|
|
Email string `json:"email,optional"`
|
||
|
|
RoleId string `json:"roleId,optional"`
|
||
|
|
Avatar string `json:"avatar,optional"`
|
||
|
|
}
|
||
|
|
UpdateUserStatusReq {
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
}
|
||
|
|
ListUserReq {
|
||
|
|
Page int64 `form:"page,default=1"`
|
||
|
|
PageSize int64 `form:"pageSize,default=20"`
|
||
|
|
Username string `form:"username,optional"`
|
||
|
|
RealName string `form:"realName,optional"`
|
||
|
|
Phone string `form:"phone,optional"`
|
||
|
|
Status int64 `form:"status,optional,default=-1"`
|
||
|
|
}
|
||
|
|
ListUserResp {
|
||
|
|
Total int64 `json:"total"`
|
||
|
|
List []UserInfo `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Role Types ====================
|
||
|
|
type (
|
||
|
|
RoleInfo {
|
||
|
|
RoleId string `json:"roleId"`
|
||
|
|
RoleName string `json:"roleName"`
|
||
|
|
RoleKey string `json:"roleKey"`
|
||
|
|
RoleDesc string `json:"roleDesc"`
|
||
|
|
SortOrder int64 `json:"sortOrder"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
MenuIds []string `json:"menuIds"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
}
|
||
|
|
CreateRoleReq {
|
||
|
|
RoleName string `json:"roleName"`
|
||
|
|
RoleKey string `json:"roleKey"`
|
||
|
|
RoleDesc string `json:"roleDesc,optional"`
|
||
|
|
SortOrder int64 `json:"sortOrder,optional"`
|
||
|
|
}
|
||
|
|
UpdateRoleReq {
|
||
|
|
RoleName string `json:"roleName,optional"`
|
||
|
|
RoleKey string `json:"roleKey,optional"`
|
||
|
|
RoleDesc string `json:"roleDesc,optional"`
|
||
|
|
SortOrder int64 `json:"sortOrder,optional"`
|
||
|
|
}
|
||
|
|
SetRolePermissionsReq {
|
||
|
|
MenuIds []string `json:"menuIds"`
|
||
|
|
}
|
||
|
|
ListRoleReq {
|
||
|
|
Page int64 `form:"page,default=1"`
|
||
|
|
PageSize int64 `form:"pageSize,default=20"`
|
||
|
|
RoleName string `form:"roleName,optional"`
|
||
|
|
Status int64 `form:"status,optional,default=-1"`
|
||
|
|
}
|
||
|
|
ListRoleResp {
|
||
|
|
Total int64 `json:"total"`
|
||
|
|
List []RoleInfo `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Menu Types ====================
|
||
|
|
type (
|
||
|
|
MenuInfo {
|
||
|
|
MenuId string `json:"menuId"`
|
||
|
|
ParentId string `json:"parentId"`
|
||
|
|
MenuName string `json:"menuName"`
|
||
|
|
MenuType int64 `json:"menuType"`
|
||
|
|
Path string `json:"path"`
|
||
|
|
Component string `json:"component"`
|
||
|
|
Permission string `json:"permission"`
|
||
|
|
Icon string `json:"icon"`
|
||
|
|
SortOrder int64 `json:"sortOrder"`
|
||
|
|
Visible int64 `json:"visible"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
Children []MenuInfo `json:"children"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
}
|
||
|
|
CreateMenuReq {
|
||
|
|
ParentId string `json:"parentId,optional"`
|
||
|
|
MenuName string `json:"menuName"`
|
||
|
|
MenuType int64 `json:"menuType"`
|
||
|
|
Path string `json:"path,optional"`
|
||
|
|
Component string `json:"component,optional"`
|
||
|
|
Permission string `json:"permission,optional"`
|
||
|
|
Icon string `json:"icon,optional"`
|
||
|
|
SortOrder int64 `json:"sortOrder,optional"`
|
||
|
|
}
|
||
|
|
UpdateMenuReq {
|
||
|
|
ParentId string `json:"parentId,optional"`
|
||
|
|
MenuName string `json:"menuName,optional"`
|
||
|
|
MenuType int64 `json:"menuType,optional"`
|
||
|
|
Path string `json:"path,optional"`
|
||
|
|
Component string `json:"component,optional"`
|
||
|
|
Permission string `json:"permission,optional"`
|
||
|
|
Icon string `json:"icon,optional"`
|
||
|
|
SortOrder int64 `json:"sortOrder,optional"`
|
||
|
|
Visible int64 `json:"visible,optional"`
|
||
|
|
}
|
||
|
|
ListMenuResp {
|
||
|
|
List []MenuInfo `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Operation Log Types ====================
|
||
|
|
type (
|
||
|
|
OperationLogInfo {
|
||
|
|
LogId string `json:"logId"`
|
||
|
|
UserId string `json:"userId"`
|
||
|
|
Username string `json:"username"`
|
||
|
|
Module string `json:"module"`
|
||
|
|
Operation string `json:"operation"`
|
||
|
|
Method string `json:"method"`
|
||
|
|
Path string `json:"path"`
|
||
|
|
Ip string `json:"ip"`
|
||
|
|
Duration int64 `json:"duration"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
}
|
||
|
|
ListLogReq {
|
||
|
|
Page int64 `form:"page,default=1"`
|
||
|
|
PageSize int64 `form:"pageSize,default=20"`
|
||
|
|
Username string `form:"username,optional"`
|
||
|
|
Module string `form:"module,optional"`
|
||
|
|
Operation string `form:"operation,optional"`
|
||
|
|
StartTime string `form:"startTime,optional"`
|
||
|
|
EndTime string `form:"endTime,optional"`
|
||
|
|
}
|
||
|
|
ListLogResp {
|
||
|
|
Total int64 `json:"total"`
|
||
|
|
List []OperationLogInfo `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Config Types ====================
|
||
|
|
type (
|
||
|
|
ConfigInfo {
|
||
|
|
ConfigId string `json:"configId"`
|
||
|
|
ConfigKey string `json:"configKey"`
|
||
|
|
ConfigValue string `json:"configValue"`
|
||
|
|
ConfigName string `json:"configName"`
|
||
|
|
ConfigGroup string `json:"configGroup"`
|
||
|
|
Remark string `json:"remark"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
}
|
||
|
|
UpdateConfigReq {
|
||
|
|
ConfigValue string `json:"configValue"`
|
||
|
|
}
|
||
|
|
ListConfigResp {
|
||
|
|
List []ConfigInfo `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Product Types ====================
|
||
|
|
type (
|
||
|
|
ProductInfo {
|
||
|
|
ProductId string `json:"productId"`
|
||
|
|
ProductName string `json:"productName"`
|
||
|
|
ImageUrl string `json:"imageUrl"`
|
||
|
|
Spec string `json:"spec"`
|
||
|
|
Color string `json:"color"`
|
||
|
|
UnitPieces int64 `json:"unitPieces"`
|
||
|
|
UnitRolls int64 `json:"unitRolls"`
|
||
|
|
StockQuantity string `json:"stockQuantity"`
|
||
|
|
Location string `json:"location"`
|
||
|
|
CostPrice string `json:"costPrice"`
|
||
|
|
SalesPrice string `json:"salesPrice"`
|
||
|
|
Remark string `json:"remark"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
}
|
||
|
|
CreateProductReq {
|
||
|
|
ProductName string `json:"productName"`
|
||
|
|
ImageUrl string `json:"imageUrl,optional"`
|
||
|
|
Spec string `json:"spec,optional"`
|
||
|
|
Color string `json:"color,optional"`
|
||
|
|
UnitPieces int64 `json:"unitPieces,optional"`
|
||
|
|
UnitRolls int64 `json:"unitRolls,optional"`
|
||
|
|
StockQuantity string `json:"stockQuantity,optional"`
|
||
|
|
Location string `json:"location,optional"`
|
||
|
|
CostPrice string `json:"costPrice,optional"`
|
||
|
|
SalesPrice string `json:"salesPrice,optional"`
|
||
|
|
Remark string `json:"remark,optional"`
|
||
|
|
}
|
||
|
|
UpdateProductReq {
|
||
|
|
ProductName string `json:"productName,optional"`
|
||
|
|
ImageUrl string `json:"imageUrl,optional"`
|
||
|
|
Spec string `json:"spec,optional"`
|
||
|
|
Color string `json:"color,optional"`
|
||
|
|
UnitPieces int64 `json:"unitPieces,optional"`
|
||
|
|
UnitRolls int64 `json:"unitRolls,optional"`
|
||
|
|
StockQuantity string `json:"stockQuantity,optional"`
|
||
|
|
Location string `json:"location,optional"`
|
||
|
|
CostPrice string `json:"costPrice,optional"`
|
||
|
|
SalesPrice string `json:"salesPrice,optional"`
|
||
|
|
Remark string `json:"remark,optional"`
|
||
|
|
}
|
||
|
|
ListProductReq {
|
||
|
|
Page int64 `form:"page,default=1"`
|
||
|
|
PageSize int64 `form:"pageSize,default=20"`
|
||
|
|
ProductName string `form:"productName,optional"`
|
||
|
|
Spec string `form:"spec,optional"`
|
||
|
|
Color string `form:"color,optional"`
|
||
|
|
Location string `form:"location,optional"`
|
||
|
|
Status int64 `form:"status,optional,default=-1"`
|
||
|
|
}
|
||
|
|
ListProductResp {
|
||
|
|
Total int64 `json:"total"`
|
||
|
|
List []ProductInfo `json:"list"`
|
||
|
|
}
|
||
|
|
ImportProductResp {
|
||
|
|
TotalCount int64 `json:"totalCount"`
|
||
|
|
SuccessCount int64 `json:"successCount"`
|
||
|
|
FailCount int64 `json:"failCount"`
|
||
|
|
ErrorMsg string `json:"errorMsg"`
|
||
|
|
ImportId string `json:"importId"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Stock Statistics Types ====================
|
||
|
|
type (
|
||
|
|
StockSummaryResp {
|
||
|
|
ProductCount int64 `json:"productCount"`
|
||
|
|
TotalPieces int64 `json:"totalPieces"`
|
||
|
|
TotalRolls int64 `json:"totalRolls"`
|
||
|
|
TotalCostValue string `json:"totalCostValue"`
|
||
|
|
TotalSalesValue string `json:"totalSalesValue"`
|
||
|
|
}
|
||
|
|
StockGroupItem {
|
||
|
|
Name string `json:"name"`
|
||
|
|
Count int64 `json:"count"`
|
||
|
|
Quantity string `json:"quantity"`
|
||
|
|
}
|
||
|
|
StockGroupResp {
|
||
|
|
List []StockGroupItem `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Stock Check Types ====================
|
||
|
|
type (
|
||
|
|
StockCheckInfo {
|
||
|
|
CheckId string `json:"checkId"`
|
||
|
|
CheckNo string `json:"checkNo"`
|
||
|
|
CheckDate string `json:"checkDate"`
|
||
|
|
Checker string `json:"checker"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
Remark string `json:"remark"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
Details []StockCheckDetailInfo `json:"details"`
|
||
|
|
}
|
||
|
|
StockCheckDetailInfo {
|
||
|
|
DetailId string `json:"detailId"`
|
||
|
|
CheckId string `json:"checkId"`
|
||
|
|
ProductId string `json:"productId"`
|
||
|
|
ProductName string `json:"productName"`
|
||
|
|
SystemQuantity string `json:"systemQuantity"`
|
||
|
|
ActualQuantity string `json:"actualQuantity"`
|
||
|
|
DiffQuantity string `json:"diffQuantity"`
|
||
|
|
DiffAmount string `json:"diffAmount"`
|
||
|
|
Remark string `json:"remark"`
|
||
|
|
}
|
||
|
|
CreateStockCheckReq {
|
||
|
|
CheckDate string `json:"checkDate"`
|
||
|
|
Checker string `json:"checker"`
|
||
|
|
Remark string `json:"remark,optional"`
|
||
|
|
Details []StockCheckDetailReq `json:"details"`
|
||
|
|
}
|
||
|
|
StockCheckDetailReq {
|
||
|
|
ProductId string `json:"productId"`
|
||
|
|
ActualQuantity string `json:"actualQuantity"`
|
||
|
|
Remark string `json:"remark,optional"`
|
||
|
|
}
|
||
|
|
UpdateStockCheckReq {
|
||
|
|
Remark string `json:"remark,optional"`
|
||
|
|
Details []StockCheckDetailReq `json:"details"`
|
||
|
|
}
|
||
|
|
ListStockCheckReq {
|
||
|
|
Page int64 `form:"page,default=1"`
|
||
|
|
PageSize int64 `form:"pageSize,default=20"`
|
||
|
|
CheckNo string `form:"checkNo,optional"`
|
||
|
|
Status int64 `form:"status,optional,default=-1"`
|
||
|
|
StartDate string `form:"startDate,optional"`
|
||
|
|
EndDate string `form:"endDate,optional"`
|
||
|
|
}
|
||
|
|
ListStockCheckResp {
|
||
|
|
Total int64 `json:"total"`
|
||
|
|
List []StockCheckInfo `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Stock Adjust Types ====================
|
||
|
|
type (
|
||
|
|
StockAdjustInfo {
|
||
|
|
AdjustId string `json:"adjustId"`
|
||
|
|
AdjustNo string `json:"adjustNo"`
|
||
|
|
AdjustDate string `json:"adjustDate"`
|
||
|
|
AdjustReason string `json:"adjustReason"`
|
||
|
|
Operator string `json:"operator"`
|
||
|
|
Approver string `json:"approver"`
|
||
|
|
Status int64 `json:"status"`
|
||
|
|
Remark string `json:"remark"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
Details []StockAdjustDetailInfo `json:"details"`
|
||
|
|
}
|
||
|
|
StockAdjustDetailInfo {
|
||
|
|
DetailId string `json:"detailId"`
|
||
|
|
AdjustId string `json:"adjustId"`
|
||
|
|
ProductId string `json:"productId"`
|
||
|
|
ProductName string `json:"productName"`
|
||
|
|
BeforeQuantity string `json:"beforeQuantity"`
|
||
|
|
AdjustQuantity string `json:"adjustQuantity"`
|
||
|
|
AfterQuantity string `json:"afterQuantity"`
|
||
|
|
Remark string `json:"remark"`
|
||
|
|
}
|
||
|
|
CreateStockAdjustReq {
|
||
|
|
AdjustDate string `json:"adjustDate"`
|
||
|
|
AdjustReason string `json:"adjustReason"`
|
||
|
|
Remark string `json:"remark,optional"`
|
||
|
|
Details []StockAdjustDetailReq `json:"details"`
|
||
|
|
}
|
||
|
|
StockAdjustDetailReq {
|
||
|
|
ProductId string `json:"productId"`
|
||
|
|
AdjustQuantity string `json:"adjustQuantity"`
|
||
|
|
Remark string `json:"remark,optional"`
|
||
|
|
}
|
||
|
|
ApproveStockAdjustReq {
|
||
|
|
Action int64 `json:"action"`
|
||
|
|
}
|
||
|
|
ListStockAdjustReq {
|
||
|
|
Page int64 `form:"page,default=1"`
|
||
|
|
PageSize int64 `form:"pageSize,default=20"`
|
||
|
|
AdjustNo string `form:"adjustNo,optional"`
|
||
|
|
AdjustReason string `form:"adjustReason,optional"`
|
||
|
|
Status int64 `form:"status,optional,default=-1"`
|
||
|
|
StartDate string `form:"startDate,optional"`
|
||
|
|
EndDate string `form:"endDate,optional"`
|
||
|
|
}
|
||
|
|
ListStockAdjustResp {
|
||
|
|
Total int64 `json:"total"`
|
||
|
|
List []StockAdjustInfo `json:"list"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
// ==================== Services ====================
|
||
|
|
// Auth - No JWT required
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/auth
|
||
|
|
group: auth
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler LoginHandler
|
||
|
|
post /login (LoginReq) returns (LoginResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Auth - JWT required
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/auth
|
||
|
|
group: auth
|
||
|
|
jwt: Auth
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler LogoutHandler
|
||
|
|
post /logout returns (IdResp)
|
||
|
|
|
||
|
|
@handler GetUserInfoHandler
|
||
|
|
get /info returns (UserInfo)
|
||
|
|
|
||
|
|
@handler ChangePasswordHandler
|
||
|
|
put /password (ChangePasswordReq) returns (IdResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// System - User Management
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/system
|
||
|
|
group: system/user
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListUserHandler
|
||
|
|
get /users (ListUserReq) returns (ListUserResp)
|
||
|
|
|
||
|
|
@handler GetUserHandler
|
||
|
|
get /users/:id returns (UserInfo)
|
||
|
|
|
||
|
|
@handler CreateUserHandler
|
||
|
|
post /users (CreateUserReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler UpdateUserHandler
|
||
|
|
put /users/:id (UpdateUserReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler DeleteUserHandler
|
||
|
|
delete /users/:id returns (IdResp)
|
||
|
|
|
||
|
|
@handler UpdateUserStatusHandler
|
||
|
|
put /users/:id/status (UpdateUserStatusReq) returns (IdResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// System - Role Management
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/system
|
||
|
|
group: system/role
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListRoleHandler
|
||
|
|
get /roles (ListRoleReq) returns (ListRoleResp)
|
||
|
|
|
||
|
|
@handler GetRoleHandler
|
||
|
|
get /roles/:id returns (RoleInfo)
|
||
|
|
|
||
|
|
@handler CreateRoleHandler
|
||
|
|
post /roles (CreateRoleReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler UpdateRoleHandler
|
||
|
|
put /roles/:id (UpdateRoleReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler DeleteRoleHandler
|
||
|
|
delete /roles/:id returns (IdResp)
|
||
|
|
|
||
|
|
@handler SetRolePermissionsHandler
|
||
|
|
put /roles/:id/permissions (SetRolePermissionsReq) returns (IdResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// System - Menu Management
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/system
|
||
|
|
group: system/menu
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListMenuHandler
|
||
|
|
get /menus returns (ListMenuResp)
|
||
|
|
|
||
|
|
@handler GetMenuHandler
|
||
|
|
get /menus/:id returns (MenuInfo)
|
||
|
|
|
||
|
|
@handler CreateMenuHandler
|
||
|
|
post /menus (CreateMenuReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler UpdateMenuHandler
|
||
|
|
put /menus/:id (UpdateMenuReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler DeleteMenuHandler
|
||
|
|
delete /menus/:id returns (IdResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// System - Operation Logs
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/system
|
||
|
|
group: system/log
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListLogHandler
|
||
|
|
get /logs (ListLogReq) returns (ListLogResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// System - Config
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/system
|
||
|
|
group: system/config
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListConfigHandler
|
||
|
|
get /configs returns (ListConfigResp)
|
||
|
|
|
||
|
|
@handler UpdateConfigHandler
|
||
|
|
put /configs/:key (UpdateConfigReq) returns (IdResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Inventory - Product Management
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/inventory
|
||
|
|
group: inventory/product
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListProductHandler
|
||
|
|
get /products (ListProductReq) returns (ListProductResp)
|
||
|
|
|
||
|
|
@handler GetProductHandler
|
||
|
|
get /products/:id returns (ProductInfo)
|
||
|
|
|
||
|
|
@handler CreateProductHandler
|
||
|
|
post /products (CreateProductReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler UpdateProductHandler
|
||
|
|
put /products/:id (UpdateProductReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler DeleteProductHandler
|
||
|
|
delete /products/:id returns (IdResp)
|
||
|
|
|
||
|
|
@handler ImportProductHandler
|
||
|
|
post /products/import returns (ImportProductResp)
|
||
|
|
|
||
|
|
@handler ExportProductHandler
|
||
|
|
get /products/export
|
||
|
|
}
|
||
|
|
|
||
|
|
// Inventory - Stock Query & Statistics
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/inventory
|
||
|
|
group: inventory/stock
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListStockHandler
|
||
|
|
get /stocks (ListProductReq) returns (ListProductResp)
|
||
|
|
|
||
|
|
@handler GetStockSummaryHandler
|
||
|
|
get /stocks/summary returns (StockSummaryResp)
|
||
|
|
|
||
|
|
@handler GetStockByColorHandler
|
||
|
|
get /stocks/by-color returns (StockGroupResp)
|
||
|
|
|
||
|
|
@handler GetStockByLocationHandler
|
||
|
|
get /stocks/by-location returns (StockGroupResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Inventory - Stock Check
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/inventory
|
||
|
|
group: inventory/check
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListStockCheckHandler
|
||
|
|
get /checks (ListStockCheckReq) returns (ListStockCheckResp)
|
||
|
|
|
||
|
|
@handler GetStockCheckHandler
|
||
|
|
get /checks/:id returns (StockCheckInfo)
|
||
|
|
|
||
|
|
@handler CreateStockCheckHandler
|
||
|
|
post /checks (CreateStockCheckReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler UpdateStockCheckHandler
|
||
|
|
put /checks/:id (UpdateStockCheckReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler ConfirmStockCheckHandler
|
||
|
|
post /checks/:id/confirm returns (IdResp)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Inventory - Stock Adjust
|
||
|
|
@server (
|
||
|
|
prefix: /api/v1/inventory
|
||
|
|
group: inventory/adjust
|
||
|
|
jwt: Auth
|
||
|
|
middleware: AuthorityMiddleware
|
||
|
|
)
|
||
|
|
service gateway-api {
|
||
|
|
@handler ListStockAdjustHandler
|
||
|
|
get /adjusts (ListStockAdjustReq) returns (ListStockAdjustResp)
|
||
|
|
|
||
|
|
@handler GetStockAdjustHandler
|
||
|
|
get /adjusts/:id returns (StockAdjustInfo)
|
||
|
|
|
||
|
|
@handler CreateStockAdjustHandler
|
||
|
|
post /adjusts (CreateStockAdjustReq) returns (IdResp)
|
||
|
|
|
||
|
|
@handler ApproveStockAdjustHandler
|
||
|
|
post /adjusts/:id/approve (ApproveStockAdjustReq) returns (IdResp)
|
||
|
|
}
|
||
|
|
|