diff --git a/website/docs.html b/website/docs.html new file mode 100644 index 0000000..26e8dde --- /dev/null +++ b/website/docs.html @@ -0,0 +1,520 @@ + + +
+ + +5分钟快速接入API
+首先需要在管理后台申请API访问密钥:
+// 登录管理后台
+// 进入"系统设置" → "API管理"
+// 点击"创建API密钥"
+// 保存生成的API Key和Secret
+
+ 选择适合您开发语言的SDK进行安装:
+ +npm install @niumall/sdk
+
+ pip install niumall-sdk
+
+ <dependency>
+ <groupId>com.niumall</groupId>
+ <artifactId>sdk</artifactId>
+ <version>1.0.0</version>
+</dependency>
+
+ 使用SDK创建采购订单:
+ +const { NiuMallClient } = require('@niumall/sdk');
+
+const client = new NiuMallClient({
+ apiKey: 'your-api-key',
+ apiSecret: 'your-api-secret',
+ baseUrl: 'https://wapi.nanniwan.com/v1'
+});
+
+// 创建采购订单
+const order = await client.orders.create({
+ supplierId: 'supplier-123',
+ productType: 'beef_cattle',
+ quantity: 50,
+ unitPrice: 15000,
+ deliveryDate: '2024-03-15'
+});
+
+console.log('订单创建成功:', order);
+
+ from niumall import NiuMallClient
+
+client = NiuMallClient(
+ api_key='your-api-key',
+ api_secret='your-api-secret',
+ base_url='https://wapi.nanniwan.com/v1'
+)
+
+# 创建采购订单
+order = client.orders.create({
+ 'supplier_id': 'supplier-123',
+ 'product_type': 'beef_cattle',
+ 'quantity': 50,
+ 'unit_price': 15000,
+ 'delivery_date': '2024-03-15'
+})
+
+print('订单创建成功:', order)
+ 完整的API接口说明
+所有API请求都需要在请求头中包含认证信息:
+Authorization: Bearer {access_token}
+或者
+X-API-Key: your-api-key
+X-API-Secret: your-api-secret
+
+ 创建采购订单
+{
+ "supplierId": "string", // 供应商ID
+ "productType": "string", // 产品类型
+ "quantity": "number", // 采购数量
+ "unitPrice": "number", // 单价(元)
+ "deliveryDate": "string", // 交货日期
+ "remarks": "string" // 备注信息
+}
+ {
+ "code": 200,
+ "message": "success",
+ "data": {
+ "orderId": "order-123456",
+ "status": "pending",
+ "createdAt": "2024-01-15T10:30:00Z"
+ }
+}
+ 获取订单详情
+{
+ "code": 200,
+ "message": "success",
+ "data": {
+ "orderId": "order-123456",
+ "supplierId": "supplier-123",
+ "productType": "beef_cattle",
+ "quantity": 50,
+ "unitPrice": 15000,
+ "totalAmount": 750000,
+ "status": "confirmed",
+ "deliveryDate": "2024-03-15",
+ "createdAt": "2024-01-15T10:30:00Z",
+ "updatedAt": "2024-01-15T11:00:00Z"
+ }
+}
+ 获取供应商列表
+?page=1&limit=20&type=beef_cattle
+ {
+ "code": 200,
+ "message": "success",
+ "data": {
+ "items": [
+ {
+ "supplierId": "supplier-123",
+ "name": "某某养殖场",
+ "type": "beef_cattle",
+ "contact": "张经理",
+ "phone": "13800138000",
+ "address": "某省某市某区"
+ }
+ ],
+ "total": 100,
+ "page": 1,
+ "limit": 20
+ }
+}
+ 多种编程语言的SDK使用说明
++ 适用于JavaScript/TypeScript开发的SDK,支持异步操作和Promise。 +
+npm install @niumall/sdk
+ const { NiuMallClient } = require('@niumall/sdk');
+const client = new NiuMallClient({ apiKey, apiSecret });
+ + 适用于Python开发的SDK,支持同步和异步请求。 +
+pip install niumall-sdk
+ from niumall import NiuMallClient
+client = NiuMallClient(api_key, api_secret)
+ + 适用于Java开发的SDK,支持Spring Boot集成。 +
+<dependency>
+ <groupId>com.niumall</groupId>
+ <artifactId>sdk</artifactId>
+ <version>1.0.0</version>
+</dependency>
+ NiuMallClient client = new NiuMallClient(apiKey, apiSecret);
+ + 适用于PHP开发的SDK,支持Composer管理。 +
+composer require niumall/sdk
+ $client = new NiuMallClient($apiKey, $apiSecret);
+ 在这里您可以找到产品使用指南、常见问题解答和操作教程,快速解决使用过程中遇到的问题。
+
+ 快速上手活牛采购智能数字化系统
++ 访问系统首页,点击"免费试用"按钮,填写基本信息完成注册。 + 注册成功后使用手机号和密码登录系统。 +
++ 登录后首先配置企业基本信息、采购需求、供应商信息等基础数据, + 为后续采购业务做好准备。 +
++ 在订单管理模块创建新的采购订单,选择供应商、填写采购数量、 + 价格、交货时间等信息。 +
++ 实时跟踪订单状态,查看物流信息、质量检测结果, + 管理订单付款和结算流程。 +
+用户最关心的问题和解决方案
+