controller

package
v0.0.0-...-d7fecdb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivateToken = "PRIVATE-TOKEN"

	Token = "token"

	PayLoad = "PAYLOAD"
)
View Source
const (
	OPERATE_LOG         = "operate_log"
	OPERATE_TYPE_USER   = "user"
	OPERATE_TYPE_SYSTEM = "system"
)

Variables

This section is empty.

Functions

func AddRouterForActivityController

func AddRouterForActivityController(
	rg *gin.RouterGroup,
	repo repository.Activity,
	user userrepo.User,
	proj repository.Project,
	model repository.Model,
	dataset repository.Dataset,
)

func AddRouterForBigModelController

func AddRouterForBigModelController(
	rg *gin.RouterGroup,
	s app.BigModelService,
	us userapp.RegService,
)

func AddRouterForChallengeController

func AddRouterForChallengeController(
	rg *gin.RouterGroup,
	crepo repository.Competition,
	qrepo repository.AIQuestion,
	h challenge.Challenge,
	user userrepo.User,
)

func AddRouterForCloudController

func AddRouterForCloudController(
	rg *gin.RouterGroup,
	s app.CloudService,
)

func AddRouterForCompetitionController

func AddRouterForCompetitionController(
	rg *gin.RouterGroup,
	s app.CompetitionService,
	us userapp.RegService,
	project repository.Project,
)

func AddRouterForCourseController

func AddRouterForCourseController(
	rg *gin.RouterGroup,

	s app.CourseService,
	us userapp.RegService,
	project repository.Project,
	user userrepo.User,
)

func AddRouterForDatasetController

func AddRouterForDatasetController(
	rg *gin.RouterGroup,
	user userrepo.User,
	repo repository.Dataset,
	model repository.Model,
	proj repository.Project,
	activity repository.Activity,
	tags repository.Tags,
	like repository.Like,
	sender message.ResourceProducer,
	newPlatformRepository func(token, namespace string) platform.Repository,
)

func AddRouterForFinetuneController

func AddRouterForFinetuneController(
	rg *gin.RouterGroup,
	fs finetune.Finetune,
	repo repository.Finetune,
	sender message.Sender,
)

func AddRouterForHomeController

func AddRouterForHomeController(
	rg *gin.RouterGroup,

	course courseapp.CourseService,
	comp compapp.CompetitionService,
	project app.ProjectService,
	model app.ModelService,
	dataset app.DatasetService,

)

func AddRouterForLikeController

func AddRouterForLikeController(
	rg *gin.RouterGroup,
	repo repository.Like,
	user userrepo.User,
	proj repository.Project,
	model repository.Model,
	dataset repository.Dataset,
	activity repository.Activity,
	sender message.LikeMessageProducer,
)

func AddRouterForLoginController

func AddRouterForLoginController(
	rg *gin.RouterGroup,
	us userapp.UserService,
	auth authing.User,
	login app.LoginService,
)

func AddRouterForModelController

func AddRouterForModelController(
	rg *gin.RouterGroup,
	user userrepo.User,
	repo repository.Model,
	proj repository.Project,
	dataset repository.Dataset,
	activity repository.Activity,
	tags repository.Tags,
	like repository.Like,
	sender message.ResourceProducer,
	newPlatformRepository func(token, namespace string) platform.Repository,
)

func AddRouterForProjectController

func AddRouterForProjectController(
	rg *gin.RouterGroup,
	user userrepo.User,
	repo repository.Project,
	model repository.Model,
	dataset repository.Dataset,
	activity repository.Activity,
	tags repository.Tags,
	like repository.Like,
	sender message.ResourceProducer,
	newPlatformRepository func(token, namespace string) platform.Repository,
)

func AddRouterForRepoFileController

func AddRouterForRepoFileController(
	rg *gin.RouterGroup,
	p platform.RepoFile,
	model repository.Model,
	project repository.Project,
	dataset repository.Dataset,
	sender message.RepoMessageProducer,
	us uapp.UserService,
)

func AddRouterForSearchController

func AddRouterForSearchController(
	rg *gin.RouterGroup,
	user userrepo.User,
	proj repository.Project,
	model repository.Model,
	dataset repository.Dataset,
)

func AddRouterForTagsController

func AddRouterForTagsController(
	rg *gin.RouterGroup,
	repo repository.Tags,
)

func AddRouterForTrainingController

func AddRouterForTrainingController(
	rg *gin.RouterGroup,
	ts training.Training,
	repo repository.Training,
	model repository.Model,
	project repository.Project,
	dataset repository.Dataset,
	sender message.MessageProducer,
)

func AddRouterForUserController

func AddRouterForUserController(
	rg *gin.RouterGroup,
	us userapp.UserService,
	repo userrepo.User,
	auth authing.User,
	login app.LoginService,
	register userapp.RegService,
)

func AddRouterForUserPointsController

func AddRouterForUserPointsController(
	rg *gin.RouterGroup,
	s app.UserPointsAppService,
	ts app.TaskAppService,
)

func ClearSenstiveInfoMiddleware

func ClearSenstiveInfoMiddleware() gin.HandlerFunc

func EncryptHelperToken

func EncryptHelperToken() utils.SymmetricEncryption

func GetOperateLog

func GetOperateLog(ctx *gin.Context) string

func Init

func Init(cfg *APIConfig, l *logrus.Entry) error

Types

type APIConfig

type APIConfig struct {
	Tags                           Tags   `json:"tags"                        required:"true"`
	TokenKey                       string `json:"token_key"                   required:"true"`
	TokenExpiry                    int64  `json:"token_expiry"                required:"true"`
	EncryptionKey                  string `json:"encryption_key"              required:"true"`
	EncryptionKeyForCSRF           string `json:"encryption_key_csrf"         required:"true"`
	EncryptionKeyForGitlabToken    string `json:"encryption_key_gitlab_token" required:"true"`
	DefaultPassword                string `json:"default_password"            required:"true"`
	MaxTrainingRecordNum           int    `json:"max_training_record_num"     required:"true"`
	InferenceDir                   string `json:"inference_dir"`
	InferenceBootFile              string `json:"inference_boot_file"`
	InferenceTimeout               int    `json:"inference_timeout"`
	PodTimeout                     int    `json:"pod_timeout"`
	MaxPictureSizeToDescribe       int64  `json:"-"`
	MaxPictureSizeToVQA            int64  `json:"-"`
	MaxCompetitionSubmmitFileSzie  int64  `json:"max_competition_submmit_file_size"`
	MinSurvivalTimeOfInference     int    `json:"min_survival_time_of_inference"`
	MaxTagsNumToSearchResource     int    `json:"max_tags_num_to_search_resource"`
	MaxTagKindsNumToSearchResource int    `json:"max_tag_kinds_num_to_search_resource"`
}

func (*APIConfig) SetDefault

func (cfg *APIConfig) SetDefault()

func (*APIConfig) Validate

func (cfg *APIConfig) Validate() (err error)

type ActivityController

type ActivityController struct {
	// contains filtered or unexported fields
}

func (*ActivityController) List

func (ctl *ActivityController) List(ctx *gin.Context)

@Title List @Description list activitys @Tags Activity @Param account path string true "the account the activities belong to" @Accept json @Success 200 {object} app.ActivityDTO @Failure 500 system_error system error @Router /v1/user/activity/{account} [get]

type AddCourseRelatedProjectRequest

type AddCourseRelatedProjectRequest struct {
	Owner string `json:"owner"`
	Name  string `json:"project_name"`
}

func (*AddCourseRelatedProjectRequest) ToInfo

func (req *AddCourseRelatedProjectRequest) ToInfo() (
	owner types.Account, name types.ResourceName, err error,
)

type BigModelController

type BigModelController struct {
	// contains filtered or unexported fields
}

func (*BigModelController) AIDetector

func (ctl *BigModelController) AIDetector(ctx *gin.Context)

@Title AI Detector @Description detecte if text generate by ai @Tags BigModel @Param body body aiDetectorReq true "body of ai detector" @Accept json @Success 202 {object} aiDetectorResp @Failure 500 system_error system error @Router /v1/bigmodel/ai_detector [post]

func (*BigModelController) AddDigg

func (ctl *BigModelController) AddDigg(ctx *gin.Context)

@Title AddDigg @Description add digg to wukong picture @Tags BigModel @Accept json @Success 202 {object} wukongDiggResp @Failure 500 system_error system error @Router /v1/bigmodel/wukong/digg [post]

func (*BigModelController) AddLike

func (ctl *BigModelController) AddLike(ctx *gin.Context)

@Title AddLike @Description add like to wukong picture @Tags BigModel @Accept json @Success 202 {object} wukongAddLikeResp @Failure 500 system_error system error @Router /v1/bigmodel/wukong/like [post]

func (*BigModelController) AddPublic

func (ctl *BigModelController) AddPublic(ctx *gin.Context)

@Title AddPublic @Description add public to wukong picture @Tags BigModel @Accept json @Success 202 {object} wukongAddPublicResp @Failure 500 system_error system error @Router /v1/bigmodel/wukong/public [post]

func (*BigModelController) ApplyApi

func (ctl *BigModelController) ApplyApi(ctx *gin.Context)

@Title ApplyApi @Description generates pictures by WuKong-hf @Tags BigModel @Param body body applyApiReq true "body of wukong" @Accept json @Success 201 {object} newApiTokenResp @Failure 500 system_error system error @Router /v1/bigmodel/api/apply/{model} [post]

func (*BigModelController) BaiChuan

func (ctl *BigModelController) BaiChuan(ctx *gin.Context)

@Title BaiChuan @Description conversational AI @Tags BigModel @Param body body baichuanReq true "body of baichuan" @Accept json @Success 202 {object} app.BaiChuanDTO @Failure 500 system_error system error @Router /v1/bigmodel/baichuan2_7b_chat [post]

func (*BigModelController) CancelDigg

func (ctl *BigModelController) CancelDigg(ctx *gin.Context)

@Title CancelDigg @Description delete digg to wukong picture @Tags BigModel @Param body body wukongCancelDiggPublicRequest true "body of wukong" @Accept json @Success 202 {object} wukongDiggResp @Failure 500 system_error system error @Router /v1/bigmodel/wukong/digg [delete]

func (*BigModelController) CancelLike

func (ctl *BigModelController) CancelLike(ctx *gin.Context)

@Title CancelLike @Description cancel like on wukong picture @Tags BigModel @Param id path string true "picture id" @Accept json @Success 204 @Failure 500 system_error system error @Router /v1/bigmodel/wukong/like/{id} [delete]

func (*BigModelController) CancelPublic

func (ctl *BigModelController) CancelPublic(ctx *gin.Context)

@Title CancelPublic @Description cancel public on wukong picture @Tags BigModel @Param id path string true "picture id" @Accept json @Success 204 @Failure 500 system_error system error @Router /v1/bigmodel/wukong/public/{id} [delete]

func (*BigModelController) GLM2

func (ctl *BigModelController) GLM2(ctx *gin.Context)

@Title GLM @Description conversational AI @Tags BigModel @Param body body glm2Request true "body of glm2" @Accept json @Success 202 {object} string @Failure 500 system_error system error @Router /v1/bigmodel/glm2_6b [post]

func (*BigModelController) GenDownloadURL

func (ctl *BigModelController) GenDownloadURL(ctx *gin.Context)

@Title GenDownloadURL @Description generate download url of wukong picture @Tags BigModel @Param body body wukongPictureLink true "body of wukong" @Accept json @Success 202 {object} wukongPictureLink @Failure 500 system_error system error @Router /v1/bigmodel/wukong/link [put]

func (*BigModelController) GenWuKongSamples

func (ctl *BigModelController) GenWuKongSamples(ctx *gin.Context)

@Title GenWuKongSamples @Description gen wukong samples @Tags BigModel @Param batch path int true "batch num" @Accept json @Success 201 @Failure 500 system_error system error @Router /v1/bigmodel/wukong/samples/{batch} [get]

func (*BigModelController) GetApiInfo

func (ctl *BigModelController) GetApiInfo(ctx *gin.Context)

@Title GetApiInfo @Description get api info @Tags BigModel @Accept json @Success 200 {object} app.ApiInfoDTO @Failure 500 system_error system error @Router /v1/bigmodel/apiinfo/get/{model} [get]

func (*BigModelController) GetPublicsGlobal

func (ctl *BigModelController) GetPublicsGlobal(ctx *gin.Context)

@Title GetPublicGlobal @Description list all wukong pictures publiced @Tags BigModel @Accept json @Success 200 {object} app.WuKongPublicDTO @Failure 500 system_error system error @Router /v1/bigmodel/wukong/publics [get]

func (*BigModelController) GetUserApplyRecord

func (ctl *BigModelController) GetUserApplyRecord(ctx *gin.Context)

@Title GetUserApplyRecord @Description get user apply record @Tags BigModel @Accept json @Success 200 {object} app.ApiApplyRecordDTO @Failure 500 system_error system error @Router /v1/bigmodel/api/get/ [get]

func (*BigModelController) IsApplied

func (ctl *BigModelController) IsApplied(ctx *gin.Context)

@Title IsApplied @Description is user applied for api @Tags BigModel @Accept json @Success 200 {object} isApplyResp @Failure 500 system_error system error @Router /v1/bigmodel/api/apply/{model} [get]

func (*BigModelController) LLAMA2

func (ctl *BigModelController) LLAMA2(ctx *gin.Context)

@Title LLAMA2 @Description conversational AI @Tags BigModel @Param body body llama2Request true "body of llama2" @Accept json @Success 202 {object} string @Failure 500 system_error system error @Router /v1/bigmodel/llama2_7b [post]

func (*BigModelController) ListLike

func (ctl *BigModelController) ListLike(ctx *gin.Context)

@Title ListLike @Description list wukong pictures user liked @Tags BigModel @Accept json @Success 200 {object} app.WuKongLikeDTO @Failure 500 system_error system error @Router /v1/bigmodel/wukong [get]

func (*BigModelController) ListLuoJiaRecord

func (ctl *BigModelController) ListLuoJiaRecord(ctx *gin.Context)

@Title ListLuoJiaRecord @Description list luo-jia big model records @Tags BigModel @Accept json @Success 200 {object} app.LuoJiaRecordDTO @Failure 500 system_error system error @Router /v1/bigmodel/luojia [get]

func (*BigModelController) ListPublic

func (ctl *BigModelController) ListPublic(ctx *gin.Context)

@Title ListPublic @Description list wukong pictures user publiced @Tags BigModel @Accept json @Success 200 {object} app.WuKongPublicDTO @Failure 500 system_error system error @Router /v1/bigmodel/wukong/public [get]

func (*BigModelController) LuoJia

func (ctl *BigModelController) LuoJia(ctx *gin.Context)

@Title LuoJia @Description luo-jia big model @Tags BigModel @Accept json @Success 201 {object} luojiaResp @Failure 500 system_error system error @Router /v1/bigmodel/luojia [post]

func (*BigModelController) LuoJiaUploadPicture

func (ctl *BigModelController) LuoJiaUploadPicture(ctx *gin.Context)

@Title LuoJiaUploadPicture @Description upload a picture for luo-jia @Tags BigModel @Param picture formData file true "picture" @Accept json @Success 201 {object} pictureUploadResp @Failure 500 system_error system error @Router /v1/bigmodel/luojia_upload_picture [post]

func (*BigModelController) RefreshApiToken

func (ctl *BigModelController) RefreshApiToken(ctx *gin.Context)

@Title RefreshApiToken @Description refresh api token @Tags BigModel @Accept json @Success 200 {object} newApiTokenResp @Failure 500 system_error system error @Router /v1/bigmodel/api/refresh/{model} [get]

func (*BigModelController) SkyWork

func (ctl *BigModelController) SkyWork(ctx *gin.Context)

@Title SkyWork @Description conversational AI @Tags BigModel @Param body body skyWorkRequest true "body of skywork" @Accept json @Success 202 {object} string @Failure 500 system_error system error @Router /v1/bigmodel/skywork_13b [post]

func (*BigModelController) WuKong

func (ctl *BigModelController) WuKong(ctx *gin.Context)

@Title WuKong @Description generates pictures by WuKong @Tags BigModel @Param body body wukongRequest true "body of wukong" @Accept json @Success 201 {object} wukongPicturesGenerateResp @Failure 500 system_error system error @Router /v1/bigmodel/wukong [post]

func (*BigModelController) WuKongAsync

func (ctl *BigModelController) WuKongAsync(ctx *gin.Context)

@Title WuKong @Description send async wukong request task @Tags BigModel @Param body body wukongRequest true "body of wukong" @Accept json @Success 201 {object} wukongPicturesGenerateResp @Failure 500 system_error system error @Router /v1/bigmodel/wukong_async [post]

func (*BigModelController) WuKongLastFinisedTask

func (ctl *BigModelController) WuKongLastFinisedTask(ctx *gin.Context)

@Title WuKong @Description get last finished task @Tags BigModel @Accept json @Success 200 {object} app.WuKongRankDTO @Failure 500 system_error system error @Router /v1/bigmodel/wukong/task [get]

func (*BigModelController) WuKongRank

func (ctl *BigModelController) WuKongRank(ctx *gin.Context)

@Title WuKong @Description get wukong rank @Tags BigModel @Accept json @Success 200 {object} app.WuKongRankDTO @Failure 500 system_error system error @Router /v1/bigmodel/wukong/rank [get]

func (*BigModelController) WukongAPI

func (ctl *BigModelController) WukongAPI(ctx *gin.Context)

@Title WuKongAPI @Description generates pictures by WuKong @Tags BigModel @Param body body wukongRequest true "body of wukong" @Accept json @Success 201 {object} wukongPicturesGenerateResp @Failure 500 system_error system error @Router /v1/bigmodel/api/{model} [post]

type ChallengeController

type ChallengeController struct {
	// contains filtered or unexported fields
}

func (*ChallengeController) Apply

func (ctl *ChallengeController) Apply(ctx *gin.Context)

@Summary Apply @Description apply the challenge @Tags Challenge @Param body body competitorApplyRequest true "body of applying" @Accept json @Success 201 @Failure 500 system_error system error @Router /v1/challenge/competitor [post]

func (*ChallengeController) Get

func (ctl *ChallengeController) Get(ctx *gin.Context)

@Summary Get @Description get detail of challenge @Tags Challenge @Accept json @Success 200 {object} app.ChallengeCompetitorInfoDTO @Failure 500 system_error system error @Router /v1/challenge [get]

func (*ChallengeController) GetAIQuestions

func (ctl *ChallengeController) GetAIQuestions(ctx *gin.Context)

@Summary GetAIQuestions @Description get ai questions @Tags Challenge @Accept json @Success 200 {object} app.AIQuestionDTO @Failure 500 system_error system error @Router /v1/challenge/aiquestions [get]

func (*ChallengeController) GetRankingList

func (ctl *ChallengeController) GetRankingList(ctx *gin.Context)

@Summary GetRankingList @Description get ranking list of challenge @Tags Challenge @Accept json @Success 200 {object} app.ChallengeRankingDTO @Failure 500 system_error system error @Router /v1/challenge/ranking [get]

func (*ChallengeController) Submit

func (ctl *ChallengeController) Submit(ctx *gin.Context)

@Summary Submit @Description submit answer of ai question @Tags Challenge @Param body body aiQuestionAnswerSubmitRequest true "body of ai question answer" @Accept json @Success 201 {object} aiQuestionAnswerSubmitResp @Failure 500 system_error system error @Router /v1/challenge/aiquestions [post]

type CloudController

type CloudController struct {
	// contains filtered or unexported fields
}

func (*CloudController) List

func (ctl *CloudController) List(ctx *gin.Context)

@Summary List @Description list cloud config @Tags Cloud @Accept json @Success 200 {object} []app.CloudDTO @Failure 500 system_error system error @Router /v1/cloud [get]

type CompetitionController

type CompetitionController struct {
	// contains filtered or unexported fields
}

func (*CompetitionController) AddRelatedProject

func (ctl *CompetitionController) AddRelatedProject(ctx *gin.Context)

@Summary AddRelatedProject @Description add related project @Tags Competition @Param id path string true "competition id" @Param body body cc.AddRelatedProjectRequest true "project info" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/competition/{id}/realted_project [put]

func (*CompetitionController) Apply

func (ctl *CompetitionController) Apply(ctx *gin.Context)

@Summary Apply @Description apply the competition @Tags Competition @Param id path string true "competition id" @Param body body cc.CompetitorApplyRequest true "body of applying" @Accept json @Success 201 @Failure 500 system_error system error @Router /v1/competition/{id}/competitor [post]

func (*CompetitionController) ChangeName

func (ctl *CompetitionController) ChangeName(ctx *gin.Context)

@Summary ChangeName @Description change name of a team @Tags Competition @Param id path string true "competition id" @Param body body cc.ChangeTeamNameRequest true "body of team name" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/competition/{id}/team/action/change_name [put]

func (*CompetitionController) CreateTeam

func (ctl *CompetitionController) CreateTeam(ctx *gin.Context)

@Summary CreateTeam @Description create team of competition @Tags Competition @Param id path string true "competition id" @Param body body cc.CreateTeamRequest true "body of creating team" @Accept json @Success 201 @Failure 500 system_error system error @Router /v1/competition/{id}/team [post]

func (*CompetitionController) DeleteMember

func (ctl *CompetitionController) DeleteMember(ctx *gin.Context)

@Summary DeleteMember @Description delete member of a team @Tags Competition @Param id path string true "competition id" @Param body body cc.DeleteMemberRequest true "body of delete member" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/competition/{id}/team/action/delete_member [put]

func (*CompetitionController) Dissolve

func (ctl *CompetitionController) Dissolve(ctx *gin.Context)

@Summary Dissolve @Description dissolve a team @Tags Competition @Param id path string true "competition id" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/competition/{id}/team/action/dissolve [put]

func (*CompetitionController) Get

func (ctl *CompetitionController) Get(ctx *gin.Context)

@Summary Get @Description get detail of competition @Tags Competition @Param id path string true "competition id" @Accept json @Success 200 {object} app.UserCompetitionDTO @Failure 500 system_error system error @Router /v1/competition/{id} [get]

func (*CompetitionController) GetMyTeam

func (ctl *CompetitionController) GetMyTeam(ctx *gin.Context)

@Summary GetMyTeam @Description get team of competition @Tags Competition @Param id path string true "competition id" @Accept json @Success 200 {object} app.CompetitionTeamDTO @Failure 500 system_error system error @Router /v1/competition/{id}/team [get]

func (*CompetitionController) GetRankingList

func (ctl *CompetitionController) GetRankingList(ctx *gin.Context)

@Summary GetRankingList @Description get ranking list of competition @Tags Competition @Param id path string true "competition id" @Accept json @Success 200 {object} app.CompetitonRankingDTO @Failure 500 system_error system error @Router /v1/competition/{id}/ranking [get]

func (*CompetitionController) GetRegisterInfo

func (ctl *CompetitionController) GetRegisterInfo(ctx *gin.Context)

@Summary GetRegisterInfo @Description get register info @Tags Competition @Accept json @Success 200 {object} app.UserRegisterInfoDTO @Failure 500 system_error system error @Router /v1/competition/reginfo [get]

func (*CompetitionController) GetSubmissions

func (ctl *CompetitionController) GetSubmissions(ctx *gin.Context)

@Summary GetSubmissions @Description get submissions @Tags Competition @Param id path string true "competition id" @Accept json @Success 200 {object} app.CompetitionSubmissionsDTO @Failure 500 system_error system error @Router /v1/competition/{id}/submissions [get]

func (*CompetitionController) JoinTeam

func (ctl *CompetitionController) JoinTeam(ctx *gin.Context)

@Summary JoinTeam @Description join a team of competition @Tags Competition @Param id path string true "competition id" @Param body body cc.JoinTeamRequest true "body of joining team" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/competition/{id}/team [put]

func (*CompetitionController) List

func (ctl *CompetitionController) List(ctx *gin.Context)

@Summary List @Description list competitions @Tags Competition @Param status query string false "competition status, such as over, preparing, in-progress" @Param mine query string false "just list competitions of competitor, if it is set" @Accept json @Success 200 {object} app.CompetitionSummaryDTO @Failure 500 system_error system error @Router /v1/competition [get]

func (*CompetitionController) QuitTeam

func (ctl *CompetitionController) QuitTeam(ctx *gin.Context)

@Summary QuitTeam @Description quit team @Tags Competition @Param id path string true "competition id" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/competition/{id}/team/action/quit [put]

func (*CompetitionController) Submit

func (ctl *CompetitionController) Submit(ctx *gin.Context)

@Summary Submit @Description submit @Tags Competition @Param id path string true "competition id" @Param file formData file true "result file" @Accept json @Success 201 {object} app.CompetitionSubmissionDTO @Failure 500 system_error system error @Router /v1/competition/{id}/submissions [post]

func (*CompetitionController) TransferLeader

func (ctl *CompetitionController) TransferLeader(ctx *gin.Context)

@Summary TransferLeader @Description transfer leader to a member @Tags Competition @Param id path string true "competition id" @Param body body cc.TransferLeaderRequest true "body of member" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/competition/{id}/team/action/transfer_leader [put]

type Compute

type Compute struct {
	Type    string `json:"type"`
	Flavor  string `json:"flavor"`
	Version string `json:"version"`
}

type ContainFileInfo

type ContainFileInfo struct {
	HasFile bool `json:"has_file"`
}

type CourseController

type CourseController struct {
	// contains filtered or unexported fields
}

func (*CourseController) AddCourseRelatedProject

func (ctl *CourseController) AddCourseRelatedProject(ctx *gin.Context)

@Summary AddCourseRelatedProject @Description add related project @Tags Course @Param id path string true "course id" @Param body body AddCourseRelatedProjectRequest true "project info" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/course/{id}/realted_project [put]

func (*CourseController) AddPlayRecord

func (ctl *CourseController) AddPlayRecord(ctx *gin.Context)

@Summary AddPlayRecord @Description add play record @Tags Course @Param id path string true "course id" @Param body body PlayRecordRequest true "record info" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/course/{id}/record [put]

func (*CourseController) Apply

func (ctl *CourseController) Apply(ctx *gin.Context)

@Summary Apply @Description apply the course @Tags Course @Param id path string true "course id" @Param body body StudentApplyRequest true "body of applying" @Accept json @Success 201 @Failure 500 system_error system error @Router /v1/course/{id}/player [post]

func (*CourseController) Get

func (ctl *CourseController) Get(ctx *gin.Context)

@Summary Get @Description get course infomation @Tags Course @Param id path string true "course id" @Accept json @Success 200 {object} app.CourseDTO @Failure 500 system_error system error @Router /v1/course/{id} [get]

func (*CourseController) GetAssignment

func (ctl *CourseController) GetAssignment(ctx *gin.Context)

@Summary GetAssignment @Description Get assignment @Tags Course @Param id path string true "course id" @Param asgid path string true "asg id" @Accept json @Success 200 {object} app.AsgDTO @Failure 500 system_error system error @Router /v1/course/:id/asg/:asgid [get]

func (*CourseController) GetCertification

func (ctl *CourseController) GetCertification(ctx *gin.Context)

@Summary GetCertification @Description get certification @Tags Course @Param id path string true "course id" @Accept json @Success 200 {object} app.CertInfoDTO @Failure 500 system_error system error @Router /v1/course/{id}/cert [get]

func (*CourseController) GetRegisterInfo

func (ctl *CourseController) GetRegisterInfo(ctx *gin.Context)

@Summary GetRegisterInfo @Description get register info @Tags Course @Accept json @Success 200 {object} app.UserRegisterInfoDTO @Failure 500 system_error system error @Router /v1/course/reginfo [get]

func (*CourseController) GetSubmissions

func (ctl *CourseController) GetSubmissions(ctx *gin.Context)

@Summary GetSubmissions @Description get submissions @Tags Course @Param id path string true "course id" @Accept json @Success 200 {object} app.RelateProjectDTO @Failure 500 system_error system error @Router /v1/course/{id}/asg/result [get]

func (*CourseController) List

func (ctl *CourseController) List(ctx *gin.Context)

@Summary List @Description list the course @Tags Course @Param status query string false "course status, such as over, preparing, in-progress" @Param type query string false "course type, such as ai, mindspore, foundation" @Param mine query string false "just list courses of player, if it is set" @Accept json @Success 200 {object} app.CourseSummaryDTO @Failure 500 system_error system error @Router /v1/course [get]

func (*CourseController) ListAssignments

func (ctl *CourseController) ListAssignments(ctx *gin.Context)

@Summary ListAssignments @Description list assignments @Tags Course @Param id path string true "course id" @Param status query string false "assignments status, such as finish" @Accept json @Success 200 {object} app.AsgWorkDTO @Failure 500 system_error system error @Router /v1/course/{id}/asg/list [get]

type DatasetController

type DatasetController struct {
	// contains filtered or unexported fields
}

func (*DatasetController) Check

func (ctl *DatasetController) Check(ctx *gin.Context)

@Summary Check @Description check whether the name can be applied to create a new dataset @Tags Dataset @Param owner path string true "owner of dataset" @Param name path string true "name of dataset" @Accept json @Success 200 {object} canApplyResourceNameResp @Produce json @Router /v1/dataset/{owner}/{name}/check [get]

func (*DatasetController) Create

func (ctl *DatasetController) Create(ctx *gin.Context)

@Summary Create @Description create dataset @Tags Dataset @Param body body datasetCreateRequest true "body of creating dataset" @Accept json @Success 201 {object} app.DatasetDTO @Failure 400 bad_request_body can't parse request body @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Failure 500 duplicate_creating create dataset repeatedly @Router /v1/dataset [post]

func (*DatasetController) Delete

func (ctl *DatasetController) Delete(ctx *gin.Context)

@Summary Delete @Description delete dataset @Tags Dataset @Param owner path string true "owner of dataset" @Param name path string true "name of dataset" @Accept json @Success 204 @Produce json @Router /v1/dataset/{owner}/{name} [delete]

func (*DatasetController) Get

func (ctl *DatasetController) Get(ctx *gin.Context)

@Summary Get @Description get dataset @Tags Dataset @Param owner path string true "owner of dataset" @Param name path string true "name of dataset" @Accept json @Success 200 {object} datasetDetail @Produce json @Router /v1/dataset/{owner}/{name} [get]

func (*DatasetController) List

func (ctl *DatasetController) List(ctx *gin.Context)

@Summary List @Description list dataset @Tags Dataset @Param owner path string true "owner of dataset" @Param name query string false "name of dataset" @Param repo_type query string false "repo type of dataset, value can be public or private" @Param count_per_page query int false "count per page" @Param page_num query int false "page num which starts from 1" @Param sort_by query string false "sort keys, value can be update_time, first_letter, download_count" @Accept json @Success 200 {object} datasetsInfo @Produce json @Router /v1/dataset/{owner} [get]

func (*DatasetController) ListGlobal

func (ctl *DatasetController) ListGlobal(ctx *gin.Context)

@Summary ListGlobal @Description list global public dataset @Tags Dataset @Param name query string false "name of dataset" @Param tags query string false "tags, separate multiple tags with commas" @Param tag_kinds query string false "tag kinds, separate multiple kinds with commas" @Param level query string false "dataset level, such as official, good" @Param count_per_page query int false "count per page" @Param page_num query int false "page num which starts from 1" @Param sort_by query string false "sort keys, value can be update_time, first_letter, download_count" @Accept json @Success 200 {object} app.GlobalDatasetsDTO @Produce json @Router /v1/dataset [get]

func (*DatasetController) SetTags

func (ctl *DatasetController) SetTags(ctx *gin.Context)

@Summary SetTags @Description set tags for dataset @Tags Dataset @Param owner path string true "owner of dataset" @Param id path string true "id of dataset" @Param body body resourceTagsUpdateRequest true "body of tags" @Accept json @Success 202 @Router /v1/dataset/{owner}/{id}/tags [put]

func (*DatasetController) Update

func (ctl *DatasetController) Update(ctx *gin.Context)

@Summary Update @Description update property of dataset @Tags Dataset @Param id path string true "id of dataset" @Param body body datasetUpdateRequest true "body of updating dataset" @Accept json @Produce json @Router /v1/dataset/{owner}/{id} [put]

type EmailCode

type EmailCode struct {
	Email string `json:"email"`
	Code  string `json:"code"`
}

type EmailSend

type EmailSend struct {
	Email string `json:"email"`
	Capt  string `json:"capt"`
}

type FinetuneController

type FinetuneController struct {
	// contains filtered or unexported fields
}

func (*FinetuneController) Create

func (ctl *FinetuneController) Create(ctx *gin.Context)

@Summary Create @Description create finetune @Tags Finetune @Param body body FinetuneCreateRequest true "body of creating finetune" @Accept json @Success 201 {object} finetuneCreateResp @Failure 500 system_error system error @Router /v1/finetune [post]

func (*FinetuneController) Delete

func (ctl *FinetuneController) Delete(ctx *gin.Context)

@Summary Delete @Description delete finetune @Tags Finetune @Param id path string true "finetune id" @Accept json @Success 204 @Failure 500 system_error system error @Router /v1/finetune/{id} [delete]

func (*FinetuneController) List

func (ctl *FinetuneController) List(ctx *gin.Context)

@Summary List @Description list finetunes @Tags Finetune @Accept json @Success 200 {object} app.UserFinetunesDTO @Failure 500 system_error system error @Router /v1/finetune [get]

func (*FinetuneController) Log

func (ctl *FinetuneController) Log(ctx *gin.Context)

@Summary Log @Description download finetune log @Tags Finetune @Param id path string true "finetune id" @Accept json @Success 200 {object} finetuneLog @Failure 500 system_error system error @Router /v1/finetune/{id}/log [get]

func (*FinetuneController) Terminate

func (ctl *FinetuneController) Terminate(ctx *gin.Context)

@Summary Terminate @Description terminate finetune @Tags Finetune @Param id path string true "finetune id" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/finetune/{id} [put]

func (*FinetuneController) WatchFinetunes

func (ctl *FinetuneController) WatchFinetunes(ctx *gin.Context)

@Summary WatchFinetunes @Description watch finetunes @Tags Finetune @Accept json @Success 200 {object} app.FinetuneSummaryDTO @Failure 500 system_error system error @Router /v1/finetune/ws [get]

func (*FinetuneController) WatchSingle

func (ctl *FinetuneController) WatchSingle(ctx *gin.Context)

@Summary WatchSingle @Description watch single finetune @Tags Finetune @Param id path string true "finetune id" @Accept json @Success 200 {object} finetuneLog @Failure 500 system_error system error @Router /v1/finetune/{id}/log/ws [get]

type FinetuneCreateRequest

type FinetuneCreateRequest struct {
	Name            string     `json:"name"`
	Model           string     `json:"model"`
	Task            string     `json:"task"`
	Hyperparameters []KeyValue `json:"hyperparameter"`
}

type HomeController

type HomeController struct {
	// contains filtered or unexported fields
}

func (*HomeController) ListAll

func (ctl *HomeController) ListAll(ctx *gin.Context)

@Summary ListAll @Description list the courses and competitions @Tags HomePage @Accept json @Success 200 {object} homeInfo @Failure 500 system_error system error @Router /v1/homepage [get]

func (*HomeController) ListAllElectricity

func (ctl *HomeController) ListAllElectricity(ctx *gin.Context)

@Summary ListAllElectricity @Description list the project dataset model courses and competitions @Tags HomePage @Accept json @Success 200 {object} homeElectricityInfo @Failure 500 system_error system error @Router /v1/homepage/electricity [get]

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type LikeController

type LikeController struct {
	// contains filtered or unexported fields
}

func (*LikeController) Create

func (ctl *LikeController) Create(ctx *gin.Context)

@Title Create @Description create a like @Tags Like @Param body body likeCreateRequest true "body of creating like" @Accept json @Success 201 @Failure 400 bad_request_body can't parse request body @Failure 401 bad_request_param some parameter of body is invalid @Failure 402 not_allowed can't add yourself as your like @Failure 403 resource_not_exists the target of like does not exist @Failure 404 duplicate_creating add like again @Failure 500 system_error system error @Router /v1/user/like [post]

func (*LikeController) Delete

func (ctl *LikeController) Delete(ctx *gin.Context)

@Title Delete @Description delete a like @Tags Like @Param body body likeDeleteRequest true "body of deleting like" @Accept json @Success 204 @Failure 400 bad_request_body can't parse request body @Failure 401 bad_request_param some parameter of body is invalid @Failure 402 not_allowed can't add yourself as your like @Failure 403 resource_not_exists the target of like does not exist @Failure 500 system_error system error @Router /v1/user/like [delete]

func (*LikeController) List

func (ctl *LikeController) List(ctx *gin.Context)

@Title List @Description list likes @Tags Like @Param account path string true "the account the likes belong to" @Accept json @Success 200 {object} app.LikeDTO @Failure 500 system_error system error @Router /v1/user/like/{account} [get]

type LoginController

type LoginController struct {
	// contains filtered or unexported fields
}

func (*LoginController) Login

func (ctl *LoginController) Login(ctx *gin.Context)

@Title Login @Description callback of authentication by authing @Tags Login @Param code query string true "authing code" @Param redirect_uri query string true "redirect uri" @Accept json @Success 200 {object} app.UserDTO @Failure 500 system_error system error @Failure 501 duplicate_creating create user repeatedly which should not happen @Router /v1/login [get]

func (*LoginController) Logout

func (ctl *LoginController) Logout(ctx *gin.Context)

@Title Logout @Description get info of login @Tags Login @Param account path string true "account" @Accept json @Success 200 {object} app.LoginDTO @Failure 400 bad_request_param account is invalid @Failure 401 not_allowed can't get login info of other user @Failure 500 system_error system error @Router /v1/login/{account} [get]

func (*LoginController) SignIn

func (ctl *LoginController) SignIn(ctx *gin.Context)

@Title SignIn @Description user sign in @Tags Login @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/signin [put]

type ModelController

type ModelController struct {
	// contains filtered or unexported fields
}

func (*ModelController) AddRelatedDataset

func (ctl *ModelController) AddRelatedDataset(ctx *gin.Context)

@Summary AddRelatedDataset @Description add related dataset to model @Tags Model @Param owner path string true "owner of model" @Param id path string true "id of model" @Param body body relatedResourceAddRequest true "body of related dataset" @Accept json @Success 202 {object} app.ResourceDTO @Router /v1/model/relation/{owner}/{id}/dataset [put]

func (*ModelController) Check

func (ctl *ModelController) Check(ctx *gin.Context)

@Summary Check @Description check whether the name can be applied to create a new model @Tags Model @Param owner path string true "owner of model" @Param name path string true "name of model" @Accept json @Success 200 {object} canApplyResourceNameResp @Produce json @Router /v1/model/{owner}/{name}/check [get]

func (*ModelController) Create

func (ctl *ModelController) Create(ctx *gin.Context)

@Summary Create @Description create model @Tags Model @Param body body modelCreateRequest true "body of creating model" @Accept json @Success 201 {object} app.ModelDTO @Failure 400 bad_request_body can't parse request body @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Failure 500 duplicate_creating create model repeatedly @Router /v1/model [post]

func (*ModelController) Delete

func (ctl *ModelController) Delete(ctx *gin.Context)

@Summary Delete @Description delete model @Tags Model @Param owner path string true "owner of model" @Param name path string true "name of model" @Accept json @Success 204 @Produce json @Router /v1/model/{owner}/{name} [delete]

func (*ModelController) Get

func (ctl *ModelController) Get(ctx *gin.Context)

@Summary Get @Description get model @Tags Model @Param owner path string true "owner of model" @Param name path string true "name of model" @Accept json @Success 200 {object} modelDetail @Produce json @Router /v1/model/{owner}/{name} [get]

func (*ModelController) List

func (ctl *ModelController) List(ctx *gin.Context)

@Summary List @Description list model @Tags Model @Param owner path string true "owner of model" @Param name query string false "name of model" @Param repo_type query string false "repo type of model, value can be public or private" @Param count_per_page query int false "count per page" @Param page_num query int false "page num which starts from 1" @Param sort_by query string false "sort keys, value can be update_time, first_letter, download_count" @Accept json @Success 200 {object} modelsInfo @Produce json @Router /v1/model/{owner} [get]

func (*ModelController) ListGlobal

func (ctl *ModelController) ListGlobal(ctx *gin.Context)

@Summary ListGlobal @Description list global public model @Tags Model @Param name query string false "name of model" @Param tags query string false "tags, separate multiple tags with commas" @Param tag_kinds query string false "tag kinds, separate multiple kinds with commas" @Param level query string false "model level, such as official, good" @Param count_per_page query int false "count per page" @Param page_num query int false "page num which starts from 1" @Param sort_by query string false "sort keys, value can be update_time, first_letter, download_count" @Accept json @Success 200 {object} app.GlobalModelsDTO @Produce json @Router /v1/model [get]

func (*ModelController) RemoveRelatedDataset

func (ctl *ModelController) RemoveRelatedDataset(ctx *gin.Context)

@Summary RemoveRelatedDataset @Description remove related dataset to model @Tags Model @Param owner path string true "owner of model" @Param id path string true "id of model" @Param body body relatedResourceRemoveRequest true "body of related dataset" @Accept json @Success 204 @Router /v1/model/relation/{owner}/{id}/dataset [delete]

func (*ModelController) SetTags

func (ctl *ModelController) SetTags(ctx *gin.Context)

@Summary SetTags @Description set tags for model @Tags Model @Param owner path string true "owner of model" @Param id path string true "id of model" @Param body body resourceTagsUpdateRequest true "body of tags" @Accept json @Success 202 @Router /v1/model/{owner}/{id}/tags [put]

func (*ModelController) Update

func (ctl *ModelController) Update(ctx *gin.Context)

@Summary Update @Description update property of model @Tags Model @Param id path string true "id of model" @Param body body modelUpdateRequest true "body of updating model" @Accept json @Produce json @Router /v1/model/{owner}/{id} [put]

type PlayRecordRequest

type PlayRecordRequest struct {
	SectionId   string `bson:"section_id"    json:"section_id"`
	LessonId    string `bson:"lesson_id"     json:"lesson_id"`
	PointId     string `bson:"point_id"      json:"point_id"`
	PlayCount   int    `bson:"play_count"    json:"play_count"`
	FinishCount int    `bson:"finish_count"  json:"finish_count"`
}

type ProjectController

type ProjectController struct {
	// contains filtered or unexported fields
}

func (*ProjectController) AddRelatedDataset

func (ctl *ProjectController) AddRelatedDataset(ctx *gin.Context)

@Summary AddRelatedDataset @Description add related dataset to project @Tags Project @Param owner path string true "owner of project" @Param id path string true "id of project" @Param body body relatedResourceAddRequest true "body of related dataset" @Accept json @Success 202 {object} app.ResourceDTO @Router /v1/project/relation/{owner}/{id}/dataset [put]

func (*ProjectController) AddRelatedModel

func (ctl *ProjectController) AddRelatedModel(ctx *gin.Context)

@Summary AddRelatedModel @Description add related model to project @Tags Project @Param owner path string true "owner of project" @Param id path string true "id of project" @Param body body relatedResourceAddRequest true "body of related model" @Accept json @Success 202 {object} app.ResourceDTO @Router /v1/project/relation/{owner}/{id}/model [put]

func (*ProjectController) Check

func (ctl *ProjectController) Check(ctx *gin.Context)

@Summary Check @Description check whether the name can be applied to create a new project @Tags Project @Param owner path string true "owner of project" @Param name path string true "name of project" @Accept json @Success 200 {object} canApplyResourceNameResp @Produce json @Router /v1/project/{owner}/{name}/check [get]

func (*ProjectController) Create

func (ctl *ProjectController) Create(ctx *gin.Context)

@Summary Create @Description create project @Tags Project @Param body body projectCreateRequest true "body of creating project" @Accept json @Produce json @Router /v1/project [post]

func (*ProjectController) Delete

func (ctl *ProjectController) Delete(ctx *gin.Context)

@Summary Delete @Description delete project @Tags Project @Param owner path string true "owner of project" @Param name path string true "name of project" @Accept json @Success 204 @Produce json @Router /v1/project/{owner}/{name} [delete]

func (*ProjectController) Fork

func (ctl *ProjectController) Fork(ctx *gin.Context)

@Summary Fork @Description fork project @Tags Project @Param owner path string true "owner of forked project" @Param id path string true "id of forked project" @Param body body projectForkRequest true "body of forking project" @Accept json @Produce json @Router /v1/project/{owner}/{id} [post]

func (*ProjectController) Get

func (ctl *ProjectController) Get(ctx *gin.Context)

@Summary Get @Description get project @Tags Project @Param owner path string true "owner of project" @Param name path string true "name of project" @Accept json @Success 200 {object} projectDetail @Produce json @Router /v1/project/{owner}/{name} [get]

func (*ProjectController) List

func (ctl *ProjectController) List(ctx *gin.Context)

@Summary List @Description list project @Tags Project @Param owner path string true "owner of project" @Param name query string false "name of project" @Param repo_type query string false "repo type of project, value can be public or private" @Param count_per_page query int false "count per page" @Param page_num query int false "page num which starts from 1" @Param sort_by query string false "sort keys, value can be update_time, first_letter, download_count" @Accept json @Success 200 {object} projectsInfo @Produce json @Router /v1/project/{owner} [get]

func (*ProjectController) ListGlobal

func (ctl *ProjectController) ListGlobal(ctx *gin.Context)

@Summary ListGlobal @Description list global public project @Tags Project @Param name query string false "name of project" @Param tags query string false "tags, separate multiple tags with commas" @Param tag_kinds query string false "tag kinds, separate multiple kinds with commas" @Param level query string false "project level, such as official, good" @Param count_per_page query int false "count per page" @Param page_num query int false "page num which starts from 1" @Param sort_by query string false "sort keys, value can be update_time, first_letter, download_count" @Accept json @Success 200 {object} app.GlobalProjectsDTO @Produce json @Router /v1/project [get]

func (*ProjectController) RemoveRelatedDataset

func (ctl *ProjectController) RemoveRelatedDataset(ctx *gin.Context)

@Summary RemoveRelatedDataset @Description remove related dataset to project @Tags Project @Param owner path string true "owner of project" @Param id path string true "id of project" @Param body body relatedResourceRemoveRequest true "body of related dataset" @Accept json @Success 204 @Router /v1/project/relation/{owner}/{id}/dataset [delete]

func (*ProjectController) RemoveRelatedModel

func (ctl *ProjectController) RemoveRelatedModel(ctx *gin.Context)

@Summary RemoveRelatedModel @Description remove related model to project @Tags Project @Param owner path string true "owner of project" @Param id path string true "id of project" @Param body body relatedResourceRemoveRequest true "body of related model" @Accept json @Success 204 @Router /v1/project/relation/{owner}/{id}/model [delete]

func (*ProjectController) SetTags

func (ctl *ProjectController) SetTags(ctx *gin.Context)

@Summary SetTags @Description set tags for project @Tags Project @Param owner path string true "owner of project" @Param id path string true "id of project" @Param body body resourceTagsUpdateRequest true "body of tags" @Accept json @Success 202 @Router /v1/project/{owner}/{id}/tags [put]

func (*ProjectController) Update

func (ctl *ProjectController) Update(ctx *gin.Context)

@Summary Update @Description update project @Tags Project @Param owner path string true "owner of project" @Param id path string true "id of project" @Param body body projectUpdateRequest true "body of updating project" @Accept json @Produce json @Router /v1/project/{owner}/{id} [put]

type RepoFileController

type RepoFileController struct {
	// contains filtered or unexported fields
}

func (*RepoFileController) ContainApp

func (ctl *RepoFileController) ContainApp(ctx *gin.Context)

@Summary ContainApp @Description repo file contain app @Tags RepoFile @Param user path string true "user" @Param name path string true "repo name" @Param path path string true "repo file path" @Accept json @Success 200 @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{user}/{name}/app [get]

func (*RepoFileController) ContainReadme

func (ctl *RepoFileController) ContainReadme(ctx *gin.Context)

@Summary ContainReadme @Description repo file contain readme @Tags RepoFile @Param user path string true "user" @Param name path string true "repo name" @Param path path string true "repo file path" @Accept json @Success 200 @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{user}/{name}/readme [get]

func (*RepoFileController) Create

func (ctl *RepoFileController) Create(ctx *gin.Context)

@Summary Create @Description create repo file @Tags RepoFile @Param name path string true "repo name" @Param path path string true "repo file path" @Param body body RepoFileCreateRequest true "body of creating repo file" @Accept json @Success 201 @Failure 400 bad_request_body can't parse request body @Failure 401 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{name}/file/{path} [post]

func (*RepoFileController) Delete

func (ctl *RepoFileController) Delete(ctx *gin.Context)

@Summary Delete @Description Delete repo file @Tags RepoFile @Param name path string true "repo name" @Param path path string true "repo file path" @Accept json @Success 204 @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{name}/file/{path} [delete]

func (*RepoFileController) DeleteDir

func (ctl *RepoFileController) DeleteDir(ctx *gin.Context)

@Summary DeleteDir @Description Delete repo directory @Tags RepoFile @Param name path string true "repo name" @Param path path string true "repo dir" @Accept json @Success 204 @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{name}/dir/{path} [delete]

func (*RepoFileController) Download

func (ctl *RepoFileController) Download(ctx *gin.Context)

@Summary Download @Description Download repo file @Tags RepoFile @Param user path string true "user" @Param name path string true "repo name" @Param path path string true "repo file path" @Accept json @Success 200 {object} app.RepoFileDownloadDTO @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{user}/{name}/file/{path} [get]

func (*RepoFileController) DownloadRepo

func (ctl *RepoFileController) DownloadRepo(ctx *gin.Context)

@Summary DownloadRepo @Description Download repo @Tags RepoFile @Param user path string true "user" @Param name path string true "repo name" @Accept json @Success 200 @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{user}/{name} [get]

func (*RepoFileController) List

func (ctl *RepoFileController) List(ctx *gin.Context)

@Summary List @Description list repo file in a path @Tags RepoFile @Param user path string true "user" @Param name path string true "repo name" @Param path query string true "repo file path" @Accept json @Success 200 {object} app.RepoPathItem @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{user}/{name}/files [get]

func (*RepoFileController) Preview

func (ctl *RepoFileController) Preview(ctx *gin.Context)

@Summary Preview @Description preview repo file @Tags RepoFile @Param user path string true "user" @Param name path string true "repo name" @Param path path string true "repo file path" @Accept json @Success 200 @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{user}/{name}/file/{path}/preview [get]

func (*RepoFileController) Update

func (ctl *RepoFileController) Update(ctx *gin.Context)

@Summary Update @Description update repo file @Tags RepoFile @Param name path string true "repo name" @Param path path string true "repo file path" @Param body body RepoFileUpdateRequest true "body of updating repo file" @Accept json @Success 202 @Failure 400 bad_request_body can't parse request body @Failure 401 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/repo/{type}/{name}/file/{path} [put]

type RepoFileCreateRequest

type RepoFileCreateRequest struct {
	Content       string `json:"content"`
	Base64Encoded bool   `json:"base64_encoded"`
}

type RepoFileUpdateRequest

type RepoFileUpdateRequest = RepoFileCreateRequest

type SearchController

type SearchController struct {
	// contains filtered or unexported fields
}

func (*SearchController) List

func (ctl *SearchController) List(ctx *gin.Context)

@Title Search @Description search resource and user @Tags Search @Param name query string true "name of resource or user" @Accept json @Success 200 {object} app.SearchDTO @Failure 500 system_error system error @Router /v1/search [get]

type StudentApplyRequest

type StudentApplyRequest struct {
	Name      string            `json:"name"`
	City      string            `json:"city"`
	Email     string            `json:"email"`
	Phone     string            `json:"phone"`
	Identity  string            `json:"identity"`
	Province  string            `json:"province"`
	Detail    map[string]string `json:"detail"`
	Agreement bool              `json:"agreement"`
}

type Tags

type Tags struct {
	ModelTagDomains         []string `json:"model"            required:"true"`
	ProjectTagDomains       []string `json:"project"          required:"true"`
	DatasetTagDomains       []string `json:"dataset"          required:"true"`
	GlobalModelTagDomains   []string `json:"global_model"     required:"true"`
	GlobalProjectTagDomains []string `json:"global_project"   required:"true"`
	GlobalDatasetTagDomains []string `json:"global_dataset"   required:"true"`
}

type TagsController

type TagsController struct {
	// contains filtered or unexported fields
}

func (*TagsController) List

func (ctl *TagsController) List(ctx *gin.Context)

@Title List @Description list tags @Tags Tags @Accept json @Success 200 {object} app.DomainTagsDTO @Failure 500 system_error system error @Router /v1/tags/{type} [get]

type TrainingController

type TrainingController struct {
	// contains filtered or unexported fields
}

func (*TrainingController) Create

func (ctl *TrainingController) Create(ctx *gin.Context)

@Summary Create @Description create training @Tags Training @Param pid path string true "project id" @Param body body TrainingCreateRequest true "body of creating training" @Accept json @Success 201 {object} trainingCreateResp @Failure 400 bad_request_body can't parse request body @Failure 401 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/train/project/{pid}/training [post]

func (*TrainingController) Delete

func (ctl *TrainingController) Delete(ctx *gin.Context)

@Summary Delete @Description delete training @Tags Training @Param pid path string true "project id" @Param id path string true "training id" @Accept json @Success 204 @Failure 500 system_error system error @Router /v1/train/project/{pid}/training/{id} [delete]

func (*TrainingController) Get

func (ctl *TrainingController) Get(ctx *gin.Context)

@Summary Get @Description get training info @Tags Training @Param pid path string true "project id" @Param id path string true "training id" @Accept json @Success 200 {object} trainingDetail @Failure 500 system_error system error @Router /v1/train/project/{pid}/training/{id} [get]

func (*TrainingController) GetResultDownloadURL

func (ctl *TrainingController) GetResultDownloadURL(ctx *gin.Context)

@Summary GetLog @Description get log url of training for downloading @Tags Training @Param pid path string true "project id" @Param id path string true "training id" @Param type path string true "training result: log, output" @Accept json @Success 200 {object} trainingLogResp @Failure 500 system_error system error @Router /v1/train/project/{pid}/training/{id}/result/{type} [get]

func (*TrainingController) List

func (ctl *TrainingController) List(ctx *gin.Context)

@Summary List @Description get trainings @Tags Training @Param pid path string true "project id" @Accept json @Success 200 {object} app.TrainingSummaryDTO @Failure 500 system_error system error @Router /v1/train/project/{pid}/training [get]

func (*TrainingController) ListByWS

func (ctl *TrainingController) ListByWS(ctx *gin.Context)

@Summary List @Description get trainings @Tags Training @Param pid path string true "project id" @Accept json @Success 200 {object} app.TrainingSummaryDTO @Failure 500 system_error system error @Router /v1/train/project/{pid}/training/ws [get]

func (*TrainingController) Recreate

func (ctl *TrainingController) Recreate(ctx *gin.Context)

@Summary Recreate @Description recreate training @Tags Training @Param pid path string true "project id" @Param id path string true "training id" @Accept json @Success 201 {object} trainingCreateResp @Failure 400 bad_request_body can't parse request body @Failure 401 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Router /v1/train/project/{pid}/training/{id} [post]

func (*TrainingController) Terminate

func (ctl *TrainingController) Terminate(ctx *gin.Context)

@Summary Terminate @Description terminate training @Tags Training @Param pid path string true "project id" @Param id path string true "training id" @Accept json @Success 202 @Failure 500 system_error system error @Router /v1/train/project/{pid}/training/{id} [put]

type TrainingCreateRequest

type TrainingCreateRequest struct {
	Name string `json:"name"`
	Desc string `json:"desc"`

	CodeDir  string `json:"code_dir"`
	BootFile string `json:"boot_file"`

	Hyperparameters []KeyValue    `json:"hyperparameter"`
	Env             []KeyValue    `json:"env"`
	Models          []TrainingRef `json:"models"`
	Datasets        []TrainingRef `json:"datasets"`
	EnableAim       bool          `json:"enable_aim"`
	EnableOutput    bool          `json:"enable_output"`

	Compute Compute `json:"compute"`
}

type TrainingRef

type TrainingRef struct {
	Key   string `json:"key"`
	Owner string `json:"owner"`
	Name  string `json:"name"`
	File  string `json:"File"`
}

type UserAgreement

type UserAgreement struct {
	Type agreement.AgreementType `json:"type"`
}

type UserController

type UserController struct {
	// contains filtered or unexported fields
}

func (*UserController) AddFollowing

func (ctl *UserController) AddFollowing(ctx *gin.Context)

@Title Create @Description add a following @Tags Following @Param body body followingCreateRequest true "body of creating following" @Accept json @Success 201 @Failure 400 bad_request_body can't parse request body @Failure 401 bad_request_param some parameter of body is invalid @Failure 402 not_allowed can't add yourself as your following @Failure 403 resource_not_exists the target of following does not exist @Failure 404 duplicate_creating add following again @Failure 500 system_error system error @Router /v1/user/following [post]

func (*UserController) BindEmail

func (ctl *UserController) BindEmail(ctx *gin.Context)

@Summary BindEmail @Description bind email according the code @Tags User @Param body body userCreateRequest true "body of creating user" @Accept json @Success 201 {object} app.UserDTO @Failure 400 bad_request_body can't parse request body @Failure 400 bad_request_param some parameter of body is invalid @Failure 500 system_error system error @Failure 500 duplicate_creating create user repeatedly @Router /v1/user/email/bind [post]

func (*UserController) CheckEmail

func (ctl *UserController) CheckEmail(ctx *gin.Context)

@Title CheckEmail @Description check user email @Tags User @Accept json @Success 200 @Failure 400 no email this api need email of user" @Router /v1/user/check_email [get]

func (*UserController) Get

func (ctl *UserController) Get(ctx *gin.Context)

@Summary Get @Description get user @Tags User @Param account query string false "account" @Accept json @Success 200 {object} userDetail @Failure 400 bad_request_param account is invalid @Failure 401 resource_not_exists user does not exist @Failure 500 system_error system error @Router /v1/user [get]

func (*UserController) GetInfo

func (ctl *UserController) GetInfo(ctx *gin.Context)

@Summary GetInfo @Description get user apply info @Tags User @Param body body userCreateRequest true "body of creating user" @Accept json @Success 200 {object} app.UserDTO @Failure 400 bad_request_body can't parse request body @Router /v1/user/info/{account} [get]

func (*UserController) GitlabToken

func (ctl *UserController) GitlabToken(ctx *gin.Context)

@Title GitLabToken @Description get code platform info of user @Tags User @Param account path string true "account" @Accept json @Success 200 {object} platformInfo @Failure 400 bad_request_param account is invalid @Failure 401 not_allowed can't get info of other user @Router /{account}/gitlab [get]

func (*UserController) ListFollower

func (ctl *UserController) ListFollower(ctx *gin.Context)

@Title List @Description list followers @Tags Follower @Param account path string true "the account the followers belong to" @Accept json @Success 200 {object} app.FollowsDTO @Failure 500 system_error system error @Router /v1/user/follower/{account} [get]

func (*UserController) ListFollowing

func (ctl *UserController) ListFollowing(ctx *gin.Context)

@Title List @Description list followings @Tags Following @Param account path string true "the account the followings belong to" @Accept json @Success 200 {object} app.FollowsDTO @Failure 500 system_error system error @Router /v1/user/following/{account} [get]

func (*UserController) RefreshGitlabToken

func (ctl *UserController) RefreshGitlabToken(ctx *gin.Context)

@Title RefreshGitlabToken @Description refresh platform token of user @Tags User @Param account path string true "account" @Accept json @Success 201 created PlatformToken @Failure 400 bad_request_param account is invalid @Failure 401 not_allowed can't get info of other user @Router /{account}/gitlab/refresh [post]

func (*UserController) RemoveFollowing

func (ctl *UserController) RemoveFollowing(ctx *gin.Context)

@Title Delete @Description remove a following @Tags Following @Param account path string true "the account of following" @Accept json @Success 204 @Failure 400 bad_request_param invalid account @Failure 401 not_allowed can't remove yourself from your following @Failure 500 system_error system error @Router /v1/user/following/{account} [delete]

func (*UserController) SendBindEmail

func (ctl *UserController) SendBindEmail(ctx *gin.Context)

@Summary SendBindEmail @Description send code to user @Tags User @Accept json @Success 201 {object} app.UserDTO @Failure 500 system_error system error @Failure 500 duplicate_creating create user repeatedly @Router /v1/user/email/sendbind [post]

func (*UserController) Update

func (ctl *UserController) Update(ctx *gin.Context)

@Summary Update @Description update user basic info @Tags User @Param body body userBasicInfoUpdateRequest true "body of updating user" @Accept json @Produce json @Router /v1/user [put]

func (*UserController) UpdateAgreement

func (ctl *UserController) UpdateAgreement(ctx *gin.Context)

@Summary Update Agreement @Description update user agreement info @Tags User @Param body body UserAgreement true "body of update user agreement" @Accept json @Produce json @Router /v1/user/agreement [put]

type UserPointsController

type UserPointsController struct {
	// contains filtered or unexported fields
}

func (*UserPointsController) PointsDetails

func (ctl *UserPointsController) PointsDetails(ctx *gin.Context)

@Summary get user points details @Description get user points details @Tags UserPoints @Accept json @Success 200 {object} app.UserPointsDetailsDTO @Failure 500 system_error system error @Router /v1/user_points [get]

func (*UserPointsController) TasksDoc

func (ctl *UserPointsController) TasksDoc(ctx *gin.Context)

@Summary task doc @Description task doc @Tags UserPoints @Accept json @Success 200 {object} app.TaskDocDTO @Failure 500 system_error system error @Router /v1/user_points/taskdoc [get]

func (*UserPointsController) TasksOfDay

func (ctl *UserPointsController) TasksOfDay(ctx *gin.Context)

@Summary tasks of day @Description tasks of day @Tags UserPoints @Accept json @Success 200 {object} app.TasksCompletionInfoDTO @Failure 500 system_error system error @Router /v1/user_points/tasks [get]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL