MCPcopy Create free account
hub / github.com/OpenCSGs/csghub-server / Get

Method Get

user/handler/organization.go:87–102  ·  view source on GitHub ↗

GetOrganization godoc @Security ApiKey @Summary Get organization info @Tags Organization @Accept json @Produce json @Param current_user query string false "the op user" @param namespace path string true "namespace" @Success 200 {object} types.Response

(ctx *gin.Context)

Source from the content-addressed store, hash-verified

85// @Failure 500 {object} types.APIInternalServerError "Internal server error"
86// @Router /organization/{namespace} [get]
87func (h *OrganizationHandler) Get(ctx *gin.Context) {
88 orgName := ctx.Param("namespace")
89 if len(orgName) == 0 {
90 httpbase.BadRequest(ctx, "organization name is empty")
91 return
92 }
93 org, err := h.c.Get(ctx, orgName)
94 if err != nil {
95 slog.Error("Failed to get organization", slog.Any("error", err), slog.String("org_path", orgName))
96 httpbase.ServerError(ctx, err)
97 return
98 }
99
100 slog.Info("Get organization succeed", slog.String("org_path", org.Name))
101 httpbase.OK(ctx, org)
102}
103
104// GetOrganizations godoc
105// @Security ApiKey

Callers

nothing calls this directly

Calls 4

BadRequestFunction · 0.92
ServerErrorFunction · 0.92
OKFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected