Enhance robot member creation with additional fields
- Added new fields to the robot member creation process, including permissions, restrictions, notes, and metadata, to improve the flexibility and detail of robot member configurations. - Updated the AddMember function to include tracking of the user who invited the member and the team ID, enhancing member management and accountability. - These changes improve the overall functionality and usability of the member management system.
This commit is contained in:
parent
846da4042f
commit
40b0c449f1
1 changed files with 4 additions and 0 deletions
|
|
@ -364,6 +364,8 @@ func (u *DefaultUser) CreateRobotMember(ctx context.Context, teamID string, robo
|
|||
robotFields := []string{
|
||||
"role_id", "system_prompt", "manager_id", "robot_config", "agents", "mcp_servers",
|
||||
"language_model", "cost_limit", "autonomous_mode", "robot_status",
|
||||
"permissions", "restrictions", "notes", "metadata",
|
||||
"__yao_created_by", "__yao_updated_by", "__yao_team_id", "__yao_tenant_id",
|
||||
}
|
||||
|
||||
for _, field := range robotFields {
|
||||
|
|
@ -412,6 +414,8 @@ func (u *DefaultUser) AddMember(ctx context.Context, teamID string, userID strin
|
|||
"invited_at": time.Now(),
|
||||
"invitation_token": token,
|
||||
"invitation_expires_at": time.Now().Add(7 * 24 * time.Hour), // 7 days expiry
|
||||
"__yao_created_by": invitedBy,
|
||||
"__yao_team_id": teamID,
|
||||
}
|
||||
|
||||
return u.CreateMember(ctx, memberData)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue