diff --git a/api/apib/army-management/squads.apib b/api/apib/army-management/squads.apib index 9656d4d..de2d2c4 100644 --- a/api/apib/army-management/squads.apib +++ b/api/apib/army-management/squads.apib @@ -59,3 +59,47 @@ Create a new squad + Response 201 + 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 diff --git a/api/apib/army-management/users.apib b/api/apib/army-management/users.apib index 799954c..f6c7381 100644 --- a/api/apib/army-management/users.apib +++ b/api/apib/army-management/users.apib @@ -48,7 +48,7 @@ Get single army member information Create a new army member -+ Request Create new army member (application/json) ++ Request (application/json) + Attributes + username: `[GNC]Paolo` (string, required) - display name of the user @@ -64,7 +64,7 @@ Update an army member, identified by its id + Parameters + id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member -+ Request Create Entry with Title (application/json) ++ Request (application/json) + Attributes + _id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member diff --git a/api/apib/dredd/data/logVehicle.json b/api/apib/dredd/data/logVehicle.json new file mode 100644 index 0000000..e69de29 diff --git a/api/apib/dredd/data/squad.json b/api/apib/dredd/data/squad.json index 8e568d0..5ebfaf2 100644 --- a/api/apib/dredd/data/squad.json +++ b/api/apib/dredd/data/squad.json @@ -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":"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} diff --git a/api/apib/dredd/data/user.json b/api/apib/dredd/data/user.json index 7d0906a..e84e3e5 100644 --- a/api/apib/dredd/data/user.json +++ b/api/apib/dredd/data/user.json @@ -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":"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} diff --git a/api/apib/dredd/populate-data.sh b/api/apib/dredd/populate-data.sh index 0232f00..341b67d 100755 --- a/api/apib/dredd/populate-data.sh +++ b/api/apib/dredd/populate-data.sh @@ -14,7 +14,7 @@ cd $(dirname $0) # 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[@]}" do diff --git a/api/apib/mongo-test-data/tets-data-extract.sh b/api/apib/mongo-test-data/tets-data-extract.sh deleted file mode 100755 index e857ff1..0000000 --- a/api/apib/mongo-test-data/tets-data-extract.sh +++ /dev/null @@ -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