[DEV] update the upload of cover

This commit is contained in:
Edouard DUPIN 2022-05-17 23:58:58 +02:00
parent 5e0bcc37f5
commit b4d280039d
6 changed files with 10 additions and 10 deletions

View File

@ -53,11 +53,11 @@ public class SeasonResource {
@Path("{id}/add_cover")
@Consumes({MediaType.MULTIPART_FORM_DATA})
public Response uploadCover(@PathParam("id") Long id,
@FormDataParam("file_name") String file_name,
@FormDataParam("fileName") String fileName,
@FormDataParam("file") InputStream fileInputStream,
@FormDataParam("file") FormDataContentDisposition fileMetaData
) {
return NodeInterface.uploadCover(typeInNode, id, file_name, fileInputStream, fileMetaData);
return NodeInterface.uploadCover(typeInNode, id, fileName, fileInputStream, fileMetaData);
}
@GET
@Path("{id}/rm_cover/{cover_id}")

View File

@ -53,11 +53,11 @@ public class UniverseResource {
@Path("{id}/add_cover")
@Consumes({MediaType.MULTIPART_FORM_DATA})
public Response uploadCover(@PathParam("id") Long id,
@FormDataParam("file_name") String file_name,
@FormDataParam("fileName") String fileName,
@FormDataParam("file") InputStream fileInputStream,
@FormDataParam("file") FormDataContentDisposition fileMetaData
) {
return NodeInterface.uploadCover(typeInNode, id, file_name, fileInputStream, fileMetaData);
return NodeInterface.uploadCover(typeInNode, id, fileName, fileInputStream, fileMetaData);
}
@GET
@Path("{id}/rm_cover/{cover_id}")

View File

@ -98,7 +98,7 @@ public class UserResource {
@GET
@Path("{id}")
@RolesAllowed("USER")
public UserExtern getUser(@Context SecurityContext sc, @PathParam("id") long userId) {
public UserExtern getUsers(@Context SecurityContext sc, @PathParam("id") long userId) {
System.out.println("getUser " + userId);
GenericContext gc = (GenericContext) sc.getUserPrincipal();
System.out.println("===================================================");

View File

@ -166,7 +166,7 @@ export class SeriesService {
coverId:number) {
let self = this;
return new Promise((resolve, reject) => {
self.http.getSpecific(`${this.serviceName }/${ nodeId }/rm_cover`, coverId)
self.http.getSpecific(`${this.serviceName}/${nodeId}/rm_cover`, coverId)
.then((response) => {
let data = response;
if(data === null || data === undefined) {
@ -189,7 +189,7 @@ export class SeriesService {
formData.append('file', file);
let self = this;
return new Promise((resolve, reject) => {
self.http.uploadMultipart(`${this.serviceName }/${ nodeId }/add_cover/`, formData, progress)
self.http.uploadMultipart(`${this.serviceName }/${nodeId}/add_cover/`, formData, progress)
.then((response) => {
let data = response;
if(data === null || data === undefined) {

View File

@ -87,8 +87,8 @@ export class UniverseService {
nodeId:number,
progress:any = null) {
const formData = new FormData();
formData.append('file_name', file.name);
formData.append('node_id', nodeId.toString());
formData.append('fileName', file.name);
formData.append('nodeId', nodeId.toString());
formData.append('file', file);
let self = this;
return new Promise((resolve, reject) => {

View File

@ -118,7 +118,7 @@ export class VideoService {
progress:any = null) {
const formData = new FormData();
formData.append('fileName', file.name);
formData.append('typeId', mediaId.toString());
formData.append('id', mediaId.toString());
formData.append('file', file);
let self = this;
return new Promise((resolve, reject) => {