remove pino

This commit is contained in:
2025-05-08 23:43:56 +08:00
parent aa4d2b5451
commit c3b24ec29c
9 changed files with 1945 additions and 200 deletions

View File

@@ -88,7 +88,7 @@ app
}
const newApp = await app.update({ data: newData, ...rest });
ctx.body = newApp;
if (app.status !== 'running') {
if (app.status !== 'running' || data?.share || rest?.status) {
setExpire(newApp.key, app.user);
}
} else {

View File

@@ -1,7 +1,7 @@
import dayjs from 'dayjs';
import { minioClient } from '../../../modules/minio.ts';
import { bucketName } from '../../../modules/minio.ts';
import { CopyDestinationOptions, CopySourceOptions } from 'minio';
import { BucketItemStat, CopyDestinationOptions, CopySourceOptions } from 'minio';
type MinioListOpt = {
prefix: string;
recursive?: boolean;
@@ -43,7 +43,7 @@ export const getMinioList = async <IS_FILE extends boolean>(opts: MinioListOpt):
});
return res as IS_FILE extends true ? MinioFile[] : MinioDirectory[];
};
export const getFileStat = async (prefix: string, isFile?: boolean): Promise<any> => {
export const getFileStat = async (prefix: string, isFile?: boolean): Promise<BucketItemStat | null> => {
try {
const obj = await minioClient.statObject(bucketName, prefix);
if (isFile && obj.size === 0) {
@@ -174,7 +174,8 @@ export const mvUserAToUserB = async (usernameA: string, usernameB: string, clear
const source = new CopySourceOptions({ Bucket: bucketName, Object: item.name });
const stat = await getFileStat(item.name);
const newName = item.name.slice(oldPrefix.length);
const metadata = stat?.userMetadata;
// @ts-ignore
const metadata = stat?.userMetadata || stat.metaData;
const destination = new CopyDestinationOptions({
Bucket: bucketName,
Object: `${newPrefix}${newName}`,

View File

@@ -9,6 +9,7 @@ export type MarkData = {
mdList?: string[]; // markdown list
type?: string; // 类型 markdown | json | html | image | video | audio | code | link | file
data?: any;
key?: string; // 文件的名称, 唯一
push?: boolean; // 是否推送到elasticsearch
pushTime?: Date; // 推送时间
summary?: string; // 摘要
@@ -47,7 +48,7 @@ export class MarkModel extends Model {
declare description: string; // 描述可以ai生成
declare cover: string; // 封面可以ai生成
declare thumbnail: string; // 缩略图
declare key: string; // 文件路径
declare markType: string; // markdown | json | html | image | video | audio | code | link | file
declare link: string; // 访问链接
declare tags: string[]; // 标签
@@ -231,6 +232,10 @@ export const MarkMInit = async <T = any>(opts: MarkInitOpts<T>, sync?: Opts) =>
type: DataTypes.TEXT,
defaultValue: '',
},
key: {
type: DataTypes.TEXT,
defaultValue: '',
},
markType: {
type: DataTypes.TEXT,
defaultValue: 'md', // markdown | json | html | image | video | audio | code | link | file
@@ -316,4 +321,4 @@ export const syncMarkModel = async (sync?: Opts) => {
await MarkMInit({ sequelize, tableName: 'micro_mark' }, sync);
};
syncMarkModel({ sync: true, alter: true, logging: false });
syncMarkModel({ sync: true, alter: true, logging: false });