mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 17:47:46 +01:00
change comment and add sql fields
This commit is contained in:
parent
0e52a68aa4
commit
89fce7ed22
@ -192,7 +192,7 @@ func SearchProjects(userID int) ([]models.Project, error) {
|
|||||||
return projects, nil
|
return projects, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserRelevantProjects returns the projects based on publicity and user, disregarding the names etc.
|
// GetUserRelevantProjects returns the projects of the user which are not deleted and name like projectName
|
||||||
func GetUserRelevantProjects(userID int, projectName string) ([]models.Project, error) {
|
func GetUserRelevantProjects(userID int, projectName string) ([]models.Project, error) {
|
||||||
o := orm.NewOrm()
|
o := orm.NewOrm()
|
||||||
|
|
||||||
@ -219,11 +219,11 @@ func GetUserRelevantProjects(userID int, projectName string) ([]models.Project,
|
|||||||
return r, nil
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetPublicProjects return all public projects whose name like projectName
|
//GetPublicProjects returns all public projects whose name like projectName
|
||||||
func GetPublicProjects(projectName string) ([]models.Project, error) {
|
func GetPublicProjects(projectName string) ([]models.Project, error) {
|
||||||
o := orm.NewOrm()
|
o := orm.NewOrm()
|
||||||
var publicProjects []models.Project
|
var publicProjects []models.Project
|
||||||
sql := `select project_id, name, public
|
sql := `select project_id, owner_id, creation_time, update_time, name, public
|
||||||
from project
|
from project
|
||||||
where deleted = 0 and public=1`
|
where deleted = 0 and public=1`
|
||||||
if len(projectName) > 0 {
|
if len(projectName) > 0 {
|
||||||
@ -237,10 +237,10 @@ func GetPublicProjects(projectName string) ([]models.Project, error) {
|
|||||||
return publicProjects, nil
|
return publicProjects, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAllProjects returns all projects which are not deleted
|
// GetAllProjects returns all projects which are not deleted and name like projectName
|
||||||
func GetAllProjects(projectName string) ([]models.Project, error) {
|
func GetAllProjects(projectName string) ([]models.Project, error) {
|
||||||
o := orm.NewOrm()
|
o := orm.NewOrm()
|
||||||
sql := `select project_id, name, public
|
sql := `select project_id, owner_id, creation_time, update_time, name, public
|
||||||
from project
|
from project
|
||||||
where deleted = 0`
|
where deleted = 0`
|
||||||
if len(projectName) > 0 {
|
if len(projectName) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user