added Timestamp Feature

This commit is contained in:
2022-10-22 22:45:51 +10:00
parent 4f8765840a
commit 5d93130970
13 changed files with 2112 additions and 87 deletions

View File

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

View 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('Отправляю картинку сервисом...');
}
}

View 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();
});
});