Compare commits

..

No commits in common. "049c52485f183001182c79121de60e12fbfd0406" and "cda7e389080096389d27efa082cd5029f244ff9d" have entirely different histories.

13 changed files with 86 additions and 2111 deletions

View File

@ -1,10 +1,6 @@
{
"ExpandedNodes": [
"",
"\\src",
"\\src\\app",
"\\src\\app\\boards",
"\\src\\app\\services"
""
],
"PreviewInSolutionExplorer": false
}

Binary file not shown.

2111
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,12 +18,7 @@
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"dotenv": "^16.0.3",
"minio": "^7.0.32",
"nestjs-minio-client": "^2.0.0",
"path": "^0.12.7",
"rxjs": "~7.5.0",
"stream": "^0.0.2",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
@ -32,7 +27,6 @@
"@angular/cli": "~14.2.6",
"@angular/compiler-cli": "^14.2.0",
"@types/jasmine": "~4.0.0",
"@types/minio": "^7.0.14",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",

View File

@ -3,7 +3,6 @@ import { BrowserModule } from '@angular/platform-browser';
import { Routes, RouterModule } from '@angular/router';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { AboutComponent } from './about/about.component';
@ -13,7 +12,6 @@ import { ApiChatService } from './services/api-chat.service';
import { FormsModule } from '@angular/forms';
import { SendPostComponent } from './send-post/send-post.component';
import { PostComponent } from './boards/post/post.component'
import { MinIoService } from "./services/min-io.service.";
const appRoutes: Routes = [
{ path: '', component: HomeComponent },
@ -38,10 +36,7 @@ const appRoutes: Routes = [
HttpClientModule,
FormsModule
],
providers: [
ApiChatService,
MinIoService
],
providers: [ApiChatService],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@ -1,5 +1,5 @@
<div class="post">
<img src="http://static.vdk2ch.ru:15555/test-public/оладий.jpg" alt="anonpls" width="140"> # {{post.Id}}
<h3>{{post.Timestamp}}</h3>
<h3>{{post.Date}}</h3>
<h2>{{post.Text}}</h2>
</div>

View File

@ -12,7 +12,7 @@ import { SinglePost } from '../../models/post';
export class PostComponent implements OnInit {
@Input() post: SinglePost
@Input() post: SinglePost
ngOnInit(): void {
}

View File

@ -1,5 +1,5 @@
export interface SinglePost {
Timestamp: string
Date: string
Id: number
Text: string

View File

@ -4,6 +4,4 @@
<p>
<button (click)="sendPost(textToPost.value)">Отправить</button>
</p>
<h1>Загрузить картинку:</h1>
<input type="file" (change)="sendPic($event)">
</div>

View File

@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ApiChatService } from '../services/api-chat.service';
import { MinIoService } from '../services/min-io.service.'
@Component({
selector: 'app-send-post',
@ -9,16 +8,13 @@ import { MinIoService } from '../services/min-io.service.'
})
export class SendPostComponent implements OnInit {
constructor(public apiChatService: ApiChatService, public minIoService: MinIoService) {
constructor(public apiChatService: ApiChatService) {
}
sendPost(text: string) {
this.apiChatService.sendPostToApi(text).subscribe();
}
sendPic(event: any) {
this.minIoService.SendPicture(event);
}
ngOnInit(): void {
}

View File

@ -12,19 +12,17 @@ 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://localhost:7141/List/');
return this.http.get<SinglePost[]>('http://api.vdk2ch.ru:5000/List/');
}
sendPostToApi(text: string) {
console.log("Отправляю пост...");
var postToSend =
{
Timestamp: text,
Date: Date,
Id: 0,
Text: text
}
//return this.http.post('http://api.vdk2ch.ru:5000/PostTo', postToSend)
return this.http.post('http://localhost:7141/PostTo', postToSend)
return this.http.post('http://api.vdk2ch.ru:5000/PostTo', postToSend)
}
}

View File

@ -1,25 +0,0 @@
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

@ -1,16 +0,0 @@
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();
});
});