设置用户偏好.

This commit is contained in:
lijiahang
2023-10-08 16:55:18 +08:00
parent c7defdb80d
commit fbd815a10e
30 changed files with 942 additions and 36 deletions

View File

@@ -0,0 +1,40 @@
import axios from 'axios';
type Preference = 'SYSTEM' | 'TIPS'
/**
* 用户偏好更新请求
*/
export interface PreferenceUpdateRequest {
type: Preference;
config: object;
}
/**
* 用户偏好查询响应
*/
export interface PreferenceQueryResponse {
config: object;
}
/**
* 更新用户偏好-整体
*/
export function updatePreference(request: PreferenceUpdateRequest) {
return axios.put('/infra/preference/update', request);
}
/**
* 更新用户偏好-部分
*/
export function updatePreferencePartial(request: PreferenceUpdateRequest) {
return axios.put('/infra/preference/update-partial', request);
}
/**
* 查询用户偏好
*/
export function getPreference(type: Preference) {
return axios.get<PreferenceQueryResponse>('/infra/preference/get', { params: { type } });
}