mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00

* feat(member-group): Team (#2616) * feat: member-group schema define * feat(fe): create group * feat: add group edit modal * feat(fe): add avatar group component * feat: edit group fix: permission select menu style * feat: bio-mode support for select-member component * fix: avatar group key unique * feat: group manage * feat: divide member into group and clbs * feat: finish team permission * chore: adjust * fix: get clbs * perf: groups code * pref: member group for team (#2706) * chore: fe adjust fix: remove the member from groups when removing from team feat: change the groups avatar when updating the team's avatar * chore: DefaultGroupName as a constant string '' * fix: create default group when create team for root * feat: comment * feat: 4811 init * pref: member group for team (#2732) * chore: default group name * feat: get default group when get by tmbid * feat(fe): adjust * member ui * fix: delete group (#2736) * perf: init4811 * pref: member group (#2818) * fix: update clb per then refetch clb list * fix: calculate group permission * feat(fe): group tag * refactor(fe): team and group manage * feat: manage group member * feat: add group transfer owner modal * feat: group manage member * chore: adjust the file structure * pref: member group * chore: adjust fe style * fix: ts error * chore: fe adjust * chore: fe adjust * chore: adjust * chore: adjust the code * perf: i18n and schema name * pref: member-group (#2862) * feat: group list ordered by updateTime * fix: transfer ownership of group when deleting member * fix: i18n fix * feat: can not set member as admin/owner when user is not active * fix: GroupInfoModal hover input do not change color * fix(fe): searchinput do not scroll * perf: team group ui * doc * remove enum --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
64 lines
1.2 KiB
TypeScript
64 lines
1.2 KiB
TypeScript
import { connectionMongo, getMongoModel } from '../../../common/mongo';
|
|
const { Schema } = connectionMongo;
|
|
import { TeamSchema as TeamType } from '@fastgpt/global/support/user/team/type.d';
|
|
import { userCollectionName } from '../../user/schema';
|
|
import { TeamCollectionName } from '@fastgpt/global/support/user/team/constant';
|
|
|
|
const TeamSchema = new Schema({
|
|
name: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
ownerId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: userCollectionName
|
|
},
|
|
avatar: {
|
|
type: String,
|
|
default: '/icon/logo.svg'
|
|
},
|
|
createTime: {
|
|
type: Date,
|
|
default: () => Date.now()
|
|
},
|
|
balance: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
teamDomain: {
|
|
type: String
|
|
},
|
|
limit: {
|
|
lastExportDatasetTime: {
|
|
type: Date
|
|
},
|
|
lastWebsiteSyncTime: {
|
|
type: Date
|
|
}
|
|
},
|
|
lafAccount: {
|
|
token: {
|
|
type: String
|
|
},
|
|
appid: {
|
|
type: String
|
|
},
|
|
pat: {
|
|
type: String
|
|
}
|
|
},
|
|
notificationAccount: {
|
|
type: String,
|
|
required: false
|
|
}
|
|
});
|
|
|
|
try {
|
|
TeamSchema.index({ name: 1 });
|
|
TeamSchema.index({ ownerId: 1 });
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
|
|
export const MongoTeam = getMongoModel<TeamType>(TeamCollectionName, TeamSchema);
|