fix(types): 修复合并后的 Listing 类型引用与接口类型兼容
This commit is contained in:
@@ -34,31 +34,8 @@ export interface Listing {
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
// 公开商品卡片的最小字段,对应后端 PublicListingListItemDTO。
|
||||
export interface PublicListingItem {
|
||||
id: number
|
||||
listing_no: string
|
||||
title: string
|
||||
game_name: string
|
||||
server_region: string
|
||||
login_platform: string
|
||||
rank_level: string
|
||||
haf_coin_amount: number
|
||||
asset_summary?: Record<string, unknown>
|
||||
screenshot_urls?: string[]
|
||||
cover_url: string
|
||||
price_cent: number
|
||||
deposit_amount_cent: number
|
||||
is_accelerated_sale?: boolean
|
||||
published_at?: string
|
||||
created_at: string
|
||||
}
|
||||
|
||||
// 公开商品详情,对应后端 PublicListingDetailDTO。
|
||||
export interface PublicListingDetail extends PublicListingItem {
|
||||
description: string
|
||||
screenshot_urls: string[]
|
||||
}
|
||||
export type PublicListingItem = Listing
|
||||
export type PublicListingDetail = Listing
|
||||
|
||||
export interface ListingPayload {
|
||||
title: string
|
||||
@@ -112,7 +89,7 @@ export interface PublicListingQuery {
|
||||
}
|
||||
|
||||
export interface PublicListingPage {
|
||||
items: PublicListingItem[]
|
||||
items: Listing[]
|
||||
total: number
|
||||
page: number
|
||||
page_size: number
|
||||
@@ -158,7 +135,7 @@ function normalizePublicListingPage(
|
||||
}
|
||||
|
||||
export async function fetchListing(id: string | number) {
|
||||
const { data } = await apiClient.get<ApiResponse<PublicListingDetail>>(`/listings/${id}`)
|
||||
const { data } = await apiClient.get<ApiResponse<Listing>>(`/listings/${id}`)
|
||||
return data.data
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user