This commit is contained in:
crusader 2017-06-30 20:50:58 +09:00
parent e72d731907
commit 2056461b7d
6 changed files with 76 additions and 12 deletions

View File

@ -10,7 +10,7 @@ import { ConnectedRouter } from 'react-router-redux';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import * as injectTapEventPlugin from 'react-tap-event-plugin'; 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 configureStore from 'config/configureStore';
import { sagas } from 'config/configureRedux'; import { sagas } from 'config/configureRedux';
@ -27,7 +27,7 @@ const history = createHashHistory();
const store = configureStore(history, sagaMiddleware); const store = configureStore(history, sagaMiddleware);
function* app(): any { function* app(): any {
const appContainer = yield system.getAppContainer('react-placeholder'); const appContainer: HTMLElement = yield Platform.getAppContainer('react-placeholder');

View File

@ -0,0 +1,13 @@
class Client {
private wss: WebSocket;
}
export interface Protocol {
serviceName: string;
methodName: string;
params?: string[];
}
export default Client;

View 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;

View 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;

View File

@ -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;
}

View File

@ -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;
}
} }