2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Front-end API wrapper for this module.
|
|
|
|
|
|
* Call guide: import the named API object, then call the matching method from a Vue page or composable.
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
import axios, { AxiosError, type AxiosProgressEvent } from 'axios'
|
2026-02-25 10:37:16 +08:00
|
|
|
|
import { message } from 'ant-design-vue'
|
2026-03-10 23:23:15 +08:00
|
|
|
|
import { ADMIN_API_BASE_URL } from '../config/api'
|
2026-03-27 14:55:41 +08:00
|
|
|
|
import type { IdType } from '@/utils/id'
|
2026-05-13 12:43:01 +08:00
|
|
|
|
import { clearAdminSessionStorage } from '@/utils/admin-session'
|
2026-05-15 21:10:41 +08:00
|
|
|
|
import { attachRequestSignature } from '@/utils/request-signature'
|
2026-05-23 15:16:40 +08:00
|
|
|
|
import { isAdminApiAuthFreePath } from './auth-free-paths'
|
2026-02-25 10:37:16 +08:00
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: lastErrorTime supports admin.ts by holding or executing the last error time page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-26 23:28:24 +08:00
|
|
|
|
let lastErrorTime = 0
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: lastErrorMessage supports admin.ts by holding or executing the last error message page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-26 23:28:24 +08:00
|
|
|
|
let lastErrorMessage = ''
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: ERROR_DEBOUNCE_TIME supports admin.ts by holding or executing the error debounce time page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
const ERROR_DEBOUNCE_TIME = 1000
|
2026-02-26 23:28:24 +08:00
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: adminApi supports admin.ts by holding or executing the admin api page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 10:37:16 +08:00
|
|
|
|
const adminApi = axios.create({
|
2026-03-10 23:23:15 +08:00
|
|
|
|
baseURL: ADMIN_API_BASE_URL,
|
2026-05-29 13:30:56 +08:00
|
|
|
|
timeout: 60000,
|
2026-02-25 10:37:16 +08:00
|
|
|
|
headers: {
|
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: isRefreshing supports admin.ts by holding or executing the is refreshing page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this let from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
let isRefreshing = false
|
|
|
|
|
|
let failedQueue: Array<{
|
|
|
|
|
|
resolve: (value?: any) => void
|
|
|
|
|
|
reject: (reason?: any) => void
|
|
|
|
|
|
}> = []
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: processQueue supports admin.ts by holding or executing the process queue page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
const processQueue = (error: any, token: string | null = null) => {
|
|
|
|
|
|
failedQueue.forEach(prom => {
|
|
|
|
|
|
if (error) {
|
|
|
|
|
|
prom.reject(error)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
prom.resolve(token)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
failedQueue = []
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: getStoredAdminAccessToken supports admin.ts by holding or executing the get stored admin access token page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
|
const getStoredAdminAccessToken = () => {
|
|
|
|
|
|
return localStorage.getItem('adminAccessToken') || sessionStorage.getItem('adminAccessToken')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: getRequestToken supports admin.ts by holding or executing the get request token page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
|
const getRequestToken = (request: any) => {
|
|
|
|
|
|
if (request?._authToken) {
|
|
|
|
|
|
return request._authToken as string
|
|
|
|
|
|
}
|
|
|
|
|
|
const authHeader = request?.headers?.Authorization || request?.headers?.authorization
|
|
|
|
|
|
if (typeof authHeader !== 'string') {
|
|
|
|
|
|
return null
|
|
|
|
|
|
}
|
|
|
|
|
|
return authHeader.startsWith('Bearer ') ? authHeader.slice('Bearer '.length) : null
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: isCurrentStoredAdminToken supports admin.ts by holding or executing the is current stored admin token page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
|
const isCurrentStoredAdminToken = (token: string | null) => {
|
|
|
|
|
|
return Boolean(token && token === getStoredAdminAccessToken())
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: showError supports admin.ts by holding or executing the show error page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
const showError = (msg: string) => {
|
|
|
|
|
|
const now = Date.now()
|
|
|
|
|
|
if (now - lastErrorTime > ERROR_DEBOUNCE_TIME || msg !== lastErrorMessage) {
|
|
|
|
|
|
lastErrorTime = now
|
|
|
|
|
|
lastErrorMessage = msg
|
|
|
|
|
|
message.error(msg)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: isAuthFreePath supports admin.ts by holding or executing the is auth free path page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
const isAuthFreePath = (url?: string) => {
|
2026-05-23 15:16:40 +08:00
|
|
|
|
return isAdminApiAuthFreePath(url)
|
2026-03-26 10:28:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: handleAdminTokenExpired supports admin.ts by holding or executing the handle admin token expired page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
|
const handleAdminTokenExpired = (failedToken: string | null = null) => {
|
|
|
|
|
|
if (!isCurrentStoredAdminToken(failedToken)) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-13 12:43:01 +08:00
|
|
|
|
clearAdminSessionStorage()
|
2026-03-26 10:28:28 +08:00
|
|
|
|
|
|
|
|
|
|
if (Date.now() - lastErrorTime > ERROR_DEBOUNCE_TIME || lastErrorMessage !== '登录已过期,请重新登录') {
|
|
|
|
|
|
showError('登录已过期,请重新登录')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
2026-05-13 12:43:01 +08:00
|
|
|
|
window.location.href = '/admin/login'
|
2026-03-26 10:28:28 +08:00
|
|
|
|
}, 300)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-25 10:37:16 +08:00
|
|
|
|
adminApi.interceptors.request.use(
|
2026-05-15 21:10:41 +08:00
|
|
|
|
async config => {
|
|
|
|
|
|
let token: string | null = null
|
2026-03-26 10:28:28 +08:00
|
|
|
|
if (!isAuthFreePath(config.url)) {
|
2026-05-23 15:16:40 +08:00
|
|
|
|
token = getStoredAdminAccessToken()
|
2026-02-27 16:44:41 +08:00
|
|
|
|
if (token) {
|
|
|
|
|
|
config.headers.Authorization = `Bearer ${token}`
|
|
|
|
|
|
}
|
2026-02-25 10:37:16 +08:00
|
|
|
|
}
|
2026-05-23 15:16:40 +08:00
|
|
|
|
;(config as any)._authToken = token || null
|
2026-05-15 21:10:41 +08:00
|
|
|
|
return attachRequestSignature(config, token, {
|
|
|
|
|
|
authFree: isAuthFreePath(config.url)
|
|
|
|
|
|
})
|
2026-02-25 10:37:16 +08:00
|
|
|
|
},
|
2026-03-26 10:28:28 +08:00
|
|
|
|
error => Promise.reject(error)
|
2026-02-25 10:37:16 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
adminApi.interceptors.response.use(
|
|
|
|
|
|
response => {
|
2026-02-25 19:07:39 +08:00
|
|
|
|
const res = response.data
|
|
|
|
|
|
if (res.code !== 200) {
|
2026-02-26 23:28:24 +08:00
|
|
|
|
const errorMsg = res.message || '请求失败'
|
|
|
|
|
|
if (!errorMsg.includes('权限') && !errorMsg.includes('permission')) {
|
2026-03-26 10:28:28 +08:00
|
|
|
|
showError(errorMsg)
|
2026-02-26 23:28:24 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
console.error('权限不足:', errorMsg)
|
|
|
|
|
|
}
|
|
|
|
|
|
return Promise.reject(new Error(errorMsg))
|
2026-02-25 19:07:39 +08:00
|
|
|
|
}
|
2026-03-02 10:13:20 +08:00
|
|
|
|
return res.data as any
|
2026-02-25 10:37:16 +08:00
|
|
|
|
},
|
|
|
|
|
|
async (error: AxiosError) => {
|
2026-03-26 10:28:28 +08:00
|
|
|
|
const originalRequest = error.config as any
|
2026-02-26 23:28:24 +08:00
|
|
|
|
|
|
|
|
|
|
if (error.response?.status === 401) {
|
2026-05-23 15:16:40 +08:00
|
|
|
|
const requestToken = getRequestToken(originalRequest)
|
|
|
|
|
|
|
|
|
|
|
|
if (!isCurrentStoredAdminToken(requestToken)) {
|
|
|
|
|
|
return Promise.reject(error)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-26 10:28:28 +08:00
|
|
|
|
if (!originalRequest?._retry && !isAuthFreePath(originalRequest?.url)) {
|
|
|
|
|
|
if (isRefreshing) {
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
|
failedQueue.push({ resolve, reject })
|
|
|
|
|
|
}).then(token => {
|
|
|
|
|
|
if (token) {
|
|
|
|
|
|
originalRequest.headers.Authorization = `Bearer ${token}`
|
|
|
|
|
|
}
|
|
|
|
|
|
return adminApi(originalRequest)
|
2026-02-26 23:28:24 +08:00
|
|
|
|
})
|
2026-03-26 10:28:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
originalRequest._retry = true
|
|
|
|
|
|
isRefreshing = true
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
let refreshToken = localStorage.getItem('adminRefreshToken')
|
|
|
|
|
|
if (!refreshToken) {
|
|
|
|
|
|
refreshToken = sessionStorage.getItem('adminRefreshToken')
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!refreshToken) {
|
|
|
|
|
|
throw new Error('No refresh token available')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const response = await adminAuthApi.refreshToken(refreshToken)
|
|
|
|
|
|
const newToken = (response as any).accessToken
|
|
|
|
|
|
const newRefreshToken = (response as any).refreshToken
|
|
|
|
|
|
|
|
|
|
|
|
localStorage.setItem('adminAccessToken', newToken)
|
|
|
|
|
|
localStorage.setItem('adminRefreshToken', newRefreshToken)
|
|
|
|
|
|
sessionStorage.setItem('adminAccessToken', newToken)
|
|
|
|
|
|
sessionStorage.setItem('adminRefreshToken', newRefreshToken)
|
|
|
|
|
|
|
|
|
|
|
|
processQueue(null, newToken)
|
|
|
|
|
|
originalRequest.headers.Authorization = `Bearer ${newToken}`
|
|
|
|
|
|
return adminApi(originalRequest)
|
|
|
|
|
|
} catch (refreshError) {
|
|
|
|
|
|
processQueue(refreshError, null)
|
2026-05-23 15:16:40 +08:00
|
|
|
|
handleAdminTokenExpired(requestToken)
|
2026-03-26 10:28:28 +08:00
|
|
|
|
return Promise.reject(refreshError)
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
isRefreshing = false
|
2026-02-26 23:28:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-03-26 10:28:28 +08:00
|
|
|
|
|
2026-05-23 15:16:40 +08:00
|
|
|
|
handleAdminTokenExpired(requestToken)
|
2026-03-26 10:28:28 +08:00
|
|
|
|
} else if (error.response?.status !== 403) {
|
2026-02-25 19:07:39 +08:00
|
|
|
|
const errorMsg = (error.response?.data as any)?.message || error.message || '请求失败'
|
2026-02-26 23:28:24 +08:00
|
|
|
|
showError(errorMsg)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
console.error('权限不足:', error)
|
2026-02-25 10:37:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-27 12:29:36 +08:00
|
|
|
|
if (error.response?.status === 403) {
|
|
|
|
|
|
const errorMsg = (error.response?.data as any)?.message || '权限不足'
|
|
|
|
|
|
console.error('Admin API Permission Error:', errorMsg)
|
|
|
|
|
|
return Promise.reject(new Error(errorMsg))
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-25 10:37:16 +08:00
|
|
|
|
console.error('Admin API Error:', error)
|
|
|
|
|
|
return Promise.reject(error)
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: AdminLoginRequest supports admin.ts by holding or executing the admin login request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 10:37:16 +08:00
|
|
|
|
export interface AdminLoginRequest {
|
2026-02-25 11:08:02 +08:00
|
|
|
|
account: string
|
2026-02-25 10:37:16 +08:00
|
|
|
|
password: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
shopId?: IdType
|
2026-02-25 10:37:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: AdminLoginResponse supports admin.ts by holding or executing the admin login response page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 10:37:16 +08:00
|
|
|
|
export interface AdminLoginResponse {
|
|
|
|
|
|
accessToken: string
|
|
|
|
|
|
refreshToken: string
|
|
|
|
|
|
userInfo: any
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: LoginShopSelectionResponse supports admin.ts by holding or executing the login shop selection response page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
export interface LoginShopSelectionResponse {
|
|
|
|
|
|
allowShoplessLogin: boolean
|
|
|
|
|
|
message: string
|
|
|
|
|
|
shops: Array<{
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-26 10:28:28 +08:00
|
|
|
|
shopName: string
|
|
|
|
|
|
}>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: LegalAgreementAdminVO supports admin.ts by holding or executing the legal agreement admin vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface LegalAgreementAdminVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
agreementType: 'USER_TERMS' | 'PRIVACY_POLICY'
|
|
|
|
|
|
agreementTypeName?: string
|
|
|
|
|
|
title: string
|
|
|
|
|
|
version: string
|
|
|
|
|
|
content: string
|
|
|
|
|
|
status: number
|
|
|
|
|
|
statusText?: string
|
|
|
|
|
|
effectiveTime?: string
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
updateTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: LegalAgreementAdminRequest supports admin.ts by holding or executing the legal agreement admin request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface LegalAgreementAdminRequest {
|
|
|
|
|
|
agreementType: 'USER_TERMS' | 'PRIVACY_POLICY'
|
|
|
|
|
|
title: string
|
|
|
|
|
|
version: string
|
|
|
|
|
|
content: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* adminAuthApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-02-25 10:37:16 +08:00
|
|
|
|
export const adminAuthApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `login` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: AdminLoginRequest caller-supplied value for `data: AdminLoginRequest`
|
|
|
|
|
|
*/
|
2026-02-25 10:37:16 +08:00
|
|
|
|
login: (data: AdminLoginRequest) => {
|
2026-02-27 14:20:20 +08:00
|
|
|
|
return adminApi.post<AdminLoginResponse>('/auth/login', data)
|
2026-02-25 10:37:16 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getLoginShops` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param account: string caller-supplied value for `account: string`
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
getLoginShops: (account: string) => {
|
|
|
|
|
|
return adminApi.get<LoginShopSelectionResponse>(`/auth/login-shops/${encodeURIComponent(account)}`)
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `logout` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-03-26 10:28:28 +08:00
|
|
|
|
logout: () => {
|
|
|
|
|
|
return adminApi.post<boolean>('/auth/logout')
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `switchShop` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
switchShop: (shopId?: IdType) => {
|
2026-03-26 10:28:28 +08:00
|
|
|
|
return adminApi.post<AdminLoginResponse>('/auth/switch-shop', { shopId })
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `refreshToken` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param refreshToken: string caller-supplied value for `refreshToken: string`
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
refreshToken: (refreshToken: string) => {
|
|
|
|
|
|
return adminApi.post<{ accessToken: string; refreshToken: string }>('/auth/refresh', { refreshToken })
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-02-25 10:37:16 +08:00
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: adminLegalAgreementApi supports admin.ts by holding or executing the admin legal agreement api page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export const adminLegalAgreementApi = {
|
|
|
|
|
|
list: () => adminApi.get<LegalAgreementAdminVO[]>('/legal-agreement/list'),
|
|
|
|
|
|
create: (data: LegalAgreementAdminRequest) => adminApi.post<IdType>('/legal-agreement/create', data),
|
|
|
|
|
|
update: (id: IdType, data: LegalAgreementAdminRequest) => adminApi.put<boolean>(`/legal-agreement/${id}`, data),
|
|
|
|
|
|
publish: (id: IdType) => adminApi.put<boolean>(`/legal-agreement/${id}/publish`),
|
|
|
|
|
|
disable: (id: IdType) => adminApi.put<boolean>(`/legal-agreement/${id}/disable`)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: ObjectStorageFileVO supports admin.ts by holding or executing the object storage file vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface ObjectStorageFileVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
fileName: string
|
2026-06-23 15:33:06 +08:00
|
|
|
|
fileUrl?: string
|
|
|
|
|
|
objectName?: string
|
|
|
|
|
|
primaryProvider?: string
|
|
|
|
|
|
primaryUrl?: string
|
|
|
|
|
|
backupProvider?: string
|
|
|
|
|
|
backupUrl?: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
fileSize: number
|
|
|
|
|
|
contentType: string
|
2026-06-23 15:33:06 +08:00
|
|
|
|
primaryUploadStatus?: number
|
|
|
|
|
|
backupUploadStatus?: number
|
|
|
|
|
|
backupRetryCount?: number
|
|
|
|
|
|
backupLastError?: string
|
|
|
|
|
|
backupUploadedAt?: string
|
|
|
|
|
|
backupLastRetryTime?: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
createTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: ChunkUploadInitRequest supports admin.ts by holding or executing the chunk upload init request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
export interface ChunkUploadInitRequest {
|
|
|
|
|
|
fileName: string
|
|
|
|
|
|
fileSize: number
|
|
|
|
|
|
contentType: string
|
|
|
|
|
|
fileFingerprint: string
|
|
|
|
|
|
scene: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: ChunkUploadSessionVO supports admin.ts by holding or executing the chunk upload session vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
export interface ChunkUploadSessionVO {
|
|
|
|
|
|
uploadId: string
|
|
|
|
|
|
chunkSize: number
|
|
|
|
|
|
totalChunks: number
|
|
|
|
|
|
uploadedChunks: number[]
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminFileApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const adminFileApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `uploadFile` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param file: File caller-supplied value for `file: File`
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
uploadFile: (file: File) => {
|
|
|
|
|
|
const formData = new FormData()
|
|
|
|
|
|
formData.append('file', file)
|
|
|
|
|
|
return adminApi.post<ObjectStorageFileVO>('/object-storage-file/upload', formData, {
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
'Content-Type': 'multipart/form-data'
|
|
|
|
|
|
}
|
2026-05-18 09:46:11 +08:00
|
|
|
|
}) as unknown as Promise<ObjectStorageFileVO>
|
2026-03-04 10:14:45 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `initChunkUpload` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: ChunkUploadInitRequest caller-supplied value for `data: ChunkUploadInitRequest`
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
initChunkUpload: (data: ChunkUploadInitRequest) => {
|
|
|
|
|
|
return adminApi.post<ChunkUploadSessionVO>('/object-storage-file/upload/init', data) as unknown as Promise<ChunkUploadSessionVO>
|
|
|
|
|
|
},
|
|
|
|
|
|
uploadChunk: (
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: data supports admin.ts by holding or executing the data page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
data: { uploadId: string; chunkIndex: number; totalChunks: number; chunk: Blob },
|
|
|
|
|
|
config?: { signal?: AbortSignal; onUploadProgress?: (event: AxiosProgressEvent) => void }
|
|
|
|
|
|
) => {
|
|
|
|
|
|
const formData = new FormData()
|
|
|
|
|
|
formData.append('uploadId', data.uploadId)
|
|
|
|
|
|
formData.append('chunkIndex', String(data.chunkIndex))
|
|
|
|
|
|
formData.append('totalChunks', String(data.totalChunks))
|
|
|
|
|
|
formData.append('chunk', data.chunk)
|
|
|
|
|
|
return adminApi.post<boolean>('/object-storage-file/upload/chunk', formData, {
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: headers supports admin.ts by holding or executing the headers page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
headers: {
|
|
|
|
|
|
'Content-Type': 'multipart/form-data'
|
|
|
|
|
|
},
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: signal supports admin.ts by holding or executing the signal page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
signal: config?.signal,
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: onUploadProgress supports admin.ts by holding or executing the on upload progress page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
onUploadProgress: config?.onUploadProgress
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `completeChunkUpload` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param uploadId: string caller-supplied value for `uploadId: string`
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
completeChunkUpload: (uploadId: string) => {
|
|
|
|
|
|
return adminApi.post<ObjectStorageFileVO>('/object-storage-file/upload/complete', { uploadId }) as unknown as Promise<ObjectStorageFileVO>
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `cancelChunkUpload` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param uploadId: string caller-supplied value for `uploadId: string`
|
|
|
|
|
|
*/
|
2026-03-26 11:41:38 +08:00
|
|
|
|
cancelChunkUpload: (uploadId: string) => {
|
|
|
|
|
|
return adminApi.delete<boolean>(`/object-storage-file/upload/${uploadId}`)
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getSignedUrl` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
getSignedUrl: (id: IdType) => {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
return adminApi.get<string>(`/object-storage-file/get-signed-url/${id}`) as unknown as Promise<string>
|
2026-03-04 10:14:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: Tag supports admin.ts by holding or executing the tag page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface Tag {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
tagName: string
|
|
|
|
|
|
textColor?: string
|
|
|
|
|
|
bgColor?: string
|
|
|
|
|
|
borderColor?: string
|
2026-05-23 21:56:18 +08:00
|
|
|
|
sceneGroup?: string
|
|
|
|
|
|
displayName?: string
|
|
|
|
|
|
sortOrder?: number
|
|
|
|
|
|
frontVisible?: number
|
2026-03-27 14:55:41 +08:00
|
|
|
|
shopId?: IdType
|
2026-03-27 10:35:00 +08:00
|
|
|
|
shopName?: string
|
2026-05-18 09:46:11 +08:00
|
|
|
|
type?: number
|
|
|
|
|
|
typeName?: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
createTime: string
|
|
|
|
|
|
updateTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminTagApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const adminTagApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listAllTags` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
listAllTags: () => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<Tag[]>('/tag/list/all') as unknown as Promise<Tag[]>
|
2026-03-04 10:14:45 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listTagsByShopId` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param shopId: IdType caller-supplied value for `shopId: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
listTagsByShopId: (shopId: IdType) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<Tag[]>(`/tag/list/by-shop/${shopId}`) as unknown as Promise<Tag[]>
|
2026-03-04 10:14:45 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `createTag` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType } caller-supplied value for `data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }`
|
|
|
|
|
|
*/
|
2026-05-23 21:56:18 +08:00
|
|
|
|
createTag: (data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; sceneGroup?: string; displayName?: string; sortOrder?: number; frontVisible?: number; shopId?: IdType }) => {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
return adminApi.post<IdType>('/tag/create', data)
|
2026-03-04 10:14:45 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateTag` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType } caller-supplied value for `data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; shopId?: IdType }`
|
|
|
|
|
|
*/
|
2026-05-23 21:56:18 +08:00
|
|
|
|
updateTag: (id: IdType, data: { tagName: string; textColor?: string; bgColor?: string; borderColor?: string; sceneGroup?: string; displayName?: string; sortOrder?: number; frontVisible?: number; shopId?: IdType }) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.put<boolean>(`/tag/update/${id}`, data)
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `deleteTag` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
deleteTag: (id: IdType) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.delete<boolean>(`/tag/delete/${id}`)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: Artist supports admin.ts by holding or executing the artist page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface Artist {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
nickname: string
|
|
|
|
|
|
account: string
|
|
|
|
|
|
avatar?: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
shopId?: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
shopName?: string
|
|
|
|
|
|
createTime: string
|
|
|
|
|
|
updateTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminArtistApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const adminArtistApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listArtists` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
listArtists: (shopId?: IdType) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
const params: any = {}
|
|
|
|
|
|
if (shopId) {
|
|
|
|
|
|
params.shopId = shopId
|
|
|
|
|
|
}
|
|
|
|
|
|
return adminApi.get<Artist[]>('/user/list/artists', { params })
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: Coupon supports admin.ts by holding or executing the coupon page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface Coupon {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
couponCode?: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
couponName: string
|
|
|
|
|
|
couponType: number
|
2026-03-20 12:24:56 +08:00
|
|
|
|
couponTypeName?: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
discountValue?: string
|
|
|
|
|
|
minAmount?: number
|
|
|
|
|
|
reduceAmount?: string
|
2026-03-20 12:24:56 +08:00
|
|
|
|
totalCount?: number
|
|
|
|
|
|
usedCount?: number
|
|
|
|
|
|
remainingCount?: number
|
2026-03-04 10:14:45 +08:00
|
|
|
|
startTime: string
|
|
|
|
|
|
endTime: string
|
2026-03-20 12:24:56 +08:00
|
|
|
|
status?: number
|
|
|
|
|
|
statusName?: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
shopId?: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
shopName?: string
|
2026-03-20 12:24:56 +08:00
|
|
|
|
couponScene?: string
|
|
|
|
|
|
requiredVipLevel?: string
|
|
|
|
|
|
autoMatch?: number
|
|
|
|
|
|
availableTags?: Tag[]
|
|
|
|
|
|
unavailableTags?: Tag[]
|
2026-03-04 10:14:45 +08:00
|
|
|
|
createTime: string
|
|
|
|
|
|
updateTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminCouponApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const adminCouponApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listAllCoupons` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
listAllCoupons: (shopId?: IdType) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
const params = shopId ? { shopId } : {}
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<Coupon[]>('/coupon/list/all', { params }) as unknown as Promise<Coupon[]>
|
2026-03-04 10:14:45 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `createCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
createCoupon: (data: any) => {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
return adminApi.post<IdType>('/coupon/create', data)
|
2026-03-04 10:14:45 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
updateCoupon: (id: IdType, data: any) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.put<boolean>(`/coupon/update/${id}`, data)
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `deleteCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
deleteCoupon: (id: IdType) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.delete<boolean>(`/coupon/delete/${id}`)
|
2026-03-10 23:23:15 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `distributeCoupon` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-10 23:23:15 +08:00
|
|
|
|
distributeCoupon: (data: any) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.post<boolean>('/coupon/distribute', null, { params: data })
|
2026-02-25 10:37:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: AdminCommentVO supports admin.ts by holding or executing the admin comment vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-16 14:28:42 +08:00
|
|
|
|
export interface AdminCommentVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
userId: IdType
|
|
|
|
|
|
userNickname?: string
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
shopName?: string
|
|
|
|
|
|
productId?: IdType
|
|
|
|
|
|
productTitle?: string
|
|
|
|
|
|
commentContent: string
|
|
|
|
|
|
parentCommentId?: IdType
|
|
|
|
|
|
parentCommentContent?: string
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminCommentApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-05-16 14:28:42 +08:00
|
|
|
|
export const adminCommentApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listComments` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param params: { productId?: IdType; userId?: IdType; shopId?: IdType; keyword?: string } caller-supplied value for `params: { productId?: IdType; userId?: IdType; shopId?: IdType; keyword?: string }`
|
|
|
|
|
|
*/
|
2026-05-16 14:28:42 +08:00
|
|
|
|
listComments: (params: { productId?: IdType; userId?: IdType; shopId?: IdType; keyword?: string }) => {
|
|
|
|
|
|
return adminApi.get<AdminCommentVO[]>('/comment/list', { params }) as unknown as Promise<AdminCommentVO[]>
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `deleteComment` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-05-16 14:28:42 +08:00
|
|
|
|
deleteComment: (id: IdType) => {
|
|
|
|
|
|
return adminApi.delete<boolean>(`/comment/delete/${id}`) as unknown as Promise<boolean>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: Product supports admin.ts by holding or executing the product page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 14:32:34 +08:00
|
|
|
|
export interface Product {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
|
|
|
|
|
shopId: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
shopName?: string
|
2026-02-25 14:32:34 +08:00
|
|
|
|
title: string
|
|
|
|
|
|
description: string
|
2026-05-23 21:56:18 +08:00
|
|
|
|
targetAudience?: string
|
|
|
|
|
|
precautions?: string
|
2026-02-25 14:32:34 +08:00
|
|
|
|
price: number
|
2026-03-04 10:14:45 +08:00
|
|
|
|
approximateDuration?: string
|
|
|
|
|
|
tags?: string
|
2026-02-25 14:32:34 +08:00
|
|
|
|
tagList?: string[]
|
|
|
|
|
|
tagInfos?: any[]
|
2026-03-04 10:14:45 +08:00
|
|
|
|
imageFileIds?: string
|
|
|
|
|
|
imageUrls?: string[]
|
|
|
|
|
|
bookableArtists?: string
|
|
|
|
|
|
availableCoupons?: string
|
2026-06-24 20:54:41 +08:00
|
|
|
|
frontVisible?: number
|
|
|
|
|
|
sourceType?: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
likeCount?: number
|
|
|
|
|
|
collectCount?: number
|
2026-02-25 14:32:34 +08:00
|
|
|
|
createTime: string
|
|
|
|
|
|
updateTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminProductApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-02-25 14:32:34 +08:00
|
|
|
|
export const adminProductApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listProducts` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param params: { page: number; size: number; keyword?: string; shopId?: IdType } caller-supplied value for `params: { page: number; size: number; keyword?: string; shopId?: IdType }`
|
|
|
|
|
|
*/
|
2026-05-21 18:43:59 +08:00
|
|
|
|
listProducts: (params: { page: number; size: number; keyword?: string; shopId?: IdType; tagId?: IdType; minPrice?: number; maxPrice?: number; createdFrom?: string; createdTo?: string }) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.get<{ list: Product[]; total: number; page: number; size: number }>('/product/list', { params })
|
2026-02-25 14:32:34 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listAllProducts` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
listAllProducts: () => {
|
|
|
|
|
|
return adminApi.get<Product[]>('/product/list/all')
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `createProduct` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
createProduct: (data: any) => {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
return adminApi.post<IdType>('/product/create', data)
|
2026-02-25 14:32:34 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateProduct` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
updateProduct: (id: IdType, data: any) => {
|
2026-02-27 14:20:20 +08:00
|
|
|
|
return adminApi.put<boolean>(`/product/update/${id}`, data)
|
2026-02-25 14:32:34 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `deleteProduct` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
deleteProduct: (id: IdType) => {
|
2026-02-27 14:20:20 +08:00
|
|
|
|
return adminApi.delete<boolean>(`/product/delete/${id}`)
|
2026-02-25 14:32:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: Shop supports admin.ts by holding or executing the shop page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 14:44:50 +08:00
|
|
|
|
export interface Shop {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-02-25 14:44:50 +08:00
|
|
|
|
shopName: string
|
|
|
|
|
|
description: string
|
|
|
|
|
|
address: string
|
2026-05-18 09:46:11 +08:00
|
|
|
|
mapProvider?: string
|
|
|
|
|
|
longitude?: number | string
|
|
|
|
|
|
latitude?: number | string
|
2026-02-25 14:44:50 +08:00
|
|
|
|
businessHours: string
|
2026-03-26 10:28:28 +08:00
|
|
|
|
status?: number
|
2026-03-04 10:14:45 +08:00
|
|
|
|
coverImageFileId?: string
|
|
|
|
|
|
coverImageUrls?: string[]
|
|
|
|
|
|
imageFileIds?: string
|
2026-02-26 14:20:35 +08:00
|
|
|
|
imageUrls?: string[]
|
2026-05-21 18:43:59 +08:00
|
|
|
|
themePrimaryColor?: string
|
|
|
|
|
|
themeSecondaryColor?: string
|
|
|
|
|
|
themeAccentColor?: string
|
|
|
|
|
|
themePageBgColor?: string
|
|
|
|
|
|
themeCardBgColor?: string
|
|
|
|
|
|
themeBackgroundImageFileId?: string
|
|
|
|
|
|
authorizationStartDate?: string
|
|
|
|
|
|
authorizationDays?: number
|
2026-05-18 09:46:11 +08:00
|
|
|
|
authorizationExpireTime?: string
|
|
|
|
|
|
authorizationExpired?: boolean
|
|
|
|
|
|
authorizationStatusText?: string
|
2026-02-25 14:44:50 +08:00
|
|
|
|
createTime: string
|
|
|
|
|
|
updateTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: ShopListResponse supports admin.ts by holding or executing the shop list response page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 14:44:50 +08:00
|
|
|
|
export interface ShopListResponse {
|
|
|
|
|
|
list: Shop[]
|
|
|
|
|
|
total: number
|
|
|
|
|
|
page: number
|
|
|
|
|
|
size: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: CreateShopRequest supports admin.ts by holding or executing the create shop request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 14:44:50 +08:00
|
|
|
|
export interface CreateShopRequest {
|
|
|
|
|
|
shopName: string
|
|
|
|
|
|
description: string
|
|
|
|
|
|
address: string
|
2026-05-18 09:46:11 +08:00
|
|
|
|
mapProvider?: string
|
|
|
|
|
|
longitude?: number | string
|
|
|
|
|
|
latitude?: number | string
|
2026-02-25 14:44:50 +08:00
|
|
|
|
businessHours: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
coverImageFileId?: string
|
|
|
|
|
|
imageFileIds?: string
|
2026-05-21 18:43:59 +08:00
|
|
|
|
themePrimaryColor?: string
|
|
|
|
|
|
themeSecondaryColor?: string
|
|
|
|
|
|
themeAccentColor?: string
|
|
|
|
|
|
themePageBgColor?: string
|
|
|
|
|
|
themeCardBgColor?: string
|
|
|
|
|
|
themeBackgroundImageFileId?: string
|
2026-03-26 10:28:28 +08:00
|
|
|
|
status?: number
|
2026-05-21 18:43:59 +08:00
|
|
|
|
authorizationStartDate?: string
|
|
|
|
|
|
authorizationDays?: number
|
2026-05-18 09:46:11 +08:00
|
|
|
|
authorizationExpireTime?: string
|
2026-02-25 14:44:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminShopApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-02-25 14:44:50 +08:00
|
|
|
|
export const adminShopApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listShops` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param params: { page: number; size: number; keyword?: string; shopId?: IdType } caller-supplied value for `params: { page: number; size: number; keyword?: string; shopId?: IdType }`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
listShops: (params: { page: number; size: number; keyword?: string; shopId?: IdType }) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<ShopListResponse>('/shops/list', { params }) as unknown as Promise<ShopListResponse>
|
2026-02-25 14:44:50 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listAllShops` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-02-25 17:27:52 +08:00
|
|
|
|
listAllShops: () => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<Shop[]>('/shops/list/all') as unknown as Promise<Shop[]>
|
2026-02-25 17:27:52 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `createShop` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: CreateShopRequest caller-supplied value for `data: CreateShopRequest`
|
|
|
|
|
|
*/
|
2026-02-25 14:44:50 +08:00
|
|
|
|
createShop: (data: CreateShopRequest) => {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
return adminApi.post<IdType>('/shops/create', data)
|
2026-02-25 14:44:50 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateShop` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: CreateShopRequest caller-supplied value for `data: CreateShopRequest`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
updateShop: (id: IdType, data: CreateShopRequest) => {
|
2026-02-27 14:20:20 +08:00
|
|
|
|
return adminApi.put<boolean>(`/shops/update/${id}`, data)
|
2026-02-25 14:44:50 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateShopStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param status: number caller-supplied value for `status: number`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
updateShopStatus: (id: IdType, status: number) => {
|
2026-03-26 10:28:28 +08:00
|
|
|
|
return adminApi.put<boolean>(`/shops/status/${id}`, { status })
|
2026-02-25 14:44:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: UserVO supports admin.ts by holding or executing the user vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-02-25 19:07:39 +08:00
|
|
|
|
export interface UserVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
|
|
|
|
|
shopId?: IdType
|
2026-02-25 19:07:39 +08:00
|
|
|
|
shopName?: string
|
2026-05-18 09:46:11 +08:00
|
|
|
|
shopAuthorizationExpireTime?: string
|
|
|
|
|
|
shopAuthorizationExpired?: boolean
|
2026-03-27 14:55:41 +08:00
|
|
|
|
shopIds?: IdType[]
|
2026-03-26 10:28:28 +08:00
|
|
|
|
shopNames?: string[]
|
2026-02-25 19:07:39 +08:00
|
|
|
|
nickname: string
|
|
|
|
|
|
account: string
|
|
|
|
|
|
avatar: string
|
2026-03-20 12:24:56 +08:00
|
|
|
|
phone?: string
|
2026-05-29 13:30:56 +08:00
|
|
|
|
contactPhone?: string
|
|
|
|
|
|
birthday?: string
|
|
|
|
|
|
wechatId?: string
|
|
|
|
|
|
wechatQrCode?: string
|
2026-02-25 19:07:39 +08:00
|
|
|
|
signature?: string
|
|
|
|
|
|
level?: string
|
|
|
|
|
|
type: number
|
2026-03-27 14:55:41 +08:00
|
|
|
|
vipId?: IdType
|
2026-02-25 19:07:39 +08:00
|
|
|
|
createTime: string
|
|
|
|
|
|
updateTime: string
|
2026-03-20 12:24:56 +08:00
|
|
|
|
status?: number
|
2026-02-25 19:07:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: UserRelationVO supports admin.ts by holding or executing the user relation vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface UserRelationVO {
|
|
|
|
|
|
userId: IdType
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
shopName?: string
|
|
|
|
|
|
parentUserId?: IdType
|
|
|
|
|
|
parentUserName?: string
|
|
|
|
|
|
parentRoleType?: number
|
|
|
|
|
|
parentRoleTypeName?: string
|
|
|
|
|
|
sourceType?: string
|
|
|
|
|
|
sourceTypeName?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: UserStatisticsVO supports admin.ts by holding or executing the user statistics vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface UserStatisticsVO {
|
|
|
|
|
|
totalUserCount: number
|
|
|
|
|
|
normalUserCount: number
|
|
|
|
|
|
employeeCount: number
|
|
|
|
|
|
managerCount: number
|
|
|
|
|
|
artistCount: number
|
|
|
|
|
|
vipUserCount: number
|
|
|
|
|
|
newUserCount: number
|
|
|
|
|
|
byShop?: Record<string, number>
|
|
|
|
|
|
byRole?: Record<string, number>
|
|
|
|
|
|
byParent?: Record<string, number>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: PageResult supports admin.ts by holding or executing the page result page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface PageResult<T> {
|
|
|
|
|
|
list: T[]
|
2026-02-25 19:07:39 +08:00
|
|
|
|
total: number
|
|
|
|
|
|
page: number
|
|
|
|
|
|
size: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-24 18:09:11 +08:00
|
|
|
|
export interface ArtistScheduleVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
artistId: IdType
|
|
|
|
|
|
workDate: string
|
|
|
|
|
|
startTime: string
|
|
|
|
|
|
endTime: string
|
|
|
|
|
|
slotMinutes?: number
|
|
|
|
|
|
capacity?: number
|
|
|
|
|
|
status?: number
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface ArtistScheduleRequest {
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
artistId?: IdType
|
|
|
|
|
|
workDate?: string
|
|
|
|
|
|
startTime?: string
|
|
|
|
|
|
endTime?: string
|
|
|
|
|
|
slotMinutes?: number
|
|
|
|
|
|
capacity?: number
|
|
|
|
|
|
status?: number
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface ArtistScheduleQuery {
|
|
|
|
|
|
artistId?: IdType
|
|
|
|
|
|
startDate?: string
|
|
|
|
|
|
endDate?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface PaymentOrderVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
payNo?: string
|
|
|
|
|
|
orderId: IdType
|
|
|
|
|
|
orderNo?: string
|
|
|
|
|
|
userId?: IdType
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
channel?: string
|
|
|
|
|
|
status?: string
|
|
|
|
|
|
payAmount?: number
|
|
|
|
|
|
paidAmount?: number
|
|
|
|
|
|
payTime?: string
|
|
|
|
|
|
expireTime?: string
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AfterSaleVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
afterSaleNo?: string
|
|
|
|
|
|
orderId: IdType
|
|
|
|
|
|
orderItemId?: IdType
|
|
|
|
|
|
userId?: IdType
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
type?: string
|
|
|
|
|
|
reason?: string
|
|
|
|
|
|
refundAmount?: number
|
|
|
|
|
|
status?: string
|
|
|
|
|
|
auditUserId?: IdType
|
|
|
|
|
|
auditReason?: string
|
|
|
|
|
|
auditTime?: string
|
|
|
|
|
|
refundOrderId?: IdType
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AfterSaleAuditRequest {
|
|
|
|
|
|
auditReason?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface AfterSaleQuery {
|
|
|
|
|
|
status?: string
|
|
|
|
|
|
page: number
|
|
|
|
|
|
size: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface InventoryItemVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
category?: string
|
|
|
|
|
|
itemName: string
|
|
|
|
|
|
unit?: string
|
|
|
|
|
|
stockQuantity?: number
|
|
|
|
|
|
warningThreshold?: number
|
|
|
|
|
|
warning?: boolean
|
|
|
|
|
|
status?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface InventoryItemRequest {
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
category?: string
|
|
|
|
|
|
itemName?: string
|
|
|
|
|
|
unit?: string
|
|
|
|
|
|
stockQuantity?: number
|
|
|
|
|
|
warningThreshold?: number
|
|
|
|
|
|
status?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface InventoryAdjustRequest {
|
|
|
|
|
|
changeType?: string
|
|
|
|
|
|
changeQuantity?: number
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface CampaignVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
title: string
|
|
|
|
|
|
description?: string
|
|
|
|
|
|
scene?: string
|
|
|
|
|
|
productIds?: string
|
|
|
|
|
|
couponIds?: string
|
|
|
|
|
|
status?: number
|
|
|
|
|
|
startTime?: string
|
|
|
|
|
|
endTime?: string
|
|
|
|
|
|
sortOrder?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface CampaignRequest {
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
title?: string
|
|
|
|
|
|
description?: string
|
|
|
|
|
|
scene?: string
|
|
|
|
|
|
productIds?: string
|
|
|
|
|
|
couponIds?: string
|
|
|
|
|
|
status?: number
|
|
|
|
|
|
startTime?: string
|
|
|
|
|
|
endTime?: string
|
|
|
|
|
|
sortOrder?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface OperationsAnalyticsVO {
|
|
|
|
|
|
viewCount?: number
|
|
|
|
|
|
favoriteCount?: number
|
|
|
|
|
|
cartCount?: number
|
|
|
|
|
|
orderCount?: number
|
|
|
|
|
|
paidOrderCount?: number
|
|
|
|
|
|
completedOrderCount?: number
|
|
|
|
|
|
reviewCount?: number
|
|
|
|
|
|
rebookCount?: number
|
|
|
|
|
|
totalAmount?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const adminArtistScheduleApi = {
|
|
|
|
|
|
listSchedules: (params: ArtistScheduleQuery = {}) => {
|
|
|
|
|
|
return adminApi.get<ArtistScheduleVO[]>('/artist-schedule/list', { params }) as unknown as Promise<ArtistScheduleVO[]>
|
|
|
|
|
|
},
|
|
|
|
|
|
saveSchedule: (data: ArtistScheduleRequest) => {
|
|
|
|
|
|
return adminApi.post<ArtistScheduleVO>('/artist-schedule/save', data) as unknown as Promise<ArtistScheduleVO>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const adminPaymentApi = {
|
|
|
|
|
|
manualConfirmOrder: (orderId: IdType, remark?: string) => {
|
|
|
|
|
|
return adminApi.post<PaymentOrderVO>(`/payment/order/${orderId}/manual-confirm`, undefined, {
|
|
|
|
|
|
params: { remark }
|
|
|
|
|
|
}) as unknown as Promise<PaymentOrderVO>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const adminAfterSaleApi = {
|
|
|
|
|
|
listAfterSales: (params: AfterSaleQuery) => {
|
|
|
|
|
|
return adminApi.get<PageResult<AfterSaleVO>>('/after-sale/list', { params }) as unknown as Promise<PageResult<AfterSaleVO>>
|
|
|
|
|
|
},
|
|
|
|
|
|
approveAfterSale: (id: IdType, data?: AfterSaleAuditRequest) => {
|
|
|
|
|
|
return adminApi.put<AfterSaleVO>(`/after-sale/${id}/approve`, data || {}) as unknown as Promise<AfterSaleVO>
|
|
|
|
|
|
},
|
|
|
|
|
|
rejectAfterSale: (id: IdType, data?: AfterSaleAuditRequest) => {
|
|
|
|
|
|
return adminApi.put<AfterSaleVO>(`/after-sale/${id}/reject`, data || {}) as unknown as Promise<AfterSaleVO>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const adminInventoryApi = {
|
|
|
|
|
|
listItems: (params: { page: number; size: number }) => {
|
|
|
|
|
|
return adminApi.get<PageResult<InventoryItemVO>>('/inventory/list', { params }) as unknown as Promise<PageResult<InventoryItemVO>>
|
|
|
|
|
|
},
|
|
|
|
|
|
saveItem: (data: InventoryItemRequest) => {
|
|
|
|
|
|
return adminApi.post<InventoryItemVO>('/inventory/save', data) as unknown as Promise<InventoryItemVO>
|
|
|
|
|
|
},
|
|
|
|
|
|
adjustStock: (id: IdType, data: InventoryAdjustRequest) => {
|
|
|
|
|
|
return adminApi.post<InventoryItemVO>(`/inventory/${id}/adjust`, data) as unknown as Promise<InventoryItemVO>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const adminCampaignApi = {
|
|
|
|
|
|
listCampaigns: (params: { status?: number; page: number; size: number }) => {
|
|
|
|
|
|
return adminApi.get<PageResult<CampaignVO>>('/campaign/list', { params }) as unknown as Promise<PageResult<CampaignVO>>
|
|
|
|
|
|
},
|
|
|
|
|
|
saveCampaign: (data: CampaignRequest) => {
|
|
|
|
|
|
return adminApi.post<CampaignVO>('/campaign/save', data) as unknown as Promise<CampaignVO>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminUserApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const adminUserApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
// 后台用户列表支持多维筛选;页面侧应优先展示 maskedPhone/maskedEmail,
|
|
|
|
|
|
// 避免在列表中直接暴露完整手机号或邮箱。
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `listUsers` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param params: { page: number; size: number; keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean } caller-supplied value for `params: { page: number; size: number; keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }`
|
|
|
|
|
|
*/
|
|
|
|
|
|
listUsers: (params: { page: number; size: number; keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<PageResult<UserVO>>('/user/list', { params }) as unknown as Promise<PageResult<UserVO>>
|
2026-02-25 19:38:13 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getUserStatistics` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param params: { keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean } caller-supplied value for `params: { keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }`
|
|
|
|
|
|
*/
|
|
|
|
|
|
getUserStatistics: (params: { keyword?: string; type?: number; shopId?: IdType; roleId?: IdType; parentUserId?: IdType; sourceType?: string; status?: number; vipLevel?: string; createdFrom?: string; createdTo?: string; hasPhone?: boolean; hasOrder?: boolean }) => {
|
|
|
|
|
|
return adminApi.get<UserStatisticsVO>('/user/statistics', { params }) as unknown as Promise<UserStatisticsVO>
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `listAllUsers` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
listAllUsers: () => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<UserVO[]>('/user/list/all') as unknown as Promise<UserVO[]>
|
2026-02-25 19:07:39 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `createUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
createUser: (data: any) => {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
return adminApi.post<IdType>('/user/create', data)
|
2026-02-25 19:07:39 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
updateUser: (id: IdType, data: any) => {
|
2026-02-27 14:20:20 +08:00
|
|
|
|
return adminApi.put<boolean>(`/user/update/${id}`, data)
|
2026-02-25 19:07:39 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `deleteUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
deleteUser: (id: IdType) => {
|
2026-02-27 14:20:20 +08:00
|
|
|
|
return adminApi.delete<boolean>(`/user/delete/${id}`)
|
2026-02-25 19:07:39 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `unbindUser` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
unbindUser: (id: IdType) => {
|
2026-03-26 17:39:58 +08:00
|
|
|
|
return adminApi.put<boolean>(`/user/unbind/${id}`, {})
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateUserStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param status: number caller-supplied value for `status: number`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
updateUserStatus: (id: IdType, status: number) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.put<boolean>(`/user/status/${id}`, { status })
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getRelationOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
|
|
|
|
|
*/
|
|
|
|
|
|
getRelationOptions: (shopId?: IdType) => {
|
|
|
|
|
|
return adminApi.get<UserRelationVO[]>(`/user/relation/options`, { params: { shopId } }) as unknown as Promise<UserRelationVO[]>
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `updateUserRelation` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: { shopId?: IdType; parentUserId?: IdType; parentRoleType?: number; sourceType?: string } caller-supplied value for `data: { shopId?: IdType; parentUserId?: IdType; parentRoleType?: number; sourceType?: string }`
|
|
|
|
|
|
*/
|
|
|
|
|
|
updateUserRelation: (id: IdType, data: { shopId?: IdType; parentUserId?: IdType; parentRoleType?: number; sourceType?: string }) => {
|
|
|
|
|
|
return adminApi.put<boolean>(`/user/${id}/relation`, data) as unknown as Promise<boolean>
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `resetPassword` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
resetPassword: (id: IdType) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.post<string>(`/user/reset-password/${id}`)
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getUserInfo` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
getUserInfo: () => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<UserVO>('/user/info') as unknown as Promise<UserVO>
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getUserAsset` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
getUserAsset: (id: IdType) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<UserAssetVO>(`/user/${id}/asset`) as unknown as Promise<UserAssetVO>
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getUserBalanceHistory` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
getUserBalanceHistory: (id: IdType) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.get<UserBalanceHistoryItem[]>(`/user/${id}/balance/history`) as unknown as Promise<UserBalanceHistoryItem[]>
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `changeUserBalance` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: AdminUserBalanceChangeRequest caller-supplied value for `data: AdminUserBalanceChangeRequest`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
changeUserBalance: (id: IdType, data: AdminUserBalanceChangeRequest) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.post<UserAssetVO>(`/user/${id}/balance/change`, data) as unknown as Promise<UserAssetVO>
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `overrideUserVip` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: AdminUserVipOverrideRequest caller-supplied value for `data: AdminUserVipOverrideRequest`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
overrideUserVip: (id: IdType, data: AdminUserVipOverrideRequest) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.post<UserAssetVO>(`/user/${id}/vip/override`, data) as unknown as Promise<UserAssetVO>
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `recalculateUserVip` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
recalculateUserVip: (id: IdType) => {
|
2026-03-20 12:24:56 +08:00
|
|
|
|
return adminApi.post<UserAssetVO>(`/user/${id}/vip/recalculate`) as unknown as Promise<UserAssetVO>
|
2026-02-25 19:07:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: UserAssetVO supports admin.ts by holding or executing the user asset vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-20 12:24:56 +08:00
|
|
|
|
export interface UserAssetVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
userId: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
nickname: string
|
|
|
|
|
|
balance: number
|
|
|
|
|
|
totalRechargeAmount: number
|
|
|
|
|
|
lastRechargeTime?: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
vipInfoId?: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
vipLevel: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
benefitId?: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
benefitInfo?: string
|
|
|
|
|
|
manualOverride: boolean
|
|
|
|
|
|
vipStartTime?: string
|
|
|
|
|
|
vipExpireTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: UserBalanceHistoryItem supports admin.ts by holding or executing the user balance history item page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-20 12:24:56 +08:00
|
|
|
|
export interface UserBalanceHistoryItem {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
|
|
|
|
|
userId: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
userNickname?: string
|
|
|
|
|
|
amount: number
|
|
|
|
|
|
type?: string
|
|
|
|
|
|
currentBalance?: number
|
|
|
|
|
|
beforeBalance?: number
|
|
|
|
|
|
afterBalance?: number
|
|
|
|
|
|
changeScene?: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
relatedOrderId?: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
relatedOrderNo?: string
|
|
|
|
|
|
externalOrderNo?: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
operatorId?: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
remark?: string
|
|
|
|
|
|
changeTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: AdminUserBalanceChangeRequest supports admin.ts by holding or executing the admin user balance change request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-20 12:24:56 +08:00
|
|
|
|
export interface AdminUserBalanceChangeRequest {
|
|
|
|
|
|
amount: number
|
|
|
|
|
|
changeScene: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
relatedOrderId?: IdType
|
2026-03-20 12:24:56 +08:00
|
|
|
|
externalOrderNo?: string
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: AdminUserVipOverrideRequest supports admin.ts by holding or executing the admin user vip override request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-20 12:24:56 +08:00
|
|
|
|
export interface AdminUserVipOverrideRequest {
|
|
|
|
|
|
vipLevel: string
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: userApi supports admin.ts by holding or executing the user api page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const userApi = adminUserApi
|
2026-02-25 19:07:39 +08:00
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: OrderVO supports admin.ts by holding or executing the order vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface OrderVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
orderNo: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
userId: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
userNickname?: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
shopId: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
shopName?: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
artistId?: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
artistName?: string
|
|
|
|
|
|
totalAmount: number
|
2026-05-21 18:43:59 +08:00
|
|
|
|
actualAmount?: number
|
2026-03-04 10:14:45 +08:00
|
|
|
|
discountAmount: number
|
|
|
|
|
|
payAmount: number
|
2026-05-24 18:09:11 +08:00
|
|
|
|
paidAmount?: number
|
|
|
|
|
|
paymentStatus?: string
|
|
|
|
|
|
paymentMethod?: string
|
|
|
|
|
|
paymentOrderNo?: string
|
|
|
|
|
|
payTime?: string
|
|
|
|
|
|
refundStatus?: string
|
2026-06-04 16:39:06 +08:00
|
|
|
|
customerRemark?: string
|
|
|
|
|
|
quoteStatus?: string
|
|
|
|
|
|
quoteStatusText?: string
|
|
|
|
|
|
quoteUserConfirmed?: boolean
|
|
|
|
|
|
quoteShopConfirmed?: boolean
|
|
|
|
|
|
quoteExpireTime?: string
|
|
|
|
|
|
quoteConfirmedTime?: string
|
|
|
|
|
|
quoteMessages?: any[]
|
2026-05-21 18:43:59 +08:00
|
|
|
|
couponName?: string
|
|
|
|
|
|
customerName?: string
|
|
|
|
|
|
customerPhone?: string
|
|
|
|
|
|
customerNickname?: string
|
|
|
|
|
|
customerPhoneMasked?: string
|
|
|
|
|
|
items?: Array<{
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
productId: IdType
|
|
|
|
|
|
productTitle?: string
|
|
|
|
|
|
artistId?: IdType
|
|
|
|
|
|
artistName?: string
|
|
|
|
|
|
appointmentTime?: string
|
|
|
|
|
|
price: number
|
2026-06-04 16:39:06 +08:00
|
|
|
|
referencePrice?: number
|
|
|
|
|
|
quotedPrice?: number
|
|
|
|
|
|
confirmedPrice?: number
|
2026-05-21 18:43:59 +08:00
|
|
|
|
quantity: number
|
|
|
|
|
|
}>
|
2026-02-26 10:21:02 +08:00
|
|
|
|
status: number
|
2026-03-04 10:14:45 +08:00
|
|
|
|
statusText?: string
|
|
|
|
|
|
remark?: string
|
2026-02-26 10:21:02 +08:00
|
|
|
|
createTime: string
|
|
|
|
|
|
updateTime: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminOrderApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const adminOrderApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listOrders` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param params: { page: number; size: number; keyword?: string; status?: number; shopId?: IdType } caller-supplied value for `params: { page: number; size: number; keyword?: string; status?: number; shopId?: IdType }`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
listOrders: (params: { page: number; size: number; keyword?: string; status?: number; shopId?: IdType }) => {
|
2026-03-04 10:14:45 +08:00
|
|
|
|
return adminApi.get<PageResult<OrderVO>>('/order/list', { params })
|
2026-02-26 10:21:02 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `updateOrderStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param status: number caller-supplied value for `status: number`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
updateOrderStatus: (id: IdType, status: number) => {
|
2026-05-21 18:43:59 +08:00
|
|
|
|
return adminApi.put<boolean>(`/order/update-status/${id}`, {}, { params: { status } })
|
2026-05-24 18:09:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
manualConfirmPayment: (id: IdType, remark?: string) => {
|
|
|
|
|
|
return adminPaymentApi.manualConfirmOrder(id, remark)
|
2026-06-04 16:39:06 +08:00
|
|
|
|
},
|
|
|
|
|
|
submitQuote: (id: IdType, data: { remark?: string; items: Array<{ orderItemId: IdType; quotedPrice: number }> }) => {
|
|
|
|
|
|
return adminApi.post<OrderVO>(`/order/${id}/quote`, data)
|
|
|
|
|
|
},
|
|
|
|
|
|
confirmQuote: (id: IdType) => {
|
|
|
|
|
|
return adminApi.put<OrderVO>(`/order/${id}/quote/confirm`)
|
2026-02-26 10:21:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: HotProductVO supports admin.ts by holding or executing the hot product vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface HotProductVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-26 10:28:28 +08:00
|
|
|
|
title: string
|
|
|
|
|
|
price: number
|
|
|
|
|
|
likeCount: number
|
|
|
|
|
|
collectCount: number
|
2026-03-04 10:14:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: RecentActivityVO supports admin.ts by holding or executing the recent activity vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface RecentActivityVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
2026-03-04 10:14:45 +08:00
|
|
|
|
type: string
|
2026-03-26 10:28:28 +08:00
|
|
|
|
title?: string
|
2026-02-26 17:54:18 +08:00
|
|
|
|
description: string
|
2026-03-04 10:14:45 +08:00
|
|
|
|
time: string
|
2026-03-10 23:23:15 +08:00
|
|
|
|
color?: string
|
2026-02-26 17:54:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: DashboardStats supports admin.ts by holding or executing the dashboard stats page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export interface DashboardStats {
|
|
|
|
|
|
totalUsers: number
|
|
|
|
|
|
totalProducts: number
|
|
|
|
|
|
totalShops: number
|
|
|
|
|
|
todayOrders: number
|
2026-05-21 18:43:59 +08:00
|
|
|
|
totalOrderAmount?: number
|
|
|
|
|
|
todayOrderAmount?: number
|
|
|
|
|
|
weekOrderAmount?: number
|
|
|
|
|
|
totalCustomers?: number
|
|
|
|
|
|
totalArtists?: number
|
|
|
|
|
|
newCustomersToday?: number
|
|
|
|
|
|
newCustomers7Days?: number
|
|
|
|
|
|
newOrders7Days?: number
|
|
|
|
|
|
pendingOrders?: number
|
|
|
|
|
|
completedOrders?: number
|
2026-03-04 10:14:45 +08:00
|
|
|
|
hotProducts: HotProductVO[]
|
|
|
|
|
|
recentActivities: RecentActivityVO[]
|
2026-02-25 19:07:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminDashboardApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export const adminDashboardApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getStats` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-03-04 10:14:45 +08:00
|
|
|
|
getStats: () => {
|
|
|
|
|
|
return adminApi.get<DashboardStats>('/dashboard/stats')
|
2026-05-24 18:09:11 +08:00
|
|
|
|
},
|
|
|
|
|
|
getAnalytics: () => {
|
|
|
|
|
|
return adminApi.get<OperationsAnalyticsVO>('/dashboard/analytics') as unknown as Promise<OperationsAnalyticsVO>
|
2026-02-26 15:39:39 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: NailArtistInfoVO supports admin.ts by holding or executing the nail artist info vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-03-04 15:42:43 +08:00
|
|
|
|
export interface NailArtistInfoVO {
|
2026-03-27 14:55:41 +08:00
|
|
|
|
id: IdType
|
|
|
|
|
|
userId: IdType
|
2026-03-04 15:42:43 +08:00
|
|
|
|
identity: string
|
|
|
|
|
|
experience: number
|
|
|
|
|
|
skills: string
|
|
|
|
|
|
rating: number
|
|
|
|
|
|
status: number
|
|
|
|
|
|
portfolio: string
|
|
|
|
|
|
nickname: string
|
2026-03-27 14:55:41 +08:00
|
|
|
|
shopId: IdType
|
2026-03-04 15:42:43 +08:00
|
|
|
|
shopName: string
|
2026-05-18 09:46:11 +08:00
|
|
|
|
userType?: number
|
|
|
|
|
|
userTypeName?: string
|
|
|
|
|
|
participateProduction?: number
|
|
|
|
|
|
workStartTime?: string
|
|
|
|
|
|
workEndTime?: string
|
2026-03-04 15:42:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* adminNailArtistApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
2026-03-04 15:42:43 +08:00
|
|
|
|
export const adminNailArtistApi = {
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `listNailArtists` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
2026-03-04 15:42:43 +08:00
|
|
|
|
listNailArtists: () => {
|
2026-05-24 18:09:11 +08:00
|
|
|
|
return adminApi.get<NailArtistInfoVO[]>('/nail-artist/list') as unknown as Promise<NailArtistInfoVO[]>
|
2026-03-04 15:42:43 +08:00
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `getNailArtistInfo` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param userId: IdType caller-supplied value for `userId: IdType`
|
|
|
|
|
|
*/
|
2026-03-27 14:55:41 +08:00
|
|
|
|
getNailArtistInfo: (userId: IdType) => {
|
2026-03-04 15:42:43 +08:00
|
|
|
|
return adminApi.get<NailArtistInfoVO>(`/nail-artist/get/${userId}`)
|
|
|
|
|
|
},
|
2026-05-18 09:46:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* `saveNailArtistInfo` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: any caller-supplied value for `data: any`
|
|
|
|
|
|
*/
|
2026-03-04 15:42:43 +08:00
|
|
|
|
saveNailArtistInfo: (data: any) => {
|
|
|
|
|
|
return adminApi.post<NailArtistInfoVO>('/nail-artist/save', data)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: SystemMessageVO supports admin.ts by holding or executing the system message vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface SystemMessageVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
title: string
|
|
|
|
|
|
content: string
|
|
|
|
|
|
imageFileId?: IdType
|
|
|
|
|
|
imageUrl?: string
|
|
|
|
|
|
publisherId: IdType
|
|
|
|
|
|
publisherName?: string
|
|
|
|
|
|
publisherType: number
|
|
|
|
|
|
targetType: string
|
|
|
|
|
|
targetTypeName?: string
|
|
|
|
|
|
targetIds?: IdType[]
|
|
|
|
|
|
popupEnabled: number
|
|
|
|
|
|
status: number
|
|
|
|
|
|
publishTime?: string
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
popupShown?: number
|
|
|
|
|
|
readStatus?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: MessageTargetOptionsVO supports admin.ts by holding or executing the message target options vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface MessageTargetOptionsVO {
|
|
|
|
|
|
shops: Array<{ id: IdType; shopName: string }>
|
|
|
|
|
|
users: Array<{ id: IdType; nickname: string; account: string; shopId?: IdType; shopName?: string; type?: number }>
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: SystemMessageCreateRequest supports admin.ts by holding or executing the system message create request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface SystemMessageCreateRequest {
|
|
|
|
|
|
title: string
|
|
|
|
|
|
content: string
|
|
|
|
|
|
imageFileId?: IdType
|
|
|
|
|
|
targetType: string
|
|
|
|
|
|
shopIds?: IdType[]
|
|
|
|
|
|
userIds?: IdType[]
|
|
|
|
|
|
popupEnabled?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* adminSystemMessageApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const adminSystemMessageApi = {
|
|
|
|
|
|
// 消息通知会进入用户“消息通知”列表;如果 popupEnabled=1,
|
|
|
|
|
|
// 前端展示弹窗后必须调用 mark popup-shown,保证每人每条只弹一次。
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `listMessages` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
|
|
|
|
|
listMessages: () => {
|
|
|
|
|
|
return adminApi.get<SystemMessageVO[]>('/system-message/admin/list') as unknown as Promise<SystemMessageVO[]>
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `createMessage` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: SystemMessageCreateRequest caller-supplied value for `data: SystemMessageCreateRequest`
|
|
|
|
|
|
*/
|
|
|
|
|
|
createMessage: (data: SystemMessageCreateRequest) => {
|
|
|
|
|
|
return adminApi.post<IdType>('/system-message/admin/create', data)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `revokeMessage` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
|
|
|
|
|
revokeMessage: (id: IdType) => {
|
|
|
|
|
|
return adminApi.put<boolean>(`/system-message/admin/${id}/revoke`)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `getTargetOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
|
|
|
|
|
getTargetOptions: () => {
|
|
|
|
|
|
return adminApi.get<MessageTargetOptionsVO>('/system-message/admin/target-options') as unknown as Promise<MessageTargetOptionsVO>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: AnnouncementVO supports admin.ts by holding or executing the announcement vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface AnnouncementVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
title: string
|
|
|
|
|
|
content: string
|
|
|
|
|
|
publisherId?: IdType
|
|
|
|
|
|
publisherName?: string
|
|
|
|
|
|
publisherType?: number
|
|
|
|
|
|
targetType: string
|
|
|
|
|
|
targetTypeName?: string
|
|
|
|
|
|
targetIds?: IdType[]
|
|
|
|
|
|
status: number
|
|
|
|
|
|
sortOrder?: number
|
|
|
|
|
|
publishTime?: string
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: AnnouncementCreateRequest supports admin.ts by holding or executing the announcement create request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface AnnouncementCreateRequest {
|
|
|
|
|
|
title: string
|
|
|
|
|
|
content: string
|
|
|
|
|
|
targetType: string
|
|
|
|
|
|
shopIds?: IdType[]
|
|
|
|
|
|
userIds?: IdType[]
|
|
|
|
|
|
sortOrder?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* adminAnnouncementApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const adminAnnouncementApi = {
|
|
|
|
|
|
// 公告只在首页顶部滚动显示,不写入消息已读/未读状态。
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `listAnnouncements` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
|
|
|
|
|
listAnnouncements: () => {
|
|
|
|
|
|
return adminApi.get<AnnouncementVO[]>('/announcement/admin/list') as unknown as Promise<AnnouncementVO[]>
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `createAnnouncement` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: AnnouncementCreateRequest caller-supplied value for `data: AnnouncementCreateRequest`
|
|
|
|
|
|
*/
|
|
|
|
|
|
createAnnouncement: (data: AnnouncementCreateRequest) => {
|
|
|
|
|
|
return adminApi.post<IdType>('/announcement/admin/create', data)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `revokeAnnouncement` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
*/
|
|
|
|
|
|
revokeAnnouncement: (id: IdType) => {
|
|
|
|
|
|
return adminApi.put<boolean>(`/announcement/admin/${id}/revoke`)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `getTargetOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
|
|
|
|
|
getTargetOptions: () => {
|
|
|
|
|
|
return adminApi.get<MessageTargetOptionsVO>('/announcement/admin/target-options') as unknown as Promise<MessageTargetOptionsVO>
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: VipRechargePlanVO supports admin.ts by holding or executing the vip recharge plan vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface VipRechargePlanVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
shopId: IdType
|
|
|
|
|
|
shopName?: string
|
|
|
|
|
|
title: string
|
|
|
|
|
|
rechargeAmount: number
|
|
|
|
|
|
giftAmount: number
|
|
|
|
|
|
vipLevel: string
|
|
|
|
|
|
description?: string
|
|
|
|
|
|
sortOrder?: number
|
|
|
|
|
|
status: number
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
updateTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: VipRechargePlanRequest supports admin.ts by holding or executing the vip recharge plan request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface VipRechargePlanRequest {
|
|
|
|
|
|
shopId?: IdType
|
|
|
|
|
|
title: string
|
|
|
|
|
|
rechargeAmount: number
|
|
|
|
|
|
giftAmount: number
|
|
|
|
|
|
vipLevel: string
|
|
|
|
|
|
description?: string
|
|
|
|
|
|
sortOrder?: number
|
|
|
|
|
|
status?: number
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* adminVipRechargePlanApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const adminVipRechargePlanApi = {
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `listPlans` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
|
|
|
|
|
*/
|
|
|
|
|
|
listPlans: (shopId?: IdType) => {
|
|
|
|
|
|
const params = shopId ? { shopId } : {}
|
|
|
|
|
|
return adminApi.get<VipRechargePlanVO[]>('/vip-recharge-plan/admin/list', { params }) as unknown as Promise<VipRechargePlanVO[]>
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `createPlan` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: VipRechargePlanRequest caller-supplied value for `data: VipRechargePlanRequest`
|
|
|
|
|
|
*/
|
|
|
|
|
|
createPlan: (data: VipRechargePlanRequest) => {
|
|
|
|
|
|
return adminApi.post<IdType>('/vip-recharge-plan/admin/create', data)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `updatePlan` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: VipRechargePlanRequest caller-supplied value for `data: VipRechargePlanRequest`
|
|
|
|
|
|
*/
|
|
|
|
|
|
updatePlan: (id: IdType, data: VipRechargePlanRequest) => {
|
|
|
|
|
|
return adminApi.put<boolean>(`/vip-recharge-plan/admin/${id}`, data)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `updateStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param status: number caller-supplied value for `status: number`
|
|
|
|
|
|
*/
|
|
|
|
|
|
updateStatus: (id: IdType, status: number) => {
|
|
|
|
|
|
return adminApi.put<boolean>(`/vip-recharge-plan/admin/${id}/status`, null, { params: { status } })
|
2026-05-21 18:43:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `listVipLevelOptions` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param shopId?: IdType caller-supplied value for `shopId?: IdType`
|
|
|
|
|
|
*/
|
|
|
|
|
|
listVipLevelOptions: (shopId?: IdType) => {
|
|
|
|
|
|
const params = shopId ? { shopId } : {}
|
|
|
|
|
|
return adminApi.get<string[]>('/vip-recharge-plan/admin/vip-level-options', { params }) as unknown as Promise<string[]>
|
2026-05-18 09:46:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: MessageHubPushConfigVO supports admin.ts by holding or executing the message hub push config vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface MessageHubPushConfigVO {
|
|
|
|
|
|
id: IdType
|
|
|
|
|
|
sceneCode: string
|
|
|
|
|
|
sceneName: string
|
|
|
|
|
|
platform: string
|
|
|
|
|
|
msgType: string
|
|
|
|
|
|
queueName: string
|
|
|
|
|
|
sourceSystem: string
|
|
|
|
|
|
templateCode: string
|
|
|
|
|
|
channelId?: IdType
|
|
|
|
|
|
sendMethod?: string
|
|
|
|
|
|
enabled: number
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
updateTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: MessageHubPushConfigRequest supports admin.ts by holding or executing the message hub push config request page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface MessageHubPushConfigRequest {
|
|
|
|
|
|
sceneCode: string
|
|
|
|
|
|
sceneName: string
|
|
|
|
|
|
platform: string
|
|
|
|
|
|
msgType: string
|
|
|
|
|
|
queueName: string
|
|
|
|
|
|
sourceSystem: string
|
|
|
|
|
|
templateCode: string
|
|
|
|
|
|
channelId?: IdType
|
|
|
|
|
|
sendMethod?: string
|
|
|
|
|
|
enabled?: number
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* adminMessageHubPushConfigApi groups all API calls for this page domain.
|
|
|
|
|
|
* Call guide: pass the typed payload or identifier into the method below, and use the returned Promise in the page script.
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const adminMessageHubPushConfigApi = {
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `listConfigs` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
*/
|
|
|
|
|
|
listConfigs: () => {
|
|
|
|
|
|
return adminApi.get<MessageHubPushConfigVO[]>('/messagehub-push-config/admin/list') as unknown as Promise<MessageHubPushConfigVO[]>
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `createConfig` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param data: MessageHubPushConfigRequest caller-supplied value for `data: MessageHubPushConfigRequest`
|
|
|
|
|
|
*/
|
|
|
|
|
|
createConfig: (data: MessageHubPushConfigRequest) => {
|
|
|
|
|
|
return adminApi.post<IdType>('/messagehub-push-config/admin/create', data)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `updateConfig` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param data: MessageHubPushConfigRequest caller-supplied value for `data: MessageHubPushConfigRequest`
|
|
|
|
|
|
*/
|
|
|
|
|
|
updateConfig: (id: IdType, data: MessageHubPushConfigRequest) => {
|
|
|
|
|
|
return adminApi.put<boolean>(`/messagehub-push-config/admin/${id}`, data)
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `updateStatus` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param enabled: number caller-supplied value for `enabled: number`
|
|
|
|
|
|
*/
|
|
|
|
|
|
updateStatus: (id: IdType, enabled: number) => {
|
|
|
|
|
|
return adminApi.put<boolean>(`/messagehub-push-config/admin/${id}/status`, null, { params: { enabled } })
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
|
|
|
* `testConfig` API call. Use this method from the page script to invoke the backend endpoint tied to this feature.
|
|
|
|
|
|
* Call guide: supply the parameters below, await the returned Promise, and handle loading / error UI in the caller.
|
|
|
|
|
|
* @param id: IdType caller-supplied value for `id: IdType`
|
|
|
|
|
|
* @param phone: string caller-supplied value for `phone: string`
|
|
|
|
|
|
*/
|
|
|
|
|
|
testConfig: (id: IdType, phone: string) => {
|
|
|
|
|
|
return adminApi.post<boolean>(`/messagehub-push-config/admin/${id}/test`, { phone })
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: SystemParameterConfigVO supports admin.ts by holding or executing the system parameter config vo page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export interface SystemParameterConfigVO {
|
|
|
|
|
|
id?: IdType
|
|
|
|
|
|
configGroup: string
|
|
|
|
|
|
configKey: string
|
|
|
|
|
|
configName: string
|
|
|
|
|
|
configValue: string
|
|
|
|
|
|
enabled: number
|
|
|
|
|
|
remark?: string
|
|
|
|
|
|
createTime?: string
|
|
|
|
|
|
updateTime?: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-29 13:30:56 +08:00
|
|
|
|
export interface AdminDefaultPasswordResponse {
|
|
|
|
|
|
password: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-05-23 18:44:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* Purpose: adminSystemParameterConfigApi supports admin.ts by holding or executing the admin system parameter config api page or API role.
|
|
|
|
|
|
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
|
|
|
|
|
*/
|
2026-05-18 09:46:11 +08:00
|
|
|
|
export const adminSystemParameterConfigApi = {
|
|
|
|
|
|
listConfigs: (configGroup?: string) => {
|
|
|
|
|
|
return adminApi.get<SystemParameterConfigVO[]>('/system-parameter-config/admin/list', { params: { configGroup } }) as unknown as Promise<SystemParameterConfigVO[]>
|
|
|
|
|
|
},
|
|
|
|
|
|
saveConfig: (data: SystemParameterConfigVO) => {
|
|
|
|
|
|
return adminApi.post<boolean>('/system-parameter-config/admin/save', data)
|
|
|
|
|
|
},
|
|
|
|
|
|
getTencentMapKey: () => {
|
|
|
|
|
|
return adminApi.get<{ key: string }>('/system-parameter-config/admin/tencent-map') as unknown as Promise<{ key: string }>
|
2026-05-21 18:43:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
getMapConfig: () => {
|
|
|
|
|
|
return adminApi.get<{ provider: 'TENCENT' | 'AMAP'; tencentWebKey?: string; amapWebKey?: string; amapMiniKey?: string }>('/system-parameter-config/admin/map-config') as unknown as Promise<{ provider: 'TENCENT' | 'AMAP'; tencentWebKey?: string; amapWebKey?: string; amapMiniKey?: string }>
|
2026-05-29 13:30:56 +08:00
|
|
|
|
},
|
|
|
|
|
|
getUserDefaultPassword: () => {
|
|
|
|
|
|
return adminApi.get<AdminDefaultPasswordResponse>('/system-parameter-config/admin/user-default-password') as unknown as Promise<AdminDefaultPasswordResponse>
|
2026-05-18 09:46:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-04 10:14:45 +08:00
|
|
|
|
export { adminApi }
|
2026-02-27 11:05:15 +08:00
|
|
|
|
export default adminApi
|