From 13e4034ceee1e3983c852a2c40ce89eeb30dcecd Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 15 Dec 2017 00:54:28 +0900 Subject: [PATCH] :v: --- src/web/docs/api/entities/post.pug | 149 ---------------------------- src/web/docs/api/entities/user.yaml | 137 +++++++++++++++++++++++++ src/web/docs/api/gulpfile.ts | 2 +- 3 files changed, 138 insertions(+), 150 deletions(-) delete mode 100644 src/web/docs/api/entities/post.pug create mode 100644 src/web/docs/api/entities/user.yaml diff --git a/src/web/docs/api/entities/post.pug b/src/web/docs/api/entities/post.pug deleted file mode 100644 index 954f172717..0000000000 --- a/src/web/docs/api/entities/post.pug +++ /dev/null @@ -1,149 +0,0 @@ -extend ../../BASE - -block title - | Entity: Post - -block content - h1 Post - p 投稿を表します。 - - section - h2 Properties - table.entity - thead: tr - td Name - td Type - td Description - tbody - tr.nullable.optional - td app - td: a(href='./app', target='_blank') App - td 投稿したアプリ - tr.nullable - td app_id - td ID - td 投稿したアプリのID - tr - td created_at - td Date - td 投稿日時 - tr - td id - td ID - td 投稿ID - tr.optional - td is_liked - td Boolean - td いいね したかどうか - tr - td likes_count - td Number - td いいね数 - tr.nullable.optional - td media_ids - td ID[] - td 添付されたメディアのIDの配列 - tr.nullable.optional - td media - td: a(href='./drive-file', target='_blank') DriveFile[] - td 添付されたメディアの配列 - tr - td replies_count - td Number - td 返信数 - tr.optional - td reply - td: a(href='./post', target='_blank') Post - td 返信先の投稿 - tr.nullable - td reply_id - td ID - td 返信先の投稿のID - tr.optional - td repost - td: a(href='./post', target='_blank') Post - td Repostした投稿 - tr - td repost_count - td Number - td Repostされた数 - tr.nullable - td repost_id - td ID - td Repostした投稿のID - tr.nullable - td text - td String - td 本文 - tr.optional - td user - td: a(href='./user', target='_blank') User - td 投稿者 - tr - td user_id - td ID - td 投稿者のID - - section - h2 Example - pre: code. - { - "created_at": "2016-12-10T00:28:50.114Z", - "media_ids": null, - "reply_id": "584a16b15860fc52320137e3", - "repost_id": null, - "text": "小日向美穂だぞ!", - "user_id": "5848bf7764e572683f4402f8", - "app_id": null, - "likes_count": 1, - "replies_count": 1, - "id": "584b4c42d8e5186f8f755d0c", - "user": { - "birthday": null, - "created_at": "2016-12-08T02:03:35.332Z", - "bio": "女が嫌いです、女性は好きです", - "followers_count": 11, - "following_count": 11, - "links": null, - "location": "", - "name": "女が嫌い", - "posts_count": 26, - "likes_count": 2, - "liked_count": 20, - "username": "onnnagakirai", - "id": "5848bf7764e572683f4402f8", - "avatar_url": "https://file.himasaku.net/5848c0ec64e572683f4402fc", - "banner_url": "https://file.himasaku.net/5848c12864e572683f4402fd", - "is_following": true, - "is_followed": true - }, - "reply": { - "created_at": "2016-12-09T02:28:01.563Z", - "media_ids": null, - "reply_id": "5849d35e547e4249be329884", - "repost_id": null, - "text": "アイコン小日向美穂?", - "user_id": "57d01a501fdf2d07be417afe", - "app_id": null, - "replies_count": 1, - "id": "584a16b15860fc52320137e3", - "user": { - "birthday": null, - "created_at": "2016-09-07T13:46:56.605Z", - "bio": "どうすれば君だけのために生きていけるの", - "followers_count": 51, - "following_count": 97, - "links": null, - "location": "川崎", - "name": "きな子", - "posts_count": 4813, - "username": "syuilo", - "likes_count": 3141, - "liked_count": 750, - "id": "57d01a501fdf2d07be417afe", - "avatar_url": "https://file.himasaku.net/583ddc6e64df272771f74c1a", - "banner_url": "https://file.himasaku.net/584bfc82d8e5186f8f755ec5" - } - }, - "is_liked": true - } diff --git a/src/web/docs/api/entities/user.yaml b/src/web/docs/api/entities/user.yaml new file mode 100644 index 0000000000..9b1efd1fe6 --- /dev/null +++ b/src/web/docs/api/entities/user.yaml @@ -0,0 +1,137 @@ +name: "User" + +desc: + ja: "ユーザー。" + en: "A user." + +props: + - name: "id" + type: "id" + optional: false + desc: + ja: "ユーザーID" + en: "The ID of this user" + - name: "created_at" + type: "date" + optional: false + desc: + ja: "アカウント作成日時" + en: "The registered date of this user" + - name: "username" + type: "string" + optional: false + desc: + ja: "ユーザー名" + en: "The username of this user" + - name: "description" + type: "string" + optional: false + desc: + ja: "アカウントの説明(自己紹介)" + en: "The description of this user" + - name: "avatar_id" + type: "id(DriveFile)" + optional: true + desc: + ja: "アバターのID" + en: "The ID of the avatar of this user" + - name: "avatar_url" + type: "string" + optional: false + desc: + ja: "アバターのURL" + en: "The URL of the avatar of this user" + - name: "banner_id" + type: "id(DriveFile)" + optional: true + desc: + ja: "バナーのID" + en: "The ID of the banner of this user" + - name: "banner_url" + type: "string" + optional: false + desc: + ja: "バナーのURL" + en: "The URL of the banner of this user" + - name: "followers_count" + type: "number" + optional: false + desc: + ja: "フォロワーの数" + en: "The number of the followers for this user" + - name: "following_count" + type: "number" + optional: false + desc: + ja: "フォローしているユーザーの数" + en: "The number of the following users for this user" + - name: "last_used_at" + type: "date" + optional: false + desc: + ja: "最終利用日時" + en: "The last used date of this user" + - name: "posts_count" + type: "number" + optional: false + desc: + ja: "投稿の数" + en: "The number of the posts of this user" + - name: "pinned_post" + type: "entity(Post)" + optional: true + desc: + ja: "ピン留めされた投稿" + en: "The pinned post of this user" + - name: "pinned_post_id" + type: "id(Post)" + optional: true + desc: + ja: "ピン留めされた投稿のID" + en: "The ID of the pinned post of this user" + - name: "drive_capacity" + type: "number" + optional: false + desc: + ja: "ドライブの容量(bytes)" + en: "The capacity of drive of this user (bytes)" + - name: "twitter" + type: "object" + optional: true + desc: + ja: "連携されているTwitterアカウント情報" + en: "The info of the connected twitter account of this user" + defName: "twitter" + def: + - name: "user_id" + type: "string" + optional: false + desc: + ja: "ユーザーID" + en: "The user ID" + - name: "screen_name" + type: "string" + optional: false + desc: + ja: "ユーザー名" + en: "The screen name of this user" + - name: "profile" + type: "object" + optional: false + desc: + ja: "プロフィール" + en: "The profile of this user" + defName: "profile" + def: + - name: "location" + type: "string" + optional: true + desc: + ja: "場所" + en: "The location of this user" + - name: "birthday" + type: "string" + optional: true + desc: + ja: "誕生日 (YYYY-MM-DD)" + en: "The birthday of this user (YYYY-MM-DD)" diff --git a/src/web/docs/api/gulpfile.ts b/src/web/docs/api/gulpfile.ts index 05567b6233..6453996d31 100644 --- a/src/web/docs/api/gulpfile.ts +++ b/src/web/docs/api/gulpfile.ts @@ -77,7 +77,7 @@ const extractDefs = params => { } }); - return defs; + return sortParams(defs); }; gulp.task('doc:api', [