tsk-58: Update names of Contact endpoint (#67)

Closes #58

Reviewed-on: phoenix/textsender-api#67
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2026-01-07 20:24:30 +00:00
committed by phoenix
parent 4e250d095c
commit a51979e724
11 changed files with 460 additions and 8 deletions
+94
View File
@@ -116,6 +116,57 @@
}
}
},
"/contact/update": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update the first, last, or nickname of a Contact (requires JWT)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"contacts"
],
"summary": "Update names of Contact",
"parameters": [
{
"description": "Data to update contact's names",
"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"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handler.UpdateNameResponse"
}
}
}
}
},
"/instant/message": {
"post": {
"security": [
@@ -984,6 +1035,15 @@
"handler.RequestAddContact": {
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"nickname": {
"type": "string"
},
"phone_number": {
"type": "string"
},
@@ -1098,6 +1158,40 @@
}
}
},
"handler.UpdateNameRequest": {
"type": "object",
"properties": {
"contact_id": {
"type": "string"
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"nickname": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"handler.UpdateNameResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/contact.Contact"
}
},
"message": {
"type": "string"
}
}
},
"message.Message": {
"type": "object",
"properties": {