feat: announcement
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
meta {
|
||||||
|
name: announcement
|
||||||
|
seq: 20
|
||||||
|
}
|
||||||
|
|
||||||
|
auth {
|
||||||
|
mode: inherit
|
||||||
|
}
|
||||||
@@ -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.
|
||||||
|
}
|
||||||
@@ -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.
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user