change varchar to text

This commit is contained in:
2026-01-08 10:18:05 +08:00
parent a55e763525
commit c7cdf40f2f
5 changed files with 24 additions and 15 deletions

View File

@@ -3,6 +3,7 @@
import { executeDictionaryLookup } from "./dictionary";
import { createLookUp, createPhrase, createWord, createPhraseEntry, createWordEntry, selectLastLookUp } from "../services/dictionaryService";
import { DictLookUpRequest, DictWordResponse, isDictErrorResponse, isDictPhraseResponse, isDictWordResponse, type DictLookUpResponse } from "@/lib/shared";
import { text } from "node:stream/consumers";
const saveResult = async (req: DictLookUpRequest, res: DictLookUpResponse) => {
if (isDictErrorResponse(res)) return;
@@ -73,13 +74,15 @@ const saveResult = async (req: DictLookUpRequest, res: DictLookUpResponse) => {
* - 阶段5错误处理
* - 阶段6最终输出封装
*/
export const lookUp = async ({
text,
queryLang,
definitionLang,
userId,
forceRelook = false
}: DictLookUpRequest): Promise<DictLookUpResponse> => {
export const lookUp = async (req: DictLookUpRequest): Promise<DictLookUpResponse> => {
const {
text,
queryLang,
forceRelook = false,
definitionLang,
userId
} = req;
try {
const lastLookUp = await selectLastLookUp({
text,
@@ -136,6 +139,6 @@ export const lookUp = async ({
}
} catch (error) {
console.log(error);
return { error: "LOOK_UP_ERROR" };
return { error: "look up error" };
}
};