mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00

* feishu app release (#85) * Revert "lafAccount add pat & re request when token invalid (#76)" (#77) This reverts commit 83d85dfe37adcaef4833385ea52ee79fd84720be. * perf: workflow ux * system config * feat: feishu app release * chore: sovle the conflicts files; fix the feishu entry * fix: rename Feishu interface to FeishuType * fix: fix type problem in app.ts * fix: type problem * fix: style problem --------- Co-authored-by: Archer <545436317@qq.com> * perf: publish channel code * change system variable position (#94) * perf: workflow context * perf: variable select * hide publish * perf: simple edit auto refresh * perf: simple edit data refresh * fix: target handle --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com> Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
97 lines
1.7 KiB
TypeScript
97 lines
1.7 KiB
TypeScript
import { connectionMongo, type Model } from '../../common/mongo';
|
|
const { Schema, model, models } = connectionMongo;
|
|
import { OutLinkSchema as SchemaType } from '@fastgpt/global/support/outLink/type';
|
|
import {
|
|
TeamCollectionName,
|
|
TeamMemberCollectionName
|
|
} from '@fastgpt/global/support/user/team/constant';
|
|
import { AppCollectionName } from '../../core/app/schema';
|
|
|
|
const OutLinkSchema = new Schema({
|
|
shareId: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
teamId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: TeamCollectionName,
|
|
required: true
|
|
},
|
|
tmbId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: TeamMemberCollectionName,
|
|
required: true
|
|
},
|
|
appId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: AppCollectionName,
|
|
required: true
|
|
},
|
|
type: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
name: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
usagePoints: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
lastTime: {
|
|
type: Date
|
|
},
|
|
responseDetail: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
limit: {
|
|
maxUsagePoints: {
|
|
type: Number,
|
|
default: -1
|
|
},
|
|
expiredTime: {
|
|
type: Date
|
|
},
|
|
QPM: {
|
|
type: Number,
|
|
default: 1000
|
|
},
|
|
hookUrl: {
|
|
type: String
|
|
}
|
|
},
|
|
app: {
|
|
appId: {
|
|
type: String
|
|
},
|
|
appSecret: {
|
|
type: String
|
|
},
|
|
encryptKey: {
|
|
type: String
|
|
},
|
|
verificationToken: {
|
|
type: String
|
|
}
|
|
},
|
|
immediateResponse: {
|
|
type: String
|
|
},
|
|
defaultResponse: {
|
|
type: String
|
|
}
|
|
});
|
|
|
|
try {
|
|
OutLinkSchema.index({ shareId: -1 });
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
|
|
export const MongoOutLink: Model<SchemaType> =
|
|
models['outlinks'] || model('outlinks', OutLinkSchema);
|
|
|
|
MongoOutLink.syncIndexes();
|