@@ -0,0 +1,12 @@
|
||||
import type { IConfig } from '@/stores'
|
||||
import { defineRequest } from '../common'
|
||||
import type { IResult } from './type'
|
||||
export default defineRequest((request) => {
|
||||
return {
|
||||
async calc(config: IConfig) {
|
||||
const res = await request.post<IResult>('/calc', config)
|
||||
return res.data
|
||||
},
|
||||
}
|
||||
})
|
||||
// Compare this snippet from frontend/src/api/common/index.ts:
|
||||
@@ -0,0 +1,56 @@
|
||||
export interface IResult {
|
||||
uuid: string
|
||||
skills: IResultSkill[]
|
||||
info: IResultUserInfo[]
|
||||
suits: {
|
||||
suit?: IResultSuit
|
||||
oath?: IResultSuit
|
||||
correction?: number
|
||||
}
|
||||
buffer: boolean
|
||||
}
|
||||
|
||||
export interface IResultSkill {
|
||||
name: string
|
||||
icon: string
|
||||
lv: number
|
||||
data: number
|
||||
ratio: number
|
||||
cd: number
|
||||
damage: number
|
||||
mode: string
|
||||
buff: number[]
|
||||
learnLv: number
|
||||
type: string
|
||||
}
|
||||
|
||||
export interface IResultUserInfo {
|
||||
id: number
|
||||
name: string
|
||||
value: string | number
|
||||
}
|
||||
|
||||
export interface IResultSuit {
|
||||
id: string
|
||||
count: number
|
||||
imageUrl: string
|
||||
level: number
|
||||
name: string
|
||||
point: number
|
||||
rarity: string
|
||||
value: string
|
||||
suitId: string
|
||||
skills: {
|
||||
id: string
|
||||
skillId: string
|
||||
name: string
|
||||
imageUrl: string
|
||||
enable: boolean
|
||||
}[]
|
||||
}
|
||||
|
||||
export interface IResultSkillCount {
|
||||
count: number
|
||||
mode: string
|
||||
name: string
|
||||
}
|
||||
Reference in New Issue
Block a user