add templateId to apps (#5866)

* fix: timeselector ui error

* var update node

* add templateId to apps
This commit is contained in:
Archer
2025-11-05 14:58:02 +08:00
committed by GitHub
parent 45869fa058
commit bf33f7af2e
7 changed files with 44 additions and 33 deletions
+11 -12
View File
@@ -60,18 +60,14 @@ const AppSchema = new Schema(
type: String,
default: ''
},
templateId: String,
updateTime: {
type: Date,
default: () => new Date()
},
// role and auth
teamTags: {
type: [String]
},
// save app(Not publish)
// Workflow data
modules: {
type: Array,
default: []
@@ -83,7 +79,8 @@ const AppSchema = new Schema(
chatConfig: {
type: chatConfigType
},
// plugin config
// Tool config
pluginData: {
type: {
nodeVersion: String,
@@ -108,19 +105,21 @@ const AppSchema = new Schema(
type: Date
},
inited: {
type: Boolean
},
inheritPermission: {
type: Boolean,
default: true
},
// Chat setting
favourite: Boolean,
quick: Boolean,
// abandoned
defaultPermission: Number
/** @deprecated */
defaultPermission: Number,
inited: Boolean,
teamTags: {
type: [String]
}
},
{
minimize: false
+13 -12
View File
@@ -7,6 +7,8 @@ import {
TeamMemberCollectionName
} from '@fastgpt/global/support/user/team/constant';
import { UsageCollectionName, UsageItemCollectionName } from './constants';
import { AppCollectionName } from '../../../core/app/schema';
import { DatasetCollectionName } from '../../../core/dataset/schema';
const UsageSchema = new Schema(
{
@@ -25,31 +27,30 @@ const UsageSchema = new Schema(
enum: Object.values(UsageSourceEnum),
required: true
},
// usage name
appName: {
// usage name
type: String,
default: ''
},
// total points
totalPoints: {
// total points
type: Number,
required: true
},
appId: {
type: Schema.Types.ObjectId,
ref: 'apps',
required: false
},
pluginId: {
type: Schema.Types.ObjectId,
ref: 'plugins',
required: false
},
time: {
type: Date,
default: () => new Date()
},
appId: {
type: Schema.Types.ObjectId,
ref: AppCollectionName
},
datasetId: {
type: Schema.Types.ObjectId,
ref: DatasetCollectionName
},
// @description It will not be used again in the future.
list: {
type: Array