2016-04-26 21:10:05 +08:00
|
|
|
///<reference path="../../browser.d.ts"/>
|
|
|
|
|
|
|
|
import {Injectable} from 'angular2/core';
|
2016-05-01 00:01:54 +08:00
|
|
|
import {NetworkService} from "../model/network/network.service.ts";
|
2016-04-26 21:10:05 +08:00
|
|
|
import {Http} from "angular2/http";
|
2016-05-02 03:30:43 +08:00
|
|
|
import {Message} from "../../../common/entities/Message";
|
|
|
|
import {User} from "../../../common/entities/User";
|
2016-04-26 21:10:05 +08:00
|
|
|
|
|
|
|
@Injectable()
|
2016-05-02 03:30:43 +08:00
|
|
|
export class AdminService extends NetworkService{
|
2016-04-26 21:10:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
constructor(_http:Http){
|
|
|
|
super(_http);
|
|
|
|
}
|
|
|
|
|
2016-05-02 03:30:43 +08:00
|
|
|
public createUser(user:User): Promise<Message<string>>{
|
|
|
|
return this.putJson("/user",{newUser:user});
|
2016-04-26 21:10:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|