Skip to content
Snippets Groups Projects
Commit 7a607079 authored by Kawtar Laariche's avatar Kawtar Laariche
Browse files

#22: add license profile to shared data service

parent 74d5f4e7
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
UserDetails, UserDetails,
} from 'src/app/shared/models'; } from 'src/app/shared/models';
import { CreateRatingRequestPayload } from 'src/app/shared/models/request-payloads'; import { CreateRatingRequestPayload } from 'src/app/shared/models/request-payloads';
import { MessageStatusModel } from 'src/app/shared/models/message-status.model';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
...@@ -123,7 +124,7 @@ export class PrivateCatalogsService { ...@@ -123,7 +124,7 @@ export class PrivateCatalogsService {
); );
} }
uploadFileToUrl( uploadExistingModelLicenseProfile(
loginUserID: string, loginUserID: string,
solutionId: string, solutionId: string,
revisionId: string, revisionId: string,
...@@ -141,8 +142,6 @@ export class PrivateCatalogsService { ...@@ -141,8 +142,6 @@ export class PrivateCatalogsService {
revisionId + revisionId +
'/' + '/' +
versionId; versionId;
const uploadUrl =
'https://dev02.ki-lab.nrw/api/license/upload/9b36ce33-ec9c-48e3-964f-5fd7e75ede6c/620ec698-4027-414a-8b9f-8d6503cbf35b/86e0f4fd-694a-4ba2-ba9f-bb3db1dc850f/1.0.0';
const formData = new FormData(); const formData = new FormData();
formData.append('file', file); formData.append('file', file);
...@@ -155,6 +154,24 @@ export class PrivateCatalogsService { ...@@ -155,6 +154,24 @@ export class PrivateCatalogsService {
return this.http.request(req); return this.http.request(req);
} }
uploadNewModelLicenseProfile(userId: string, file: File) {
const url =
apiConfig.apiBackendURL +
'/api/model/upload/' +
userId +
'/?licUploadFlag=' +
true;
const formData = new FormData();
formData.append('file', file);
const req = new HttpRequest('POST', url, formData, {
reportProgress: true,
responseType: 'json',
});
return this.http.request(req);
}
createUpdateLicenseProfile( createUpdateLicenseProfile(
loginUserID: string, loginUserID: string,
solutionId: string, solutionId: string,
...@@ -452,4 +469,62 @@ export class PrivateCatalogsService { ...@@ -452,4 +469,62 @@ export class PrivateCatalogsService {
}), }),
); );
} }
addCatalog(
userId: string,
solutionName: string,
dockerUrl: string,
): Observable<string> {
const urlCreateFavorite =
apiConfig.apiBackendURL + apiConfig.urlAddToCatalog + '/' + userId;
const addToReqObj = {
request_body: {
name: solutionName,
dockerfileURI: dockerUrl,
},
};
return this._httpSharedService
.post(urlCreateFavorite, undefined, addToReqObj)
.pipe(
map((res) => res.response_detail),
catchError((error) => {
throw error;
}),
);
}
uploadProtoBufFile(file: File) {
const url =
apiConfig.apiBackendURL + '/api/proto/upload/' + '?protoUploadFlag=true';
const formData = new FormData();
formData.append('file', file);
const req = new HttpRequest('POST', url, formData, {
reportProgress: true,
responseType: 'json',
});
return this.http.request(req);
}
getMessagingStatus(
userId: string,
trackId: string,
): Observable<MessageStatusModel[]> {
const url =
apiConfig.apiBackendURL +
apiConfig.urlMessagingStatus +
'/' +
userId +
'/' +
trackId;
return this._httpSharedService.post(url, undefined).pipe(
map((res) => res.response_body),
catchError((error) => {
throw error;
}),
);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment