feat: announcement

This commit is contained in:
2026-06-24 17:56:51 +03:30
parent 91b9cbc09e
commit a63cefb80b
7 changed files with 141 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
meta {
name: delete announcement
type: http
seq: 6
}
delete {
url: {{baseUrl}}/announcements/:id
body: none
auth: inherit
}
params:path {
id: 1
}
settings {
encodeUrl: true
}
+8
View File
@@ -0,0 +1,8 @@
meta {
name: announcement
seq: 20
}
auth {
mode: inherit
}
+19
View File
@@ -0,0 +1,19 @@
meta {
name: get announcements
type: http
seq: 2
}
get {
url: {{baseUrl}}/announcements
body: none
auth: inherit
}
settings {
encodeUrl: true
}
docs {
Admin: all announcements, newest first.
}
+20
View File
@@ -0,0 +1,20 @@
meta {
name: latest announcement
type: http
seq: 1
}
get {
url: {{baseUrl}}/announcements/latest
body: none
auth: inherit
}
settings {
encodeUrl: true
}
docs {
App side: returns the single latest currently-active announcement
(start_date <= now <= end_date; null bounds are open-ended), or null.
}
+19
View File
@@ -0,0 +1,19 @@
meta {
name: show announcement
type: http
seq: 4
}
get {
url: {{baseUrl}}/announcements/:id
body: none
auth: inherit
}
params:path {
id: 1
}
settings {
encodeUrl: true
}
+26
View File
@@ -0,0 +1,26 @@
meta {
name: store announcement
type: http
seq: 3
}
post {
url: {{baseUrl}}/announcements
body: multipartForm
auth: inherit
}
body:multipart-form {
title: تخفیف ویژه
description: توضیح اعلان
link: https://example.com
start_date: 2026-06-24 00:00:00
end_date: 2026-07-24 00:00:00
~image: @file()
~image_id: 1
}
settings {
encodeUrl: true
timeout: 0
}
+30
View File
@@ -0,0 +1,30 @@
meta {
name: update announcement
type: http
seq: 5
}
post {
url: {{baseUrl}}/announcements/:id
body: multipartForm
auth: inherit
}
params:path {
id: 1
}
body:multipart-form {
title: عنوان جدید
description: توضیح جدید
link: https://example.com
start_date: 2026-06-24 00:00:00
end_date: 2026-07-24 00:00:00
~image: @file()
~image_id: 1
}
settings {
encodeUrl: true
timeout: 0
}