added Timestamp Feature
This commit is contained in:
		| @@ -12,17 +12,19 @@ export class ApiChatService { | ||||
|  | ||||
|   getPosts(): Observable<SinglePost[]> { | ||||
|     console.log("Получаю данные из сервиса"); | ||||
|     return this.http.get<SinglePost[]>('http://api.vdk2ch.ru:5000/List/'); | ||||
|     //return this.http.get<SinglePost[]>('http://api.vdk2ch.ru:5000/List/'); | ||||
|     return this.http.get<SinglePost[]>('http://localhost:7141/List/'); | ||||
|   } | ||||
|  | ||||
|     sendPostToApi(text: string) { | ||||
|     console.log("Отправляю пост..."); | ||||
|     var postToSend = | ||||
|     { | ||||
|       Date: Date, | ||||
|       Timestamp: text, | ||||
|       Id: 0, | ||||
|       Text: text | ||||
|     } | ||||
|       return this.http.post('http://api.vdk2ch.ru:5000/PostTo', postToSend) | ||||
|       //return this.http.post('http://api.vdk2ch.ru:5000/PostTo', postToSend) | ||||
|       return this.http.post('http://localhost:7141/PostTo', postToSend) | ||||
|   } | ||||
| } | ||||
|   | ||||
							
								
								
									
										25
									
								
								src/app/services/min-io.service..ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								src/app/services/min-io.service..ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| import { Injectable } from '@angular/core'; | ||||
| import { HttpClient } from "@angular/common/http"; | ||||
| import * as Minio from 'minio'; | ||||
|  | ||||
|  | ||||
| @Injectable({ | ||||
|   providedIn: 'root' | ||||
| }) | ||||
| export class MinIoService { | ||||
|   picToSend = null; | ||||
|  | ||||
|  | ||||
|  | ||||
|   constructor(private http: HttpClient) { | ||||
|  | ||||
|   } | ||||
|  | ||||
|   SendPicture(event: any): void { | ||||
|     console.log(event.target.files[0].name); | ||||
|     console.log('Отправляю картинку сервисом...'); | ||||
|  | ||||
|   } | ||||
|  | ||||
|  | ||||
| } | ||||
							
								
								
									
										16
									
								
								src/app/services/min-io.service.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/app/services/min-io.service.spec.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| import { TestBed } from '@angular/core/testing'; | ||||
|  | ||||
| import { MinIoService } from './min-io.service.'; | ||||
|  | ||||
| describe('MinIoServiceService', () => { | ||||
|   let service: MinIoService; | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     TestBed.configureTestingModule({}); | ||||
|     service = TestBed.inject(MinIoService); | ||||
|   }); | ||||
|  | ||||
|   it('should be created', () => { | ||||
|     expect(service).toBeTruthy(); | ||||
|   }); | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user