9.20/1
This commit is contained in:
257
doc/openapi.yaml
257
doc/openapi.yaml
@@ -7,6 +7,38 @@ info:
|
||||
servers:
|
||||
- url: /
|
||||
paths:
|
||||
/api/finance/categories:
|
||||
get:
|
||||
summary: 财务分类(✅ Fully Implemented)
|
||||
description: 返回其他收入/支出的分类。读取顺序:finance_categories 表 → system_parameters → app.finance.* 默认配置;前端已接入开单页分类chips。
|
||||
parameters:
|
||||
- in: header
|
||||
name: X-Shop-Id
|
||||
required: false
|
||||
schema: { type: integer }
|
||||
description: 店铺ID,缺省 1
|
||||
responses:
|
||||
'200':
|
||||
description: 成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
incomeCategories:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
key: { type: string }
|
||||
label: { type: string }
|
||||
expenseCategories:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
key: { type: string }
|
||||
label: { type: string }
|
||||
/api/dashboard/overview:
|
||||
get:
|
||||
summary: 首页概览(✅ Fully Implemented)
|
||||
@@ -65,7 +97,21 @@ paths:
|
||||
/api/accounts:
|
||||
get:
|
||||
summary: 账户列表(❌ Partially Implemented)
|
||||
description: 前端账户选择页已接入,后端返回数组或 {list:[]} 皆可。
|
||||
description: 返回启用账户列表;支持数组或 {list:[]} 两种返回格式以兼容前端。
|
||||
parameters:
|
||||
- in: query
|
||||
name: kw
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: status
|
||||
schema: { type: integer, enum: [0,1] }
|
||||
description: 仅后台使用;前端默认不传即等同 status=1
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: size
|
||||
schema: { type: integer, default: 50 }
|
||||
responses:
|
||||
'200':
|
||||
description: 成功
|
||||
@@ -82,6 +128,79 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Account'
|
||||
post:
|
||||
summary: 新增账户(❌ Partially Implemented)
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateAccountRequest'
|
||||
responses:
|
||||
'200': { description: 成功 }
|
||||
/api/accounts/{id}:
|
||||
put:
|
||||
summary: 更新账户(❌ Partially Implemented)
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer, format: int64 }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreateAccountRequest'
|
||||
responses:
|
||||
'200': { description: 成功 }
|
||||
/api/accounts/{id}/ledger:
|
||||
get:
|
||||
summary: 账户流水(❌ Partially Implemented)
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer, format: int64 }
|
||||
- in: query
|
||||
name: startDate
|
||||
schema: { type: string, format: date }
|
||||
- in: query
|
||||
name: endDate
|
||||
schema: { type: string, format: date }
|
||||
- in: query
|
||||
name: kw
|
||||
schema: { type: string }
|
||||
- in: query
|
||||
name: page
|
||||
schema: { type: integer, default: 1 }
|
||||
- in: query
|
||||
name: size
|
||||
schema: { type: integer, default: 20 }
|
||||
responses:
|
||||
'200':
|
||||
description: 成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
opening: { type: number }
|
||||
income: { type: number }
|
||||
expense: { type: number }
|
||||
ending: { type: number }
|
||||
list:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, format: int64 }
|
||||
txTime: { type: string, format: date-time }
|
||||
direction: { type: string, enum: [in, out] }
|
||||
amount: { type: number }
|
||||
src: { type: string, description: 'payments/other' }
|
||||
category: { type: string, nullable: true }
|
||||
remark: { type: string, nullable: true }
|
||||
/api/suppliers:
|
||||
get:
|
||||
summary: 供应商搜索(✅ Fully Implemented)
|
||||
@@ -148,7 +267,7 @@ paths:
|
||||
'200': { description: 成功 }
|
||||
/api/other-transactions:
|
||||
post:
|
||||
summary: 新建其他收入/支出(❌ Partially Implemented)
|
||||
summary: 新建其他收入/支出(✅ Fully Implemented)
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
@@ -448,8 +567,8 @@ paths:
|
||||
type: string
|
||||
/api/orders:
|
||||
get:
|
||||
summary: 单据列表查询(❌ Partially Implemented)
|
||||
description: 支持按时间范围与关键字筛选;参数 biz=sale|purchase,type=out|in|return;返回 {list:[]}。
|
||||
summary: 单据列表查询(✅ Fully Implemented)
|
||||
description: 支持按时间范围与关键字筛选;参数 biz=sale|purchase,type=out|in|return;返回 {list:[]}。后端已返回驼峰字段与名称(sale: customerName;purchase: supplierName)。
|
||||
parameters:
|
||||
- in: query
|
||||
name: biz
|
||||
@@ -500,7 +619,7 @@ paths:
|
||||
paymentIds:
|
||||
type: array
|
||||
items: { type: integer, format: int64 }
|
||||
description: 支持按时间范围与关键字筛选;返回 {list:[]}。前端已接入,后端待实现。
|
||||
description: 收/付款创建。注意:根据约束,sale/purchase 收/付款必须绑定订单(orderId 不可为空)。
|
||||
parameters:
|
||||
- in: query
|
||||
name: kw
|
||||
@@ -538,7 +657,7 @@ paths:
|
||||
|
||||
/api/purchase-orders:
|
||||
get:
|
||||
summary: 进货单列表查询(❌ Partially Implemented)
|
||||
summary: 进货单列表查询(✅ Fully Implemented)
|
||||
parameters:
|
||||
- in: query
|
||||
name: kw
|
||||
@@ -581,7 +700,7 @@ paths:
|
||||
|
||||
/api/payments:
|
||||
get:
|
||||
summary: 收付款流水列表(❌ Partially Implemented)
|
||||
summary: 收付款流水列表(✅ Fully Implemented)
|
||||
parameters:
|
||||
- in: query
|
||||
name: kw
|
||||
@@ -606,6 +725,7 @@ paths:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
totalAmount: { type: number }
|
||||
list:
|
||||
type: array
|
||||
items:
|
||||
@@ -614,13 +734,13 @@ paths:
|
||||
id: { type: integer, format: int64 }
|
||||
bizType: { type: string }
|
||||
direction: { type: string }
|
||||
payTime: { type: string, format: date-time }
|
||||
orderTime: { type: string, format: date-time, description: '支付时间,原 payTime' }
|
||||
amount: { type: number }
|
||||
accountName: { type: string }
|
||||
|
||||
/api/inventories/logs:
|
||||
get:
|
||||
summary: 库存/盘点流水列表(❌ Partially Implemented)
|
||||
summary: 库存/盘点流水列表(✅ Fully Implemented)
|
||||
parameters:
|
||||
- in: query
|
||||
name: kw
|
||||
@@ -651,19 +771,116 @@ paths:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
totalAmount: { type: number }
|
||||
list:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, format: int64 }
|
||||
bizType: { type: string }
|
||||
txTime: { type: string, format: date-time }
|
||||
amount: { type: number }
|
||||
amount: { type: number, description: '金额变化(若无则0)' }
|
||||
remark: { type: string }
|
||||
productId: { type: integer, format: int64 }
|
||||
qtyDelta: { type: number }
|
||||
amountDelta: { type: number, nullable: true }
|
||||
|
||||
/api/orders/{id}:
|
||||
get:
|
||||
summary: 销售单详情(✅ Fully Implemented)
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer, format: int64 }
|
||||
responses:
|
||||
'200':
|
||||
description: 成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, format: int64 }
|
||||
orderNo: { type: string }
|
||||
orderTime: { type: string, format: date-time }
|
||||
status: { type: string }
|
||||
amount: { type: number }
|
||||
paidAmount: { type: number }
|
||||
customerId: { type: integer, format: int64, nullable: true }
|
||||
customerName: { type: string, nullable: true }
|
||||
remark: { type: string, nullable: true }
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
productId: { type: integer, format: int64 }
|
||||
name: { type: string }
|
||||
spec: { type: string }
|
||||
quantity: { type: number }
|
||||
unitPrice: { type: number }
|
||||
discountRate: { type: number }
|
||||
amount: { type: number }
|
||||
payments:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, format: int64 }
|
||||
amount: { type: number }
|
||||
payTime: { type: string, format: date-time }
|
||||
accountId: { type: integer, format: int64 }
|
||||
accountName: { type: string }
|
||||
direction: { type: string }
|
||||
|
||||
/api/purchase-orders/{id}:
|
||||
get:
|
||||
summary: 进货单详情(✅ Fully Implemented)
|
||||
parameters:
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema: { type: integer, format: int64 }
|
||||
responses:
|
||||
'200':
|
||||
description: 成功
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, format: int64 }
|
||||
orderNo: { type: string }
|
||||
orderTime: { type: string, format: date-time }
|
||||
status: { type: string }
|
||||
amount: { type: number }
|
||||
paidAmount: { type: number }
|
||||
supplierId: { type: integer, format: int64, nullable: true }
|
||||
supplierName: { type: string, nullable: true }
|
||||
remark: { type: string, nullable: true }
|
||||
items:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
productId: { type: integer, format: int64 }
|
||||
name: { type: string }
|
||||
spec: { type: string }
|
||||
quantity: { type: number }
|
||||
unitPrice: { type: number }
|
||||
amount: { type: number }
|
||||
payments:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
id: { type: integer, format: int64 }
|
||||
amount: { type: number }
|
||||
payTime: { type: string, format: date-time }
|
||||
accountId: { type: integer, format: int64 }
|
||||
accountName: { type: string }
|
||||
direction: { type: string }
|
||||
/api/attachments:
|
||||
post:
|
||||
summary: 上传附件(✅ Fully Implemented,占位图方案)
|
||||
@@ -772,6 +989,21 @@ components:
|
||||
enum: [cash, bank, alipay, wechat, other]
|
||||
balance:
|
||||
type: number
|
||||
bankName:
|
||||
type: string
|
||||
nullable: true
|
||||
bankAccount:
|
||||
type: string
|
||||
nullable: true
|
||||
CreateAccountRequest:
|
||||
type: object
|
||||
properties:
|
||||
name: { type: string }
|
||||
type: { type: string, enum: [cash, bank, alipay, wechat, other] }
|
||||
bankName: { type: string, nullable: true }
|
||||
bankAccount: { type: string, nullable: true }
|
||||
openingBalance: { type: number, nullable: true }
|
||||
status: { type: integer, enum: [0,1], default: 1 }
|
||||
Supplier:
|
||||
type: object
|
||||
properties:
|
||||
@@ -803,6 +1035,9 @@ components:
|
||||
enum: [income, expense]
|
||||
category:
|
||||
type: string
|
||||
counterpartyType:
|
||||
type: string
|
||||
enum: [customer, supplier, other]
|
||||
counterpartyId:
|
||||
type: integer
|
||||
format: int64
|
||||
|
||||
Reference in New Issue
Block a user