Files
FastGPT/packages/service/common/system/config/controller.ts
Archer 108e1b92ef perf: model provider show; perf: get init data buffer (#3459)
* pr code

* perf: model table show

* perf: model provider show

* perf: get init data buffer

* perf: get init data buffer

* perf: icon
2024-12-24 15:12:07 +08:00

27 lines
704 B
TypeScript

import { SystemConfigsTypeEnum } from '@fastgpt/global/common/system/config/constants';
import { MongoSystemConfigs } from './schema';
import { FastGPTConfigFileType } from '@fastgpt/global/common/system/types';
import { FastGPTProUrl } from '../constants';
export const getFastGPTConfigFromDB = async () => {
if (!FastGPTProUrl) {
return {
config: {} as FastGPTConfigFileType,
configId: undefined
};
}
const res = await MongoSystemConfigs.findOne({
type: SystemConfigsTypeEnum.fastgpt
}).sort({
createTime: -1
});
const config = res?.value || {};
return {
configId: res ? String(res._id) : undefined,
config: config as FastGPTConfigFileType
};
};