ing
This commit is contained in:
parent
e72d731907
commit
2056461b7d
|
@ -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');
|
||||
|
||||
|
||||
|
||||
|
|
13
src/ts/commons/api/Client.ts
Normal file
13
src/ts/commons/api/Client.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
class Client {
|
||||
private wss: WebSocket;
|
||||
|
||||
|
||||
}
|
||||
|
||||
export interface Protocol {
|
||||
serviceName: string;
|
||||
methodName: string;
|
||||
params?: string[];
|
||||
}
|
||||
|
||||
export default Client;
|
15
src/ts/commons/api/Service.ts
Normal file
15
src/ts/commons/api/Service.ts
Normal file
|
@ -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<string> {
|
||||
return new Promise<string>(resolve => {
|
||||
resolve('');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default Service;
|
14
src/ts/commons/platform/index.ts
Normal file
14
src/ts/commons/platform/index.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
abstract class Platform {
|
||||
|
||||
public static * getAppContainer(containerId: string): IterableIterator<Promise<HTMLElement>> {
|
||||
const appContainer = yield new Promise<HTMLElement>(resolve => {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
resolve(document.getElementById(containerId));
|
||||
});
|
||||
});
|
||||
|
||||
return appContainer;
|
||||
}
|
||||
}
|
||||
|
||||
export default Platform;
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user