Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions docker-compose.run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: '3.8'

services:
evolution-go:
image: evolution-go:latest
restart: unless-stopped
ports:
- "4000:4000"
environment:
SERVER_PORT: 4000
CLIENT_NAME: "evolution"
GLOBAL_API_KEY: "429683C4C977415CAAFCCE10F7D57E11"
POSTGRES_AUTH_DB: "postgresql://postgres:postgres@postgres:5432/evogo_auth?sslmode=disable"
POSTGRES_USERS_DB: "postgresql://postgres:postgres@postgres:5432/evogo_users?sslmode=disable"
DATABASE_SAVE_MESSAGES: "false"
WADEBUG: "DEBUG"
LOGTYPE: "console"
CONNECT_ON_STARTUP: "true"
WEBHOOKFILES: "true"
OS_NAME: "Linux"
WEBHOOK_URL: ""
AMQP_URL: ""
MINIO_ENABLED: "false"
EVENT_IGNORE_GROUP: "false"
EVENT_IGNORE_STATUS: "true"
QRCODE_MAX_COUNT: "5"
volumes:
- evolution_data:/app/dbdata
- evolution_logs:/app/logs
networks:
- evolution_network
depends_on:
postgres:
condition: service_healthy

postgres:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- evolution_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5

volumes:
evolution_data:
evolution_logs:
postgres_data:

networks:
evolution_network:
driver: bridge
197 changes: 197 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2175,6 +2175,167 @@ const docTemplate = `{
}
}
},
"/send/list": {
"post": {
"description": "Send a list message",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Send Message"
],
"summary": "Send a list message",
"parameters": [
{
"description": "List message data",
"name": "message",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/github_com_Zapbox-API_evolution-go_pkg_sendMessage_service.ListStruct"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"$ref": "#/definitions/gin.H"
}
},
"400": {
"description": "Error on validation",
"schema": {
"$ref": "#/definitions/gin.H"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/gin.H"
}
}
}
}
},
"/send/status/text": {
"post": {
"description": "Send a WhatsApp text status to status@broadcast",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Send Message"
],
"summary": "Send a WhatsApp text status",
"parameters": [
{
"description": "Status text data",
"name": "message",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/github_com_Zapbox-API_evolution-go_pkg_sendMessage_service.StatusTextStruct"
}
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"$ref": "#/definitions/gin.H"
}
},
"400": {
"description": "Error on validation",
"schema": {
"$ref": "#/definitions/gin.H"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/gin.H"
}
}
}
}
},
"/send/status/media": {
"post": {
"description": "Send an image or video status to status@broadcast. Supports JSON (URL) or multipart/form-data (file upload)",
"consumes": [
"application/json",
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"Send Message"
],
"summary": "Send a WhatsApp media status (image/video)",
"parameters": [
{
"description": "Media type: image or video",
"name": "type",
"in": "formData",
"required": true,
"type": "string"
},
{
"description": "Media file (for multipart upload)",
"name": "file",
"in": "formData",
"type": "file"
},
{
"description": "Media URL (for JSON upload)",
"name": "url",
"in": "formData",
"type": "string"
},
{
"description": "Caption for the media",
"name": "caption",
"in": "formData",
"type": "string"
},
{
"description": "Custom message ID",
"name": "id",
"in": "formData",
"type": "string"
}
],
"responses": {
"200": {
"description": "success",
"schema": {
"$ref": "#/definitions/gin.H"
}
},
"400": {
"description": "Error on validation",
"schema": {
"$ref": "#/definitions/gin.H"
}
},
"500": {
"description": "Internal server error",
"schema": {
"$ref": "#/definitions/gin.H"
}
}
}
}
},
"/unlabel/message": {
"post": {
"description": "Remove label from message",
Expand Down Expand Up @@ -3198,6 +3359,42 @@ const docTemplate = `{
}
}
},
"github_com_Zapbox-API_evolution-go_pkg_sendMessage_service.StatusTextStruct": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text content of the status"
},
"id": {
"type": "string",
"description": "Custom message ID (optional)"
}
},
"required": ["text"]
},
"github_com_Zapbox-API_evolution-go_pkg_sendMessage_service.StatusMediaStruct": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "Media type: image or video"
},
"url": {
"type": "string",
"description": "URL of the media (for JSON upload)"
},
"caption": {
"type": "string",
"description": "Caption for the media"
},
"id": {
"type": "string",
"description": "Custom message ID (optional)"
}
},
"required": ["type"]
},
"github_com_Zapbox-API_evolution-go_pkg_user_service.CheckUserStruct": {
"type": "object",
"properties": {
Expand Down
3 changes: 2 additions & 1 deletion pkg/routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ func (r *Routes) AssignRoutes(eng *gin.Engine) {
routes.POST("/contact", r.jidValidationMiddleware.ValidateContactFields(), r.sendHandler.SendContact) // TODO: send multiple contacts
routes.POST("/button", r.jidValidationMiddleware.ValidateNumberFieldWithFormatJid(), r.sendHandler.SendButton)
routes.POST("/list", r.jidValidationMiddleware.ValidateNumberFieldWithFormatJid(), r.sendHandler.SendList)
// TODO: send status
routes.POST("/status/text", r.sendHandler.SendStatusText)
routes.POST("/status/media", r.sendHandler.SendStatusMedia)
}
}
routes = eng.Group("/user")
Expand Down
Loading