From 1fb44fdb5fe7d5ef07e2718c8f360ff17c1861bd Mon Sep 17 00:00:00 2001 From: crusader Date: Sat, 23 Dec 2017 04:45:55 +0900 Subject: [PATCH] ing --- package.json | 2 - .../commons/core/reflect/accessible_object.ts | 6 +-- .../commons/core/reflect/annotated_element.ts | 4 +- .../@overflow/commons/core/reflect/class.ts | 9 ++-- .../commons/core/reflect/class_constructor.ts | 19 -------- .../commons/core/reflect/constructor.ts | 17 ++++++++ .../commons/core/reflect/executable.ts | 10 ++--- .../@overflow/commons/core/reflect/field.ts | 8 ++-- .../@overflow/commons/core/reflect/index.ts | 2 +- .../@overflow/commons/core/reflect/member.ts | 6 +-- .../@overflow/commons/core/reflect/method.ts | 6 +-- .../commons/core/reflect/parameter.ts | 6 +-- .../commons/redux/decorators/index.ts | 1 + .../commons/redux/decorators/parameter.ts | 43 +++++++++++++++++++ .../modules/member/reducer/member_reducer.ts | 8 +++- 15 files changed, 89 insertions(+), 58 deletions(-) delete mode 100644 src/ts/@overflow/commons/core/reflect/class_constructor.ts create mode 100644 src/ts/@overflow/commons/core/reflect/constructor.ts create mode 100644 src/ts/@overflow/commons/redux/decorators/parameter.ts diff --git a/package.json b/package.json index 12184b8..d532a3c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "stats": "set NODE_ENV=production && webpack --progress --config ./config/webpack/webpack.config.stats.js --profile --json > ./config/webpack/stats/stats.json" }, "devDependencies": { - "@types/auth0-lock": "^10.16.2", "@types/history": "^4.6.2", "@types/jest": "^21.1.8", "@types/lodash": "^4.14.91", @@ -74,7 +73,6 @@ "webpack-visualizer-plugin": "^0.1.11" }, "dependencies": { - "auth0-lock": "^10.24.1", "history": "^4.7.2", "immutable": "^3.8.2", "inversify": "^4.9.0", diff --git a/src/ts/@overflow/commons/core/reflect/accessible_object.ts b/src/ts/@overflow/commons/core/reflect/accessible_object.ts index ae7c4f1..b16dc31 100644 --- a/src/ts/@overflow/commons/core/reflect/accessible_object.ts +++ b/src/ts/@overflow/commons/core/reflect/accessible_object.ts @@ -3,10 +3,8 @@ import { TypeUtil, } from '@overflow/commons/core/type'; -import { - AnnotatedElement, - Annotation, - } from '@overflow/commons/core/reflect'; +import {AnnotatedElement} from './annotated_element'; +import {Annotation} from './annotation'; export abstract class AccessibleObject implements AnnotatedElement { private _annotations: Map; diff --git a/src/ts/@overflow/commons/core/reflect/annotated_element.ts b/src/ts/@overflow/commons/core/reflect/annotated_element.ts index a5dcc17..a5cff15 100644 --- a/src/ts/@overflow/commons/core/reflect/annotated_element.ts +++ b/src/ts/@overflow/commons/core/reflect/annotated_element.ts @@ -2,9 +2,7 @@ import { ClassType, } from '@overflow/commons/core/type'; -import { - Annotation, -} from '@overflow/commons/core/reflect'; +import {Annotation} from './annotation'; export interface AnnotatedElement { _addAnnotation(annotation: AnnotationType): void; diff --git a/src/ts/@overflow/commons/core/reflect/class.ts b/src/ts/@overflow/commons/core/reflect/class.ts index cc32232..1ab6c39 100644 --- a/src/ts/@overflow/commons/core/reflect/class.ts +++ b/src/ts/@overflow/commons/core/reflect/class.ts @@ -4,11 +4,10 @@ import { Metadata, } from '@overflow/commons/core/type'; -import { - AccessibleObject, - Field, - Method, -} from '@overflow/commons/core/reflect'; +import {AccessibleObject} from './accessible_object'; +import {Constructor} from './constructor'; +import {Field} from './field'; +import {Method} from './method'; export class Class extends AccessibleObject { private _clazzType: ClassType; diff --git a/src/ts/@overflow/commons/core/reflect/class_constructor.ts b/src/ts/@overflow/commons/core/reflect/class_constructor.ts deleted file mode 100644 index c2fa1ce..0000000 --- a/src/ts/@overflow/commons/core/reflect/class_constructor.ts +++ /dev/null @@ -1,19 +0,0 @@ -// import { -// PropertyKeyType, -// } from '@overflow/commons/core/type'; - -// import { -// Class, -// Executable, -// } from '@overflow/commons/core/reflect'; - -// export class Constructor extends Executable { - -// public constructor(declaringClazz: Class, parameterTypes: any[]) { -// super(declaringClazz, parameterTypes); -// } - -// public getName(): PropertyKeyType { -// return ''; -// } -// } diff --git a/src/ts/@overflow/commons/core/reflect/constructor.ts b/src/ts/@overflow/commons/core/reflect/constructor.ts new file mode 100644 index 0000000..0911051 --- /dev/null +++ b/src/ts/@overflow/commons/core/reflect/constructor.ts @@ -0,0 +1,17 @@ +import { + PropertyKeyType, +} from '@overflow/commons/core/type'; + +import {Class} from './class'; +import {Executable} from './executable'; + +export class Constructor extends Executable { + + public constructor(declaringClazz: Class, parameterTypes: any[]) { + super(declaringClazz, parameterTypes); + } + + public getName(): PropertyKeyType { + return ''; + } +} diff --git a/src/ts/@overflow/commons/core/reflect/executable.ts b/src/ts/@overflow/commons/core/reflect/executable.ts index 74c582f..6f22c66 100644 --- a/src/ts/@overflow/commons/core/reflect/executable.ts +++ b/src/ts/@overflow/commons/core/reflect/executable.ts @@ -2,12 +2,10 @@ import { PropertyKeyType, } from '@overflow/commons/core/type'; -import { - AccessibleObject, - Class, - Member, - Parameter, - } from '@overflow/commons/core/reflect'; +import {AccessibleObject} from './accessible_object'; +import {Class} from './class'; +import {Member} from './member'; +import {Parameter} from './parameter'; export abstract class Executable extends AccessibleObject implements Member { private _clazz: Class; diff --git a/src/ts/@overflow/commons/core/reflect/field.ts b/src/ts/@overflow/commons/core/reflect/field.ts index af6687a..b387f19 100644 --- a/src/ts/@overflow/commons/core/reflect/field.ts +++ b/src/ts/@overflow/commons/core/reflect/field.ts @@ -2,11 +2,9 @@ import { PropertyKeyType, } from '@overflow/commons/core/type'; -import { - AccessibleObject, - Class, - Member, - } from '@overflow/commons/core/reflect'; +import {AccessibleObject} from './accessible_object'; +import {Class} from './class'; +import {Member} from './member'; export class Field extends AccessibleObject implements Member { private _clazz: Class; diff --git a/src/ts/@overflow/commons/core/reflect/index.ts b/src/ts/@overflow/commons/core/reflect/index.ts index 572a209..9e03cf6 100644 --- a/src/ts/@overflow/commons/core/reflect/index.ts +++ b/src/ts/@overflow/commons/core/reflect/index.ts @@ -1,7 +1,7 @@ export * from './accessible_object'; export * from './annotated_element'; export * from './annotation'; -export * from './class_constructor'; +export * from './constructor'; export * from './class'; export * from './executable'; export * from './field'; diff --git a/src/ts/@overflow/commons/core/reflect/member.ts b/src/ts/@overflow/commons/core/reflect/member.ts index 055a61a..883477e 100644 --- a/src/ts/@overflow/commons/core/reflect/member.ts +++ b/src/ts/@overflow/commons/core/reflect/member.ts @@ -1,11 +1,9 @@ -import { - Class, -} from '@overflow/commons/core/reflect'; - import { PropertyKeyType, } from '@overflow/commons/core/type'; +import {Class} from './class'; + export interface Member { getDeclaringClass(): Class; getName(): PropertyKeyType; diff --git a/src/ts/@overflow/commons/core/reflect/method.ts b/src/ts/@overflow/commons/core/reflect/method.ts index c1ca432..8fed933 100644 --- a/src/ts/@overflow/commons/core/reflect/method.ts +++ b/src/ts/@overflow/commons/core/reflect/method.ts @@ -2,10 +2,8 @@ import { PropertyKeyType, } from '@overflow/commons/core/type'; -import { - Class, - Executable, - } from '@overflow/commons/core/reflect'; +import {Class} from './class'; +import {Executable} from './executable'; export class Method extends Executable { private _name: PropertyKeyType; diff --git a/src/ts/@overflow/commons/core/reflect/parameter.ts b/src/ts/@overflow/commons/core/reflect/parameter.ts index 6d8d02d..b5c4690 100644 --- a/src/ts/@overflow/commons/core/reflect/parameter.ts +++ b/src/ts/@overflow/commons/core/reflect/parameter.ts @@ -1,7 +1,5 @@ -import { - AccessibleObject, - Executable, -} from '@overflow/commons/core/reflect'; +import {AccessibleObject} from './accessible_object'; +import {Executable} from './executable'; export class Parameter extends AccessibleObject { private _executable: Executable; diff --git a/src/ts/@overflow/commons/redux/decorators/index.ts b/src/ts/@overflow/commons/redux/decorators/index.ts index e05e0ee..1a99ebd 100644 --- a/src/ts/@overflow/commons/redux/decorators/index.ts +++ b/src/ts/@overflow/commons/redux/decorators/index.ts @@ -1,4 +1,5 @@ export * from './action_mapping'; +export * from './parameter'; export * from './reducer'; export * from './rest_api'; export * from './rpc_api'; diff --git a/src/ts/@overflow/commons/redux/decorators/parameter.ts b/src/ts/@overflow/commons/redux/decorators/parameter.ts new file mode 100644 index 0000000..56b3807 --- /dev/null +++ b/src/ts/@overflow/commons/redux/decorators/parameter.ts @@ -0,0 +1,43 @@ +import { + Annotation, +} from '@overflow/commons/core/reflect'; + +import { + PropertyKeyType, + TypeUtil, +} from '@overflow/commons/core/type'; + +import { + Decorator, +} from '@overflow/commons/decorator'; + +export interface ParameterAnnotationAttributes { + name?: string; +} + +export class ParameterAnnotation implements Annotation { + public readonly attributes: ParameterAnnotationAttributes; + + public constructor(name: string | ParameterAnnotationAttributes) { + if (undefined === name) { + this.attributes = { + name: '', + }; + return; + } + + if (TypeUtil.isString(name)) { + this.attributes = { + name: name, + }; + } else { + this.attributes = name; + } + } + + public parameterDecorator?(target: Object, propertyKey: PropertyKeyType, parameterIndex: number): void { + console.log('Parameter'); + } +} + +export const Parameter = Decorator.create(ParameterAnnotation); diff --git a/src/ts/@overflow/modules/member/reducer/member_reducer.ts b/src/ts/@overflow/modules/member/reducer/member_reducer.ts index 2e9d6fd..6a684ab 100644 --- a/src/ts/@overflow/modules/member/reducer/member_reducer.ts +++ b/src/ts/@overflow/modules/member/reducer/member_reducer.ts @@ -1,5 +1,6 @@ import { ActionMapping, + Parameter, Reducer, RestAPI, } from '@overflow/commons/redux/decorators'; @@ -7,12 +8,17 @@ import { @Reducer() @ActionMapping('@overflow/modules/member/MemberReducer') export default class MemberReducer { + private name: string; + public constructor(@Parameter() name: string) { + this.name = name; + } + /** * signin */ @RestAPI('/account/signin') @ActionMapping('/signin') - public signin(state: any, result: any, error: any): any { + public signin(state: any, @Parameter() result: any, error: any): any { return state; }