feat: establish NekoNest Cloud control and relay
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { getCloudViewer } from "@/app/cloud-auth";
|
||||
import { DomainError } from "@/db/repository";
|
||||
import { apiError, readJsonMutation } from "../../respond";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
try {
|
||||
const viewer = await getCloudViewer();
|
||||
if (!viewer) {
|
||||
return Response.json(
|
||||
{ error: "authentication_required", message: "请先登录" },
|
||||
{ status: 401 },
|
||||
);
|
||||
}
|
||||
await readJsonMutation<{
|
||||
period?: "month" | "year";
|
||||
quantity?: number;
|
||||
idempotencyKey?: string;
|
||||
}>(request);
|
||||
throw new DomainError(
|
||||
"paid_features_deferred",
|
||||
"免费公测阶段不提供报价或订单;未来收费方案确定后会另行通知",
|
||||
409,
|
||||
);
|
||||
} catch (error) {
|
||||
return apiError(error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user