refactor: split interfaces by module

This commit is contained in:
2026-04-22 16:52:09 +08:00
parent e7373d6e98
commit ff487064a2
5 changed files with 68 additions and 62 deletions
+11
View File
@@ -0,0 +1,11 @@
export interface LoginRequest {
principle: string
credential: string
}
export interface User {
id: number
username: string
email: string
}
+17
View File
@@ -0,0 +1,17 @@
export type Direction = "ASC" | "DESC"
export interface Page<T> {
items: T[]
page: number
size: number
totalElements: number
totalPages: number
}
export interface PageQueryParams {
page?: number
size?: number
sortBy?: string
direction?: Direction
}
+24
View File
@@ -0,0 +1,24 @@
export type FirearmType =
| "RIFLE"
| "SUB_MACHINE_GUN"
| "SHOTGUN"
| "LIGHT_MACHINE_GUN"
| "DESIGNATED_MARKSMAN_RIFLE"
| "SNIPER_RIFLE"
| "PISTOL"
| "SPECIAL"
export interface Firearm {
id: number
name: string
type: FirearmType
level: string
calibre: string
fireRate: number
armourDamage: number
bodyDamage: number
review: string | null
}
export interface AddFirearmRequest extends Omit<Firearm, "id"> {}
+4 -62
View File
@@ -1,62 +1,4 @@
export type Direction = "ASC" | "DESC" export * from "./common"
export * from "./firearm"
export type FirearmType = export * from "./modification"
| "RIFLE" export * from "./auth"
| "SUB_MACHINE_GUN"
| "SHOTGUN"
| "LIGHT_MACHINE_GUN"
| "DESIGNATED_MARKSMAN_RIFLE"
| "SNIPER_RIFLE"
| "PISTOL"
| "SPECIAL"
export interface Page<T> {
items: T[]
page: number
size: number
totalElements: number
totalPages: number
}
export interface Firearm {
id: number
name: string
type: FirearmType
level: string
calibre: string
fireRate: number
armourDamage: number
bodyDamage: number
review: string | null
}
export interface AddFirearmRequest extends Omit<Firearm, "id"> {}
export interface Modification {
id: number
firearmId: number
name: string
code: string
tags: string[]
note: string
author: string
videoUrl: string
}
export interface PageQueryParams {
page?: number
size?: number
sortBy?: string
direction?: Direction
}
export interface LoginRequest {
principle: string
credential: string
}
export interface User {
id: number
username: string
email: string
}
+12
View File
@@ -0,0 +1,12 @@
export interface Modification {
id: number
firearmId: number
name: string
code: string
tags: string[]
note: string
author: string
videoUrl: string
}
export interface ModificationRequest extends Omit<Modification, "id"> {}