mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 19:49:16 +00:00
31 lines
631 B
Go
31 lines
631 B
Go
package databag
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func GetProfile(w http.ResponseWriter, r *http.Request) {
|
|
|
|
account, code, err := BearerAppToken(r, true);
|
|
if err != nil {
|
|
ErrResponse(w, code, err)
|
|
return
|
|
}
|
|
detail := account.AccountDetail
|
|
|
|
// send profile data
|
|
profile := Profile {
|
|
Guid: account.Guid,
|
|
Handle: account.Username,
|
|
Name: detail.Name,
|
|
Description: detail.Description,
|
|
Location: detail.Location,
|
|
Image: detail.Image,
|
|
Revision: account.ProfileRevision,
|
|
Version: APP_VERSION,
|
|
Node: "https://" + getStrConfigValue(CONFIG_DOMAIN, "") + "/",
|
|
}
|
|
WriteResponse(w, profile)
|
|
}
|
|
|