Skip to content

Commit c0fe9a3

Browse files
committed
docs: update examples
1 parent af4d052 commit c0fe9a3

File tree

9 files changed

+20
-8
lines changed

9 files changed

+20
-8
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
POST http://localhost:8080/api/v1/mail HTTP/1.1
1+
POST http://localhost:8080/api/v1/emails HTTP/1.1
22
Content-Type: application/json
33

44
{
@@ -7,6 +7,6 @@ Content-Type: application/json
77
88
"bcc":"user4example.com",
99
"subject":"hello",
10-
"data": "{\"nome\": \"Mr. Winston\"}",
11-
"template": "template1"
10+
"data": "{\"name\": \"Mr. Winston\"}",
11+
"template": "a73c2bdd-51ef-456c-96b8-73784dcbc961"
1212
}

examples/rest/email/readEmail.http

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Get email by id
2+
GET http://localhost:8080/api/v1/emails/7d8b85fd-8b7b-40f6-bc47-e03e89eebbeb HTTP/1.1
3+
4+
### Get all emails
5+
GET http://localhost:8080/api/v1/emails HTTP/1.1

examples/rest/email/trackEmail.http

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Track email by id
2+
GET http://localhost:8080/api/v1/images/mail/myservice/2600ea1e-5bdf-4e6d-9508-20c1ead9adec HTTP/1.1

examples/rest/getLogs.http

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/rest/log/readLogs.http

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Get log by email id
2+
GET http://localhost:8080/api/v1/logs/7d8b85fd-8b7b-40f6-bc47-e03e89eebbeb HTTP/1.1
3+
4+
### Get all logs
5+
GET http://localhost:8080/api/v1/logs HTTP/1.1

examples/rest/readEmail.http

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/rest/template/createTemplate.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Content-Type: application/json
44

55
{
66
"name": "hello world",
7-
"template": "\u003ch1\u003eHello, world! \u003c/h1\u003e"
7+
"template": "\u003ch1\u003eHello, \u007b\u007b.name\u007d\u007d! \u003c/h1\u003e"
88
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#update template
2-
PUT http://localhost:8080/api/v1/templates/a61823d5-189a-445b-a0f2-540563cd6436 HTTP/1.1
2+
PUT http://localhost:8080/api/v1/templates/1d86b58c-5176-43bd-a31b-44c87e3b5570 HTTP/1.1
33
Content-Type: application/json
44

55
{
66
"name": "hello world",
7-
"template": "\u003ch1\u003eHello, world! \u003c/h1\u003e"
7+
"template": "\u003ch1\u003eHello, \u007b\u007b.name\u007d\u007d! \u003c/h1\u003e"
88
}

internal/pkg/restmodel/email.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
type Emails []Email
88

99
type Email struct {
10+
ID string `json:"id"`
1011
Service string `json:"service"`
1112
To string `json:"to"`
1213
Cc string `json:"cc"`
@@ -50,6 +51,7 @@ func (e *EmailsCount) FromStorageModel(storageItems []storagemodel.Email, count
5051
}
5152

5253
func (e *Email) FromStorageModel(storageItem *storagemodel.Email) {
54+
e.ID = storageItem.ID
5355
e.Service = storageItem.Service
5456
e.To = storageItem.To
5557
e.Cc = storageItem.Cc

0 commit comments

Comments
 (0)