diff --git a/README.md b/README.md index 597ed01..22f8817 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ CosmosAPIGroup =============== +これはCosmosのgroupAPIです。 \ No newline at end of file diff --git a/groupAPI.yaml b/groupAPI.yaml index 8e89b70..5da21f2 100644 --- a/groupAPI.yaml +++ b/groupAPI.yaml @@ -1,23 +1,45 @@ swagger: "2.0" info: - description: "This is " + description: "これはCosmosのgroupAPIです" version: "1.0.0" - title: "Petstore API" + title: "Group API" termsOfService: "http://swagger.io/terms/" contact: - email: "apiteam@swagger.io" + email: "s1671045@s.konan-u.ac.jp" license: name: "Apache 2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" paths: - /pet/{petId}: - get: - summary: "ペット情報API" - description: "指定されたpetIdの情報を返します" + /cosmos/groups: + post: + summary: "グループ作成" + description: "新規グループを作成" + consumes: + - "multipart/form-data" parameters: - - name: "petId" + - name: "name" + in: "formData" + description: "新規グループの名前" + required: true + type: "string" + - name: "uId" + in: "formData" + description: "新規グループ作成者のuId" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/newGroupInfo" + /cosmos/groups/{groupId}: + get: + summary: "グループ情報API" + description: "指定されたグループの情報を返します" + parameters: + - name: "groupId" in: "path" - description: "取得したいペットのID" + description: "取得したいグループのID" required: true type: "integer" format: "int64" @@ -25,11 +47,117 @@ 200: description: "成功時のレスポンス" schema: - type: "object" - properties: - id: - type: "integer" - format: "int64" - name: - type: "string" - example: "doggie" \ No newline at end of file + $ref: "#/definitions/groupInfo" + 404: + description: "失敗時のレスポンス" + schema: + $ref: "#/definitions/error" + delete: + summary: "delete a group" + description: "指定されたグループを削除" + parameters: + - name: "groupId" + in: "path" + description: "削除したいグループのID" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/delete" + /cosmos/groups/{groupId}/members: + get: + summary: "メンバー情報" + description: "指定されたグループのメンバーの情報" + parameters: + - name: "groupId" + in: "path" + description: "取得したいグループのID" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/membersInfo" + post: + summary: "グループにメンバー追加" + description: "指定したグループにメンバーを追加" + consumes: + - "multipart/form-data" + parameters: + - name: "groupId" + in: "path" + description: "取得したいグループのID" + required: true + type: "integer" + format: "int64" + - name: "uId" + in: "formData" + description: "追加したいメンバーのuId" + required: true + type: "integer" + format: "int64" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/membersInfo" +definitions: + groupInfo: + type: "object" + properties: + gId: + type: "integer" + format: "int64" + uri: + type: "string" + example: "http://sample.com" + name: + type: "string" + example: "family" + members: + type: "object" + example: [{"uId":"123456789","uri":"http://123456789.com"},{"uId":"987654321","uri":"http://987654321.com"}] + requests: + type: "object" + example: [{"rId":"123456789","uri":"http://123456789.com"},{"rId":"987654321","uri":"http://987654321.com"}] + membersInfo: + type: "object" + properties: + members: + type: "object" + example: [{"uId":"123456789","uri":"http://123456789.com"},{"uId":"987654321","uri":"http://987654321.com"}] + newGroupInfo: + type: "object" + properties: + gId: + type: "integer" + format: "int64" + uri: + type: "string" + example: "http://sample.com" + name: + type: "string" + example: "family" + members: + type: "object" + example: [{"uId":"123456789","uri":"http://123456789.com"}] + requests: + type: "object" + example: [] + delete: + type: "object" + properties: + massage: + type: "string" + example: "Already Deleted" + error: + type: "object" + properties: + massage: + type: "string" + example: "Not Found"