This commit is contained in:
2026-01-24 17:01:39 +08:00
parent d23fc2b2d8
commit ce6bc3e48e
5 changed files with 18 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
*/ */
import type * as abcv from "../abcv.js"; import type * as abcv from "../abcv.js";
import type * as xiong from "../xiong.js";
import type { import type {
ApiFromModules, ApiFromModules,
@@ -18,6 +19,7 @@ import type {
declare const fullApi: ApiFromModules<{ declare const fullApi: ApiFromModules<{
abcv: typeof abcv; abcv: typeof abcv;
xiong: typeof xiong;
}>; }>;
/** /**

View File

@@ -1,7 +1,6 @@
import { query, mutation, action } from "./_generated/server"; import { query, mutation, action } from "./_generated/server";
import { Kevisual } from '@kevisual/ai/browser' import { Kevisual } from '@kevisual/ai/browser'
import { v } from "convex/values"; import { v } from "convex/values";
import { } from "convex/server";
export const get = query({ export const get = query({
args: {}, args: {},
handler: async (ctx) => { handler: async (ctx) => {

View File

@@ -5,5 +5,8 @@ import { v } from "convex/values";
export default defineSchema({ export default defineSchema({
abcv: defineTable({ abcv: defineTable({
title: v.string(), title: v.string(),
}) }),
xiong: defineTable({
name: v.string(),
}),
}); });

8
convex/xiong.ts Normal file
View File

@@ -0,0 +1,8 @@
import { query, mutation, action } from "./_generated/server";
export const get = query({
args: {},
handler: async (ctx) => {
return await ctx.db.query("xiong").collect();
},
});

View File

@@ -21,8 +21,10 @@ const unsubscribe = client.onUpdate(api.abcv.get, {}, async (tasks) => {
// const a = list[i]; // const a = list[i];
// console.log(`Item ${i}:`, a.title); // console.log(`Item ${i}:`, a.title);
// } // }
const list = await client.action(api.abcv.chat, { message: "Hello, 1+1=?" }); // const list = await client.action(api.abcv.chat, { message: "Hello, 1+1=?" });
console.log("Chat response:", list); // console.log("Chat response:", list);
const xiongList = await client.query(api.xiong.get, {});
console.log("Xiong list:", xiongList);
await Bun.sleep(1000); await Bun.sleep(1000);
unsubscribe(); unsubscribe();
await client.close(); await client.close();