更新swagger

This commit is contained in:
2025-09-19 15:59:44 +08:00
parent 7138838183
commit 3e13b4f7b0
4 changed files with 15 additions and 15 deletions

View File

@@ -9,7 +9,7 @@ export class DeviceApi {
* @returns {Promise} 设备列表 * @returns {Promise} 设备列表
*/ */
static list() { static list() {
return http.get('/devices'); return http.get('/api/v1/devices');
} }
/** /**
@@ -18,7 +18,7 @@ export class DeviceApi {
* @returns {Promise} 创建结果 * @returns {Promise} 创建结果
*/ */
static create(deviceData) { static create(deviceData) {
return http.post('/devices', deviceData); return http.post('/api/v1/devices', deviceData);
} }
/** /**
@@ -27,7 +27,7 @@ export class DeviceApi {
* @returns {Promise} 设备详情 * @returns {Promise} 设备详情
*/ */
static get(id) { static get(id) {
return http.get(`/devices/${id}`); return http.get(`/api/v1/devices/${id}`);
} }
/** /**
@@ -37,7 +37,7 @@ export class DeviceApi {
* @returns {Promise} 更新结果 * @returns {Promise} 更新结果
*/ */
static update(id, deviceData) { static update(id, deviceData) {
return http.put(`/devices/${id}`, deviceData); return http.put(`/api/v1/devices/${id}`, deviceData);
} }
/** /**
@@ -46,7 +46,7 @@ export class DeviceApi {
* @returns {Promise} 删除结果 * @returns {Promise} 删除结果
*/ */
static delete(id) { static delete(id) {
return http.delete(`/devices/${id}`); return http.delete(`/api/v1/devices/${id}`);
} }
} }

View File

@@ -9,7 +9,7 @@ export class PlanApi {
* @returns {Promise} 计划列表 * @returns {Promise} 计划列表
*/ */
static list() { static list() {
return http.get('/plans'); return http.get('/api/v1/plans');
} }
/** /**
@@ -18,7 +18,7 @@ export class PlanApi {
* @returns {Promise} 创建结果 * @returns {Promise} 创建结果
*/ */
static create(planData) { static create(planData) {
return http.post('/plans', planData); return http.post('/api/v1/plans', planData);
} }
/** /**
@@ -27,7 +27,7 @@ export class PlanApi {
* @returns {Promise} 计划详情 * @returns {Promise} 计划详情
*/ */
static get(id) { static get(id) {
return http.get(`/plans/${id}`); return http.get(`/api/v1/plans/${id}`);
} }
/** /**
@@ -37,7 +37,7 @@ export class PlanApi {
* @returns {Promise} 更新结果 * @returns {Promise} 更新结果
*/ */
static update(id, planData) { static update(id, planData) {
return http.put(`/plans/${id}`, planData); return http.put(`/api/v1/plans/${id}`, planData);
} }
/** /**
@@ -46,7 +46,7 @@ export class PlanApi {
* @returns {Promise} 删除结果 * @returns {Promise} 删除结果
*/ */
static delete(id) { static delete(id) {
return http.delete(`/plans/${id}`); return http.delete(`/api/v1/plans/${id}`);
} }
/** /**
@@ -55,7 +55,7 @@ export class PlanApi {
* @returns {Promise} 启动结果 * @returns {Promise} 启动结果
*/ */
static start(id) { static start(id) {
return http.post(`/plans/${id}/start`); return http.post(`/api/v1/plans/${id}/start`);
} }
/** /**
@@ -64,7 +64,7 @@ export class PlanApi {
* @returns {Promise} 停止结果 * @returns {Promise} 停止结果
*/ */
static stop(id) { static stop(id) {
return http.post(`/plans/${id}/stop`); return http.post(`/api/v1/plans/${id}/stop`);
} }
} }

View File

@@ -10,7 +10,7 @@ export class UserApi {
* @returns {Promise} 创建结果 * @returns {Promise} 创建结果
*/ */
static create(userData) { static create(userData) {
return http.post('/users', userData); return http.post('/api/v1/users', userData);
} }
/** /**
@@ -19,7 +19,7 @@ export class UserApi {
* @returns {Promise} 登录结果 * @returns {Promise} 登录结果
*/ */
static login(credentials) { static login(credentials) {
return http.post('/users/login', credentials); return http.post('/api/v1/users/login', credentials);
} }
} }

View File

@@ -5,7 +5,7 @@ const API_CONFIG = {
// API端点 // API端点
ENDPOINTS: { ENDPOINTS: {
DEVICES: '/devices' DEVICES: '/api/v1/devices'
}, },
// 请求超时时间(毫秒) // 请求超时时间(毫秒)