Files
web/src/actions/channel.ts

37 lines
774 B
TypeScript
Raw Normal View History

'use server'
import {callByUser, callPublic} from '@/actions/base'
2025-04-28 17:41:54 +08:00
import {Channel} from '@/lib/models'
import {PageRecord} from '@/lib/api'
import {Batch} from '@/lib/models/batch'
2025-04-28 17:41:54 +08:00
export async function listChannels(props: {
page: number
size: number
auth_type?: number
prov?: string
city?: string
isp?: string
2025-04-28 17:41:54 +08:00
expiration?: Date
}) {
2025-04-28 17:41:54 +08:00
return callByUser<PageRecord<Channel>>('/api/channel/list', props)
}
type CreateChannelsResp = {
host: string
port: string
username?: string
password?: string
}
2025-04-28 17:41:54 +08:00
export async function createChannels(params: {
resource_id: number
protocol: number
auth_type: number
count: number
prov?: string
city?: string
isp?: number
2025-04-28 17:41:54 +08:00
}) {
return callByUser<CreateChannelsResp[]>('/api/channel/create', params)
}