Improve doc
This commit is contained in:
		@@ -1,7 +1,8 @@
 | 
				
			|||||||
import $ from 'cafy';
 | 
					import $ from 'cafy';
 | 
				
			||||||
import define from '../../../define';
 | 
					import define from '../../../define';
 | 
				
			||||||
import perUserFollowingChart from '../../../../../services/chart/per-user-following';
 | 
					import perUserFollowingChart, { perUserFollowingLogSchema } from '../../../../../services/chart/per-user-following';
 | 
				
			||||||
import ID, { transform } from '../../../../../misc/cafy-id';
 | 
					import ID, { transform } from '../../../../../misc/cafy-id';
 | 
				
			||||||
 | 
					import { convertLog } from '../../../../../services/chart';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const meta = {
 | 
					export const meta = {
 | 
				
			||||||
	stability: 'stable',
 | 
						stability: 'stable',
 | 
				
			||||||
@@ -38,12 +39,7 @@ export const meta = {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	res: {
 | 
						res: convertLog(perUserFollowingLogSchema),
 | 
				
			||||||
		type: 'array',
 | 
					 | 
				
			||||||
		items: {
 | 
					 | 
				
			||||||
			type: 'object',
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default define(meta, async (ps) => {
 | 
					export default define(meta, async (ps) => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,56 +2,90 @@ import autobind from 'autobind-decorator';
 | 
				
			|||||||
import Chart, { Obj } from './';
 | 
					import Chart, { Obj } from './';
 | 
				
			||||||
import Following from '../../models/following';
 | 
					import Following from '../../models/following';
 | 
				
			||||||
import { IUser, isLocalUser } from '../../models/user';
 | 
					import { IUser, isLocalUser } from '../../models/user';
 | 
				
			||||||
 | 
					import { SchemaType } from '../../misc/schema';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					export const logSchema = {
 | 
				
			||||||
 * ユーザーごとのフォローに関するチャート
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
type PerUserFollowingLog = {
 | 
					 | 
				
			||||||
	local: {
 | 
					 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * フォローしている
 | 
						 * フォローしている
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	followings: {
 | 
						followings: {
 | 
				
			||||||
 | 
							type: 'object' as 'object',
 | 
				
			||||||
 | 
							properties: {
 | 
				
			||||||
			/**
 | 
								/**
 | 
				
			||||||
			 * 合計
 | 
								 * フォローしている合計
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			total: number;
 | 
								total: {
 | 
				
			||||||
 | 
									type: 'number',
 | 
				
			||||||
 | 
									description: 'フォローしている合計',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/**
 | 
								/**
 | 
				
			||||||
			 * フォローした数
 | 
								 * フォローした数
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			inc: number;
 | 
								inc: {
 | 
				
			||||||
 | 
									type: 'number',
 | 
				
			||||||
 | 
									description: 'フォローした数',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/**
 | 
								/**
 | 
				
			||||||
			 * フォロー解除した数
 | 
								 * フォロー解除した数
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			dec: number;
 | 
								dec: {
 | 
				
			||||||
		};
 | 
									type: 'number',
 | 
				
			||||||
 | 
									description: 'フォロー解除した数',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * フォローされている
 | 
						 * フォローされている
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	followers: {
 | 
						followers: {
 | 
				
			||||||
 | 
							type: 'object' as 'object',
 | 
				
			||||||
 | 
							properties: {
 | 
				
			||||||
			/**
 | 
								/**
 | 
				
			||||||
			 * 合計
 | 
								 * フォローされている合計
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			total: number;
 | 
								total: {
 | 
				
			||||||
 | 
									type: 'number',
 | 
				
			||||||
 | 
									description: 'フォローされている合計',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/**
 | 
								/**
 | 
				
			||||||
			 * フォローされた数
 | 
								 * フォローされた数
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			inc: number;
 | 
								inc: {
 | 
				
			||||||
 | 
									type: 'number',
 | 
				
			||||||
 | 
									description: 'フォローされた数',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/**
 | 
								/**
 | 
				
			||||||
			 * フォロー解除された数
 | 
								 * フォロー解除された数
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			dec: number;
 | 
								dec: {
 | 
				
			||||||
		};
 | 
									type: 'number',
 | 
				
			||||||
 | 
									description: 'フォロー解除された数',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	remote: PerUserFollowingLog['local'];
 | 
					export const perUserFollowingLogSchema = {
 | 
				
			||||||
 | 
						type: 'object' as 'object',
 | 
				
			||||||
 | 
						properties: {
 | 
				
			||||||
 | 
							local: {
 | 
				
			||||||
 | 
								type: 'object' as 'object',
 | 
				
			||||||
 | 
								properties: logSchema
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							remote: {
 | 
				
			||||||
 | 
								type: 'object' as 'object',
 | 
				
			||||||
 | 
								properties: logSchema
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type PerUserFollowingLog = SchemaType<typeof perUserFollowingLogSchema>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PerUserFollowingChart extends Chart<PerUserFollowingLog> {
 | 
					class PerUserFollowingChart extends Chart<PerUserFollowingLog> {
 | 
				
			||||||
	constructor() {
 | 
						constructor() {
 | 
				
			||||||
		super('perUserFollowing', true);
 | 
							super('perUserFollowing', true);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user