增加新接口定义

This commit is contained in:
2025-10-25 15:27:27 +08:00
parent ab8ea6977f
commit ea44c9caea
3 changed files with 429 additions and 0 deletions

View File

@@ -71,6 +71,15 @@ import http from '../utils/http';
* @property {string} [username]
*/
/**
* @typedef {('邮件'|'企业微信'|'飞书'|'日志')} NotifierType
*/
/**
* @typedef {object} SendTestNotificationRequest
* @property {NotifierType} type - Type 指定要测试的通知渠道
*/
/**
* 创建一个新用户
* @param {CreateUserRequest} userData - 用户信息
@@ -99,8 +108,19 @@ const getUserHistory = (id, params) => {
return http.get(`/api/v1/users/${id}/history`, { params });
};
/**
* 发送测试通知
* @param {number} id - 用户ID
* @param {SendTestNotificationRequest} data - 请求体
* @returns {Promise<string>}
*/
const sendTestNotification = (id, data) => {
return http.post(`/api/v1/users/${id}/notifications/test`, data);
};
export const UserApi = {
createUser,
login,
getUserHistory,
sendTestNotification,
};