import { Injectable } from '@angular/core';
import {Observable} from 'rxjs';
import {Tutorial} from '../models/tutorial.model';
import {HttpClient} from '@angular/common/http';
import {Image} from '../models/image';
import {SpinnerService} from './spinner.service';



@Injectable({
  providedIn: 'root'
})


export class ZhipuaiImageService {
  baseUrl : string = 'http://localhost:8080/api/zhipuai';

  constructor(private http: HttpClient,public spinnerService: SpinnerService) {

  }

  generate(query: String): Observable<Image> {
    return this.http.get(`${(this.baseUrl)}/image/${query}`);
  }
}
