This commit is contained in:
2026-01-14 16:57:35 +08:00
parent 804baa64b2
commit ec265be26b
38 changed files with 585 additions and 294 deletions

View File

@@ -1,8 +1,8 @@
import { executeDictionaryLookup } from "@/lib/bigmodel/dictionary";
import { createLookUp, createLookUpWithItemAndEntries, selectLastLookUpResult } from "./dictionary-repository";
import { LookUpServiceInputDto } from "./dictionary-service-dto";
import { repoCreateLookUp, repoCreateLookUpWithItemAndEntries, repoSelectLastLookUpResult } from "./dictionary-repository";
import { ServiceInputLookUp } from "./dictionary-service-dto";
export const lookUpService = async (dto: LookUpServiceInputDto) => {
export const serviceLookUp = async (dto: ServiceInputLookUp) => {
const {
text,
queryLang,
@@ -11,7 +11,7 @@ export const lookUpService = async (dto: LookUpServiceInputDto) => {
forceRelook
} = dto;
const lastLookUpResult = await selectLastLookUpResult({
const lastLookUpResult = await repoSelectLastLookUpResult({
text,
queryLang,
definitionLang,
@@ -25,7 +25,7 @@ export const lookUpService = async (dto: LookUpServiceInputDto) => {
);
// 使用事务确保数据一致性
createLookUpWithItemAndEntries(
repoCreateLookUpWithItemAndEntries(
{
standardForm: response.standardForm,
queryLang,
@@ -44,7 +44,7 @@ export const lookUpService = async (dto: LookUpServiceInputDto) => {
return response;
} else {
createLookUp({
repoCreateLookUp({
userId: userId,
text: text,
queryLang: queryLang,