monorepo packages (#344)
This commit is contained in:
22
projects/app/src/service/support/outLink/index.ts
Normal file
22
projects/app/src/service/support/outLink/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { addLog } from '@/service/utils/tools';
|
||||
import { OutLink } from './schema';
|
||||
|
||||
export const updateOutLinkUsage = async ({
|
||||
shareId,
|
||||
total
|
||||
}: {
|
||||
shareId: string;
|
||||
total: number;
|
||||
}) => {
|
||||
try {
|
||||
await OutLink.findOneAndUpdate(
|
||||
{ shareId },
|
||||
{
|
||||
$inc: { total },
|
||||
lastTime: new Date()
|
||||
}
|
||||
);
|
||||
} catch (err) {
|
||||
addLog.error('update shareChat error', err);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user