rework of the API, added /api/post, /api/getPosts

This commit is contained in:
leca 2023-11-17 01:16:34 +03:00
parent 2c58b4626f
commit f8c42fd0c3
1 changed files with 8 additions and 0 deletions

8
manager.sh Normal file → Executable file
View File

@ -9,6 +9,8 @@ print_help() {
echo "./manager.sh create_thread [boardId] [threadTitle] [content] <isLocked> <isPinned> <options>"
echo "./manager.sh get_boards"
echo "./manager.sh get_threads [boardId]"
echo "./manager.sh post [options] [content] [threadId] [boardId]"
echo "./manager.sh get_posts [boardId] [threadId]"
}
curl_post() {
@ -38,6 +40,12 @@ case $ACTION in
"get_threads")
curl_get /api/getThreads/${2}
;;
"post")
curl_post '{"options":"'${2}'","content":"'${3}'","threadId":"'${4}'","boardId":"'${5}'"}' ${BASE_URL}/api/post
;;
"get_posts")
curl_get /api/getPosts/${2}/${3}
;;
*)
print_help
;;