Finish squad apib docs

pull/32/head
HardiReady 2018-03-30 12:53:49 +02:00
parent e547155e4c
commit 37860fd115
7 changed files with 50 additions and 24 deletions

View File

@ -59,3 +59,47 @@ Create a new squad
+ Response 201 + Response 201
+ Attributes (User, fixed-type) + Attributes (User, fixed-type)
### Update Squad [PATCH /squads/{id}]
Update squad, identified by its id
+ Parameters
+ id: `5abe166f8b7488392a623f12` (string, required) - unique id of the squad
+ Request (multipart/form-data; boundary=---BOUNDARY)
-----BOUNDARY
Content-Disposition: form-data; name="name"
Content-Type: text/plain
test-CSAT
-----BOUNDARY
Content-Disposition: form-data; name="fraction"
Content-Type: text/plain
OPFOR
-----BOUNDARY
Content-Disposition: form-data; name="image"; filename="image.jpg"
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a
HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy
MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAABAAEDASIA
AhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEB
AAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AL+AD//Z
-----BOUNDARY--
+ Response 200
+ Attributes (Squad, fixed-type)
### Delete Squad [DELETE /squads/{id}]
Delete a squad
+ Parameters
+ id: `5abe16f98b7488392a623f17` (string, required) - unique id of the squad
+ Response 204

View File

@ -48,7 +48,7 @@ Get single army member information
Create a new army member Create a new army member
+ Request Create new army member (application/json) + Request (application/json)
+ Attributes + Attributes
+ username: `[GNC]Paolo` (string, required) - display name of the user + username: `[GNC]Paolo` (string, required) - display name of the user
@ -64,7 +64,7 @@ Update an army member, identified by its id
+ Parameters + Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member + id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
+ Request Create Entry with Title (application/json) + Request (application/json)
+ Attributes + Attributes
+ _id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member + _id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member

View File

View File

@ -1 +1,3 @@
{"_id":{"$oid":"5aba54eaeadcce6332c6a774"},"sortingNumber":0,"name":"Alpha","fraction":"BLUFOR","timestamp":{"$date":"2018-03-27T14:27:54.399Z"},"updatedAt":{"$date":"2018-03-27T14:27:54.399Z"},"__v":0} {"_id":{"$oid":"5aba54eaeadcce6332c6a774"},"sortingNumber":0,"name":"Alpha","fraction":"BLUFOR","timestamp":{"$date":"2018-03-27T14:27:54.399Z"},"updatedAt":{"$date":"2018-03-27T14:27:54.399Z"},"__v":0}
{"_id":{"$oid":"5abe166f8b7488392a623f12"},"sortingNumber":0,"name":"Führungsstab","fraction":"OPFOR","timestamp":{"$date":"2018-03-30T10:50:23.121Z"},"updatedAt":{"$date":"2018-03-30T10:50:23.121Z"},"__v":0}
{"_id":{"$oid":"5abe16f98b7488392a623f17"},"sortingNumber":4,"name":"Bravo","fraction":"BLUFOR","timestamp":{"$date":"2018-03-30T10:52:41.396Z"},"updatedAt":{"$date":"2018-03-30T10:52:41.396Z"},"__v":0}

View File

@ -1,2 +1,2 @@
{"_id":{"$oid":"5abd4780396bc0487068be0e"},"rankLvl":0,"squadId":null,"username":"KalleK","timestamp":{"$date":"2018-03-29T20:07:28.960Z"},"updatedAt":{"$date":"2018-03-29T20:07:28.960Z"},"__v":0}
{"_id":{"$oid":"5ab68d42f547ed304064e5f7"},"rankLvl":0,"squadId":{"$oid":"5aba54eaeadcce6332c6a774"},"username":"hardiready","updatedAt":{"$date":"2018-03-27T14:28:04.533Z"},"__v":0} {"_id":{"$oid":"5ab68d42f547ed304064e5f7"},"rankLvl":0,"squadId":{"$oid":"5aba54eaeadcce6332c6a774"},"username":"hardiready","updatedAt":{"$date":"2018-03-27T14:28:04.533Z"},"__v":0}
{"_id":{"$oid":"5abd4780396bc0487068be0e"},"rankLvl":0,"squadId":null,"username":"KalleK","timestamp":{"$date":"2018-03-29T20:07:28.960Z"},"updatedAt":{"$date":"2018-03-29T20:07:28.960Z"},"__v":0}

View File

@ -14,7 +14,7 @@
cd $(dirname $0) cd $(dirname $0)
# array of available collection names # array of available collection names
col=(app_user awarding campaign decoration logBudget logFlag logKill logPoints logRespawn logRevive logTransport player promotion rank squad user war ) col=(app_user awarding campaign decoration logBudget logFlag logKill logPoints logRespawn logRevive logTransport logVehicle player promotion rank squad user war )
for i in "${col[@]}" for i in "${col[@]}"
do do

View File

@ -1,20 +0,0 @@
#!/usr/bin/env bash
# execute script in its location folder
cd $(dirname $0)
DB_NAME="cc-test"
# array of available collection names
col=(app_user awarding campaign decoration logBudget logFlag logKill logPoints logRespawn logRevive logTransport logVehicle player promotion rank squad user war)
for i in "${col[@]}"
do
if [ "$1" == "import" ]
then
mongoimport --quiet --db ${DB_NAME} --collection $i --drop --file ${i}.json
else
echo -e "$(date "+%Y-%m-%dT%T.%3N%z")\tTable: ${i}"
mongoexport --db ${DB_NAME} --collection $i --out ${i}.json;
fi
done