devops tenant api

Signed-off-by: runzexia <runzexia@yunify.com>
This commit is contained in:
runzexia
2019-04-23 20:47:47 +08:00
committed by zryfish
parent 78f2dab18c
commit 5a6f51d775
143 changed files with 19533 additions and 341 deletions

View File

@@ -0,0 +1,28 @@
package devops
const (
DevOpsProjectMembershipTableName = "project_membership"
DevOpsProjectMembershipUsernameColumn = "project_membership.username"
DevOpsProjectMembershipProjectIdColumn = "project_membership.project_id"
DevOpsProjectMembershipRoleColumn = "project_membership.role"
)
type DevOpsProjectMembership struct {
Username string `json:"username"`
ProjectId string `json:"project_id" db:"project_id"`
Role string `json:"role"`
Status string `json:"status"`
GrantBy string `json:"grand_by,omitempty"`
}
var DevOpsProjectMembershipColumns = GetColumnsFromStruct(&DevOpsProjectMembership{})
func NewDevOpsProjectMemberShip(username, projectId, role, grantBy string) *DevOpsProjectMembership {
return &DevOpsProjectMembership{
Username: username,
ProjectId: projectId,
Role: role,
Status: StatusActive,
GrantBy: grantBy,
}
}