diff --git a/groupAPI.yaml b/groupAPI.yaml new file mode 100644 index 0000000..c144344 --- /dev/null +++ b/groupAPI.yaml @@ -0,0 +1,359 @@ +swagger: "2.0" +info: + description: "これはCosmosのgroupAPIです" + version: "1.0.0" + title: "Group API" + termsOfService: "http://swagger.io/terms/" + contact: + email: "s1671045@s.konan-u.ac.jp" + license: + name: "Apache 2.0" + url: "http://www.apache.org/licenses/LICENSE-2.0.html" +paths: + /cosmos/groups: + get: + summary: "グループ取得" + description: "所属する全てのグループの情報" + consumes: + - "multipart/form-data" + parameters: + - name: "uId" + in: "query" + description: "取得したいユーザーのID" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/groupList" + post: + summary: "グループ作成" + description: "新規グループを作成" + consumes: + - "multipart/form-data" + parameters: + - 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" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $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: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/delete" + /cosmos/groups/{groupId}/members: + get: + summary: "メンバー情報" + description: "指定されたグループのメンバーの情報" + parameters: + - name: "groupId" + in: "path" + description: "取得したいグループのID" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/membersInfo" + post: + summary: "グループにメンバー追加" + description: "指定したグループにメンバーを追加" + consumes: + - "multipart/form-data" + parameters: + - name: "groupId" + in: "path" + description: "取得したいグループのID" + required: true + type: "string" + - name: "uId" + in: "formData" + description: "追加したいメンバーのuId" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/membersInfo" + delete: + summary: "グループからメンバーを削除" + description: "指定したグループから指定したメンバーを削除" + consumes: + - "multipart/form-data" + parameters: + - name: "groupId" + in: "path" + description: "取得したいグループのID" + required: true + type: "string" + - name: "uId" + in: "formData" + description: "削除したいメンバーのuId" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/membersInfo" + /cosmos/groups/{groupId}/requests: + get: + summary: "リクエスト情報の取得" + description: "指定したグループのリクエストの情報を取得" + parameters: + - name: "groupId" + in: "path" + description: "取得したいグループのID" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/requestsInfo" + post: + summary: "リクエストの発行" + description: "指定したグループにリクエスト発行" + consumes: + - "multipart/form-data" + parameters: + - name: "groupId" + in: "path" + description: "リクエスト発行先グループのID" + required: true + type: "string" + - name: "uId" + in: "formData" + description: "発行者ID" + required: true + type: "string" + - name: "product" + in: "formData" + description: "商品名" + required: true + type: "string" + - name: "deadline" + in: "formData" + description: "期限(日にち)" + required: false + type: "string" + format: "date" + - name: "location" + in: "formData" + description: "場所の業種コード" + required: false + type: "integer" + format: "int64" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/requestInfo" + put: + summary: "リクエストの変更" + description: "指定したグループにリクエスト変更" + consumes: + - "multipart/form-data" + parameters: + - name: "groupId" + in: "path" + description: "リクエスト変更先グループのID" + required: true + type: "string" + - name: "uId" + in: "formData" + description: "発行者ID" + required: true + type: "string" + - name: "product" + in: "formData" + description: "商品名" + required: true + type: "string" + - name: "deadline" + in: "formData" + description: "期限(日にち)" + required: false + type: "string" + format: "date" + - name: "location" + in: "formData" + description: "場所の業種コード" + required: false + type: "integer" + format: "int64" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/requestInfo" + /cosmos/groups/{groupId}/requests/{requestId}: + get: + summary: "リクエスト情報の詳細を取得" + description: "指定したグループの指定したリクエストの情報を取得" + parameters: + - name: "groupId" + in: "path" + description: "(指定したい)グループのID" + required: true + type: "string" + - name: "requestId" + in: "path" + description: "取得したいリクエストのID" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/requestDetail" + delete: + summary: "リクエストの削除" + description: "指定したグループの指定したリクエストを削除" + parameters: + - name: "groupId" + in: "path" + description: "(指定したい)グループのID" + required: true + type: "string" + - name: "requestId" + in: "path" + description: "削除したいリクエストのID" + required: true + type: "string" + responses: + 200: + description: "成功時のレスポンス" + schema: + $ref: "#/definitions/delete" + +definitions: + groupInfo: + type: "object" + properties: + gId: + type: "string" + 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: "string" + 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: [] + requestInfo: + type: "object" + properties: + requests: + type: "object" + example: {"rId":"123456789","uri":"http://123456789.com"} + requestsInfo: + type: "object" + properties: + requests: + type: "object" + example: [{"rId":"123456789","uri":"http://123456789.com"},{"rId":"987654321","uri":"http://987654321.com"}] + groupList: + type: "object" + properties: + groups: + type: "object" + example: [{"gId":"123456789","uri":"http://123456789.com"},{"gId":"987654321","uri":"http://987654321.com"}] + requestDetail: + type: "object" + properties: + request: + type: "object" + example: { + "rId":"123456789", + "date":"2019/04/16/15:00:00", + "issuer":{ + "userId":"123456789", + "URI":"https://123456789.com" + }, + "product":"Object1", + "deadline":"2019/04/16", + "location":"YOLPのID", + "done":false + } + delete: + type: "object" + properties: + massage: + type: "string" + example: "Already Deleted" + error: + type: "object" + properties: + massage: + type: "string" + example: "Not Found"