1 namespace app.services {
2 export class APIEndPoint {
4 private $resource: ng.resource.IResourceService;
6 constructor($resource: ng.resource.IResourceService) {
7 this.$resource = $resource;
10 private resource(endPoint: string) {
12 * setting custom action
14 var customAction: ng.resource.IActionDescriptor = {
19 return <declares.IResponseResource> this.$resource(endPoint, {}, { customAction: customAction});
22 public getOptionControlFile(command: string): ng.resource.IResource<declares.IResponse> {
23 var endPoint = '/api/optionControlFile/' + command;
24 return <declares.IResponseOption>this.resource(endPoint).get();
27 public getFiles(fileId: string): ng.resource.IResource<declares.IResponse> {
28 var endPoint = '/api/v1/workspace';
31 endPoint += '/' + fileId;
33 return <declares.IResponseFileInfo>this.resource(endPoint).get();