diff --git a/src/ts/app/index.tsx b/src/ts/app/index.tsx index f542924..2f23386 100644 --- a/src/ts/app/index.tsx +++ b/src/ts/app/index.tsx @@ -10,7 +10,7 @@ import { ConnectedRouter } from 'react-router-redux'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import * as injectTapEventPlugin from 'react-tap-event-plugin'; -import * as system from 'commons/util/system'; +import Platform from 'commons/platform'; import configureStore from 'config/configureStore'; import { sagas } from 'config/configureRedux'; @@ -27,7 +27,7 @@ const history = createHashHistory(); const store = configureStore(history, sagaMiddleware); function* app(): any { - const appContainer = yield system.getAppContainer('react-placeholder'); + const appContainer: HTMLElement = yield Platform.getAppContainer('react-placeholder'); diff --git a/src/ts/commons/api/Client.ts b/src/ts/commons/api/Client.ts new file mode 100644 index 0000000..de07fea --- /dev/null +++ b/src/ts/commons/api/Client.ts @@ -0,0 +1,13 @@ +class Client { + private wss: WebSocket; + + +} + +export interface Protocol { + serviceName: string; + methodName: string; + params?: string[]; +} + +export default Client; diff --git a/src/ts/commons/api/Service.ts b/src/ts/commons/api/Service.ts new file mode 100644 index 0000000..9ff2088 --- /dev/null +++ b/src/ts/commons/api/Service.ts @@ -0,0 +1,15 @@ + +abstract class Service { + private name: string; + protected constructor(name: string) { + this.name = name; + } + + protected send(methodName: string, params?: string[] | string): Promise { + return new Promise(resolve => { + resolve(''); + }); + } +} + +export default Service; diff --git a/src/ts/commons/platform/index.ts b/src/ts/commons/platform/index.ts new file mode 100644 index 0000000..a77284f --- /dev/null +++ b/src/ts/commons/platform/index.ts @@ -0,0 +1,14 @@ +abstract class Platform { + + public static * getAppContainer(containerId: string): IterableIterator> { + const appContainer = yield new Promise(resolve => { + document.addEventListener('DOMContentLoaded', () => { + resolve(document.getElementById(containerId)); + }); + }); + + return appContainer; + } +} + +export default Platform; diff --git a/src/ts/commons/util/system/index.ts b/src/ts/commons/util/system/index.ts deleted file mode 100644 index 4debd13..0000000 --- a/src/ts/commons/util/system/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export function* getAppContainer(containerId: string): any { - const appContainer = yield new Promise(resolve => { - document.addEventListener('DOMContentLoaded', () => { - resolve(document.getElementById(containerId)); - }); - }); - - return appContainer; -} diff --git a/src/ts/member/api/service/MemberService.ts b/src/ts/member/api/service/MemberService.ts index f8956cb..e5bd6c3 100644 --- a/src/ts/member/api/service/MemberService.ts +++ b/src/ts/member/api/service/MemberService.ts @@ -1,3 +1,34 @@ -export class MemberService { +import Service from 'commons/api/Service'; +import Member from '../model/Member'; + +export class MemberService extends Service { + + public constructor() { + super('MemberService'); + } + + public signin(signinId: string, signinPw: string): Member { + this.send('signin'); + return null; + } + public signout(member: Member): Member { + + return null; + } + + public signup(member: Member): Member { + + return null; + } + + public read(id: number): Member { + + return null; + } + + public withdrawal(id: number): Member { + + return null; + } }