Files
one-pipe-system/docs/新功能.md
sexygoat 222e5bb11a Initial commit: One Pipe System
完整的管理系统,包含账户管理、卡片管理、套餐管理、财务管理等功能模块。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-22 16:35:33 +08:00

379 lines
6.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 在账号管理下面新增一个平台账号, 然后需要写页面对接API, 页面样式可以参考/system/account 都需要token认证 逻辑啥的跟/system/account差不多
## 1. 平台账号列表
```json
"url": "/api/admin/platform-accounts",
"methods": "GET",
Query :
export interface ApifoxModel {
/**
*
*/
page?: number;
/**
*
*/
page_size?: number;
/**
*
*/
phone?: string;
/**
* (0:, 1:)
*/
status?: number | null;
/**
*
*/
username?: string;
[property: string]: any;
}
/**
* ModelAccountPageResult
*/
export interface ApifoxModel {
/**
*
*/
items?: ModelAccountResponse[] | null;
/**
*
*/
page?: number;
/**
*
*/
size?: number;
/**
*
*/
total?: number;
[property: string]: any;
}
/**
* ModelAccountResponse
*/
export interface ModelAccountResponse {
/**
*
*/
created_at?: string;
/**
* ID
*/
creator?: number;
/**
* ID
*/
enterprise_id?: number | null;
/**
* ID
*/
id?: number;
/**
*
*/
phone?: string;
/**
* ID
*/
shop_id?: number | null;
/**
* (0:, 1:)
*/
status?: number;
/**
*
*/
updated_at?: string;
/**
* ID
*/
updater?: number;
/**
* (1:, 2:, 3:, 4:)
*/
user_type?: number;
/**
*
*/
username?: string;
[property: string]: any;
}
{
"items": [
{
"created_at": "string",
"creator": 0,
"enterprise_id": 0,
"id": 0,
"phone": "string",
"shop_id": 0,
"status": 0,
"updated_at": "string",
"updater": 0,
"user_type": 0,
"username": "string"
}
],
"page": 0,
"size": 0,
"total": 0
}
```
## 2. 新增平台账号
url: /api/admin/platform-accounts,
methods: post,
Body 参数
/**
* ModelCreateAccountRequest
*/
export interface ApifoxModel {
/**
* 关联企业ID企业账号必填
*/
enterprise_id?: number | null;
/**
* 密码
*/
password: string;
/**
* 手机号
*/
phone: string;
/**
* 关联店铺ID代理账号必填
*/
shop_id?: number | null;
/**
* 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
*/
user_type: number;
/**
* 用户名
*/
username: string;
[property: string]: any;
}
返回响应:
/**
* ModelAccountResponse
*/
export interface ApifoxModel {
/**
* 创建时间
*/
created_at?: string;
/**
* 创建人ID
*/
creator?: number;
/**
* 关联企业ID
*/
enterprise_id?: number | null;
/**
* 账号ID
*/
id?: number;
/**
* 手机号
*/
phone?: string;
/**
* 关联店铺ID
*/
shop_id?: number | null;
/**
* 状态 (0:禁用, 1:启用)
*/
status?: number;
/**
* 更新时间
*/
updated_at?: string;
/**
* 更新人ID
*/
updater?: number;
/**
* 用户类型 (1:超级管理员, 2:平台用户, 3:代理账号, 4:企业账号)
*/
user_type?: number;
/**
* 用户名
*/
username?: string;
[property: string]: any;
}
*
{
"created_at": "string",
"creator": 0,
"enterprise_id": 0,
"id": 0,
"phone": "string",
"shop_id": 0,
"status": 0,
"updated_at": "string",
"updater": 0,
"user_type": 0,
"username": "string"
}
## 3. 移除角色
url: /api/admin/platform-accounts/{account_id}/roles/{role_id}
methods: delete
path参数:
export interface ApifoxModel {
/**
* 账号ID
*/
account_id: number;
/**
* 角色ID
*/
role_id: number;
[property: string]: any;
}
* 返回响应:
* {
"code": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22.123Z"
}
## 4. 删除平台账号
url: /api/admin/platform-accounts/{id}
methods: delete
path参数:
export interface ApifoxModel {
/**
* ID
*/
id: number;
[property: string]: any;
}
响应:
* {
"code": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22.123Z"
}
## 5. 获取平台账号详情
url: /api/admin/platform-accounts/{id}
methods: get
响应: {
"created_at": "string",
"creator": 0,
"enterprise_id": 0,
"id": 0,
"phone": "string",
"shop_id": 0,
"status": 0,
"updated_at": "string",
"updater": 0,
"user_type": 0,
"username": "string"
}
## 6. 编辑平台账号
url: /api/admin/platform-accounts/{id}
methods: put
body:/**
* ModelUpdateAccountParams
*/
export interface ApifoxModel {
/**
* 密码
*/
password?: null | string;
/**
* 手机号
*/
phone?: null | string;
/**
* 状态 (0:禁用, 1:启用)
*/
status?: number | null;
/**
* 用户名
*/
username?: null | string;
[property: string]: any;
}
响应: {
"created_at": "string",
"creator": 0,
"enterprise_id": 0,
"id": 0,
"phone": "string",
"shop_id": 0,
"status": 0,
"updated_at": "string",
"updater": 0,
"user_type": 0,
"username": "string"
}
## 7. 修改密码
url: /api/admin/platform-accounts/{id}/password
methods: put
body:{
"new_password": "stringst"
}
response: {
"code": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22.123Z"
}
## 8. 获取账号角色
url: /api/admin/platform-accounts/{id}/roles
methods: get
响应: [
{
"creator": 0,
"role_desc": "string",
"role_name": "string",
"role_type": 0,
"status": 0,
"updater": 0
}
]
## 9. 分配角色
url: /api/admin/platform-accounts/{id}/roles,
methods: post
body: {
"role_ids": [
0
]
}
响应: {
"code": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22.123Z"
}
## 10. 启用/禁用账号
url: /api/admin/platform-accounts/{id}/status
methods: put,
body: {
"status": 0
}