Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 789d038c

Přidáno uživatelem Ondřej Váně před asi 4 roky(ů)

Re #7914: Zobrazení celého dokumentu na FE

- přidání modelové třídy pro přijímaní obrázku z BE
- úprava query service

Zobrazit rozdíly:

fe/fulltextsearch/src/app/components/pages/browse/browse-details/browse-details.component.ts
19 19
    this.documentName = Utils.getStringAfterLastChar(this.router.url, '/');
20 20

  
21 21
    this.service.getDocumentPictureByName(this.documentName).subscribe( documentPicture => {
22
          this.source.push('data:image/png;base64,' + documentPicture);
22
          this.source.push('data:image/png;base64,' + documentPicture.documentPicture);
23 23
      });
24 24
  }
25 25

  
fe/fulltextsearch/src/app/model/DocumentDetailResponse.ts
1
export class DocumentDetailResponse {
2
  public documentPicture: string;
3
}
fe/fulltextsearch/src/app/services/query/query.service.ts
4 4
import { DocumentResponse } from '../../model/DocumentResponse';
5 5
import { SearchResponse } from '../../model/SearchResponse';
6 6
import { SearchRequest } from '../../model/SearchRequest';
7
import { DocumentDetailResponse } from '../../model/DocumentDetailResponse';
7 8

  
8 9
const httpOptions = {
9 10
  headers: new HttpHeaders( {
......
41 42
    return this.httpClient.get<DocumentResponse[]>(this.backendUrl + this.documentsUrl, httpOptions);
42 43
  }
43 44

  
44
  getDocumentPictureByName(documentName: string): Observable<string> {
45
    return this.httpClient.get<string>(this.backendUrl + this.documentsUrl + '/' + documentName, httpOptions);
45
  getDocumentPictureByName(documentName: string): Observable<DocumentDetailResponse> {
46
    return this.httpClient.get<DocumentDetailResponse>(this.backendUrl + this.documentsUrl + '/' + documentName, httpOptions);
46 47
  }
47 48

  
48 49
}

Také k dispozici: Unified diff