修复表单响应性问题 & 更新套餐管理接口字段
This commit is contained in:
@@ -1,8 +1,23 @@
|
||||
'use server'
|
||||
|
||||
import {callByUser} from '@/actions/base'
|
||||
import {callByDevice, callByUser} from '@/actions/base'
|
||||
import {Resource} from '@/lib/models'
|
||||
import {ExtraReq, PageRecord} from '@/lib/api'
|
||||
import {PageRecord} from '@/lib/api'
|
||||
|
||||
export type CreateResourceReq = {
|
||||
type: number
|
||||
short?: {
|
||||
live: number
|
||||
mode: number
|
||||
quota: number
|
||||
expire?: number
|
||||
}
|
||||
long?: {
|
||||
live: number
|
||||
mode: number
|
||||
quota: number
|
||||
expire?: number
|
||||
}
|
||||
}
|
||||
|
||||
export async function listResourceShort(props: {
|
||||
page: number
|
||||
@@ -34,45 +49,14 @@ export async function allResource() {
|
||||
return callByUser<Resource<1 | 2>[]>('/api/resource/all')
|
||||
}
|
||||
|
||||
export async function createResource(props: {
|
||||
type: number
|
||||
short?: {
|
||||
live: number
|
||||
mode: number
|
||||
quota: number
|
||||
expire_at: number
|
||||
daily_limit: number
|
||||
}
|
||||
long?: {
|
||||
live: number
|
||||
mode: number
|
||||
quota: number
|
||||
expire_at: number
|
||||
daily_limit: number
|
||||
}
|
||||
}) {
|
||||
export async function createResource(props: CreateResourceReq) {
|
||||
return await callByUser('/api/resource/create', props)
|
||||
}
|
||||
|
||||
export async function prepareResource(props: {
|
||||
type: number
|
||||
short?: {
|
||||
live: number
|
||||
mode: number
|
||||
quota: number
|
||||
expire_at: number
|
||||
daily_limit: number
|
||||
}
|
||||
long?: {
|
||||
live: number
|
||||
mode: number
|
||||
quota: number
|
||||
expire_at: number
|
||||
daily_limit: number
|
||||
}
|
||||
payment_method: number
|
||||
payment_platform: number
|
||||
}) {
|
||||
} & CreateResourceReq) {
|
||||
return await callByUser<{
|
||||
trade_no: string
|
||||
pay_url: string
|
||||
@@ -101,3 +85,7 @@ export async function payClose(props: {
|
||||
}) {
|
||||
return callByUser('/api/trade/cancel', props)
|
||||
}
|
||||
|
||||
export async function getPrice(props: CreateResourceReq) {
|
||||
return callByDevice<{price: string}>('/api/resource/price', props)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user