tsk-35: Update name of user (#38)

Closes #35

Reviewed-on: phoenix/textsender-auth#38
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2026-01-01 22:41:08 +00:00
committed by phoenix
parent de171b790d
commit 689762c72a
11 changed files with 446 additions and 25 deletions
+94 -2
View File
@@ -270,6 +270,63 @@
}
}
},
"/user/name/update": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the first or last name of a user (requires JWT)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Update name of user",
"parameters": [
{
"description": "Data to update name of user",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.UpdateNameRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.UpdateNameResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handler.UpdateNameResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handler.UpdateNameResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handler.UpdateNameResponse"
}
}
}
}
},
"/user/password/update": {
"patch": {
"security": [
@@ -326,7 +383,7 @@
"git_kundeng_us_phoenix_textsender-models_tx0_user.User": {
"type": "object",
"properties": {
"date_created": {
"created": {
"type": "string"
},
"first_name": {
@@ -491,6 +548,34 @@
}
}
},
"handler.UpdateNameRequest": {
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"handler.UpdateNameResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/git_kundeng_us_phoenix_textsender-models_tx0_user.User"
}
},
"message": {
"type": "string"
}
}
},
"handler.UpdatePasswordRequest": {
"type": "object",
"properties": {
@@ -531,6 +616,9 @@
"expires_in": {
"type": "integer"
},
"issued_at": {
"type": "integer"
},
"token_type": {
"type": "string"
},
@@ -542,16 +630,20 @@
"user.ServiceUser": {
"type": "object",
"properties": {
"date_created": {
"created": {
"type": "string"
},
"id": {
"type": "string"
},
"last_login": {
"type": "string"
},
"passphrase": {
"type": "string"
},
"username": {
"description": "TODO: Remove the omitempty tags at a later point",
"type": "string"
}
}