func (h *ProjectOpsImpl) ProjectOpsCreateProject(params project_ops.ProjectOpsCreateProjectParams, principal *models.IdentityVerifyResp) middleware.Responder {
	createdProject := params.Body.Project

	createProjReq := &projectpb.CreateProjectReq{
		Project: &model.Project{
			Name:     createdProject.Name,
			Describe: createdProject.Describe,
		},
	}

	createProjResp, err := h.projectclient.CreateProject(params.HTTPRequest.Context(), createProjReq)
	if err != nil {
		return errors.NewCommonResposeWithErr(err)
	} else if createProjResp.Error != nil {
		return errors.NewCommonResponseWithErrBody(createProjResp.Error)
	}

	err = h.setProjectAuthorityForUser(params.HTTPRequest.Context(), createdProject.Name, principal.Identity.Email)
	if err != nil {
		return errors.NewCommonResposeWithErr(err)
	}

	return project_ops.NewProjectOpsCreateProjectOK().WithPayload(&models.ModelCommonResp{})
}
// ProjectOpsCreateProject create a project for user.
ProjectOpsCreateProject create a project for user.
// ProjectOpsCreateProject create a project for user .
func (h *ProjectOpsImpl) ProjectOpsCreateProject(params project_ops.ProjectOpsCreateProjectParams, principal *models.IdentityVerifyResp) middleware.Responder {
	createdProject := params.Body.Project
	createProjReq := &projectpb.CreateProjectReq{
		Project: &model.Project{
			Name:     createdProject.Name,
			Describe: createdProject.Describe,
		},
	}
	createProjResp, err := h.projectclient.CreateProject(params.HTTPRequest.Context(), createProjReq)
	if err != nil {
		return errors.NewCommonResposeWithErr(err)
	} else if createProjResp.Error != nil {
		return errors.NewCommonResponseWithErrBody(createProjResp.Error)
	}
	err = h.setProjectAuthorityForUser(params.HTTPRequest.Context(), createdProject.Name, principal.Identity.Email)
	if err != nil {
		return errors.NewCommonResposeWithErr(err)
	}
	return project_ops.NewProjectOpsCreateProjectOK().WithPayload(&models.ModelCommonResp{})
}
func ( h * ProjectOpsImpl ) ProjectOpsCreateProject ( params project_ops . ProjectOpsCreateProjectParams , principal * models . IdentityVerifyResp ) middleware . Responder { createdProject := params . Body . Project createProjReq := & projectpb . CreateProjectReq { Project : & model . Project { Name : createdProject . Name , Describe : createdProject . Describe , } , } createProjResp , err := h . projectclient . CreateProject ( params . HTTPRequest . Context ( ) , createProjReq ) if err != nil { return errors . NewCommonResposeWithErr ( err ) } else if createProjResp . Error != nil { return errors . NewCommonResponseWithErrBody ( createProjResp . Error ) } err = h . setProjectAuthorityForUser ( params . HTTPRequest . Context ( ) , createdProject . Name , principal . Identity . Email ) if err != nil { return errors . NewCommonResposeWithErr ( err ) } return project_ops . NewProjectOpsCreateProjectOK ( ) . WithPayload ( & models . ModelCommonResp { } ) }
ProjectOpsCreateProject create a project for user.
ProjectOpsCreateProject create a project for user .