jupiter0913 commited on
Commit ·
78967a7
1
Parent(s): 1a24c7c
feature(#194): update response data format with lower case...
Browse files
Brain/src/rising_plugin/gmail/email_plugin.py
CHANGED
|
@@ -219,12 +219,12 @@ class EmailPlugin:
|
|
| 219 |
|
| 220 |
messages.append(
|
| 221 |
{
|
| 222 |
-
"
|
| 223 |
-
"
|
| 224 |
-
"
|
| 225 |
-
"
|
| 226 |
-
"
|
| 227 |
-
"
|
| 228 |
}
|
| 229 |
)
|
| 230 |
|
|
@@ -232,12 +232,12 @@ class EmailPlugin:
|
|
| 232 |
if not messages:
|
| 233 |
messages.append(
|
| 234 |
{
|
| 235 |
-
"
|
| 236 |
-
"
|
| 237 |
-
"
|
| 238 |
-
"
|
| 239 |
-
"
|
| 240 |
-
"
|
| 241 |
}
|
| 242 |
)
|
| 243 |
return json.dumps(messages)
|
|
|
|
| 219 |
|
| 220 |
messages.append(
|
| 221 |
{
|
| 222 |
+
"from": from_address,
|
| 223 |
+
"to": to_address,
|
| 224 |
+
"date": date,
|
| 225 |
+
"cc": cc,
|
| 226 |
+
"subject": subject,
|
| 227 |
+
"body": body,
|
| 228 |
}
|
| 229 |
)
|
| 230 |
|
|
|
|
| 232 |
if not messages:
|
| 233 |
messages.append(
|
| 234 |
{
|
| 235 |
+
"from": "",
|
| 236 |
+
"to": "",
|
| 237 |
+
"date": "",
|
| 238 |
+
"cc": "",
|
| 239 |
+
"subject": "",
|
| 240 |
+
"body": "There are no Emails",
|
| 241 |
}
|
| 242 |
)
|
| 243 |
return json.dumps(messages)
|
Brain/src/router/email_router.py
CHANGED
|
@@ -30,12 +30,12 @@ def construct_blueprint_email_api() -> APIRouter:
|
|
| 30 |
|
| 31 |
@generator.response(
|
| 32 |
status_code=200, schema={"message": "message", "result": [{
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"
|
| 38 |
-
"
|
| 39 |
}]}
|
| 40 |
)
|
| 41 |
|
|
|
|
| 30 |
|
| 31 |
@generator.response(
|
| 32 |
status_code=200, schema={"message": "message", "result": [{
|
| 33 |
+
"from": "testfrom@test.com",
|
| 34 |
+
"to": "test@gmail.com",
|
| 35 |
+
"date": "Tue, 04 Jul 2023 12:55:19 +0000",
|
| 36 |
+
"cc": "",
|
| 37 |
+
"subject": "subject",
|
| 38 |
+
"body": "message"
|
| 39 |
}]}
|
| 40 |
)
|
| 41 |
|