25 lines
652 B
TypeScript
25 lines
652 B
TypeScript
"use server"
|
|
|
|
import type { PageRecord } from "@/lib/api"
|
|
import type { Gateway } from "@/models/gateway"
|
|
import { callByUser } from "./base"
|
|
|
|
export async function getGatewayPage(params: { page: number; size: number }) {
|
|
return callByUser<PageRecord<Gateway>>("/api/admin/proxy/page", params)
|
|
}
|
|
|
|
export async function createGateway(data: {
|
|
mac: string
|
|
ip: string
|
|
host?: string
|
|
type: number
|
|
status: number
|
|
secret: string
|
|
}) {
|
|
return callByUser<Gateway>("/api/admin/proxy/create", data)
|
|
}
|
|
|
|
export async function updateGateway(data: { id: number; status: number }) {
|
|
return callByUser<Gateway>("/api/admin/proxy/update/status", data)
|
|
}
|