docs(api/v2): tag project team share fields for the v2 schema

This commit is contained in:
kolaente 2026-06-07 12:19:14 +02:00 committed by kolaente
parent a2be36b5fe
commit 627cd0a6f4
1 changed files with 6 additions and 6 deletions

View File

@ -29,18 +29,18 @@ import (
// TeamProject defines the relation between a team and a project
type TeamProject struct {
// The unique, numeric id of this project <-> team relation.
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id"`
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" readOnly:"true" doc:"The unique, numeric id of this project <-> team relation."`
// The team id.
TeamID int64 `xorm:"bigint not null INDEX" json:"team_id" param:"team"`
TeamID int64 `xorm:"bigint not null INDEX" json:"team_id" param:"team" doc:"The id of the team that gets access to the project."`
// The project id.
ProjectID int64 `xorm:"bigint not null INDEX" json:"-" param:"project"`
// The permission this team has. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
Permission Permission `xorm:"bigint INDEX not null default 0" json:"permission" valid:"length(0|2)" maximum:"2" default:"0"`
Permission Permission `xorm:"bigint INDEX not null default 0" json:"permission" valid:"length(0|2)" maximum:"2" default:"0" doc:"The permission this team has on the project: 0 = Read only, 1 = Read & Write, 2 = Admin."`
// A timestamp when this relation was created. You cannot change this value.
Created time.Time `xorm:"created not null" json:"created"`
Created time.Time `xorm:"created not null" json:"created" readOnly:"true" doc:"A timestamp when this relation was created. You cannot change this value."`
// A timestamp when this relation was last updated. You cannot change this value.
Updated time.Time `xorm:"updated not null" json:"updated"`
Updated time.Time `xorm:"updated not null" json:"updated" readOnly:"true" doc:"A timestamp when this relation was last updated. You cannot change this value."`
web.CRUDable `xorm:"-" json:"-"`
web.Permissions `xorm:"-" json:"-"`
@ -54,7 +54,7 @@ func (*TeamProject) TableName() string {
// TeamWithPermission represents a team, combined with permissions.
type TeamWithPermission struct {
Team `xorm:"extends"`
Permission Permission `json:"permission"`
Permission Permission `json:"permission" readOnly:"true" doc:"The permission this team has on the project: 0 = Read only, 1 = Read & Write, 2 = Admin."`
}
// Create creates a new team <-> project relation