Compare commits
2 Commits
73d9d947d8
...
031f5650e4
Author | SHA1 | Date | |
---|---|---|---|
031f5650e4 | |||
23feaadab3 |
22
back/pom.xml
22
back/pom.xml
@ -1,10 +1,10 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.kar</groupId>
|
<groupId>org.kar</groupId>
|
||||||
<artifactId>karusic</artifactId>
|
<artifactId>karusic</artifactId>
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
<properties>
|
<properties>
|
||||||
|
|
||||||
<maven.compiler.version>3.1</maven.compiler.version>
|
<maven.compiler.version>3.1</maven.compiler.version>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
@ -43,12 +43,12 @@
|
|||||||
<version>5.11.0</version>
|
<version>5.11.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
<version>5.11.0</version>
|
<version>5.11.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.revelc.code.formatter</groupId>
|
<groupId>net.revelc.code.formatter</groupId>
|
||||||
<artifactId>formatter-maven-plugin</artifactId>
|
<artifactId>formatter-maven-plugin</artifactId>
|
||||||
|
@ -72,7 +72,7 @@ public class WebLauncher {
|
|||||||
WebLauncher.LOGGER.info("[START] application wake UP");
|
WebLauncher.LOGGER.info("[START] application wake UP");
|
||||||
final WebLauncher launcher = new WebLauncher();
|
final WebLauncher launcher = new WebLauncher();
|
||||||
launcher.migrateDB();
|
launcher.migrateDB();
|
||||||
|
|
||||||
launcher.process();
|
launcher.process();
|
||||||
WebLauncher.LOGGER.info("end-configure the server & wait finish process:");
|
WebLauncher.LOGGER.info("end-configure the server & wait finish process:");
|
||||||
Thread.currentThread().join();
|
Thread.currentThread().join();
|
||||||
@ -89,7 +89,7 @@ public class WebLauncher {
|
|||||||
final ImageReader reader = readers.next();
|
final ImageReader reader = readers.next();
|
||||||
System.out.println("Reader: " + reader.getOriginatingProvider().getDescription(null));
|
System.out.println("Reader: " + reader.getOriginatingProvider().getDescription(null));
|
||||||
System.out.println("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
|
System.out.println("Reader CN: " + reader.getOriginatingProvider().getPluginClassName());
|
||||||
//ImageIO.deregisterServiceProvider(reader.getOriginatingProvider());
|
// ImageIO.deregisterServiceProvider(reader.getOriginatingProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
// List available Image Writers
|
// List available Image Writers
|
||||||
@ -103,7 +103,7 @@ public class WebLauncher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void process() throws InterruptedException {
|
public void process() throws InterruptedException {
|
||||||
|
|
||||||
ImageIO.scanForPlugins();
|
ImageIO.scanForPlugins();
|
||||||
plop("jpeg");
|
plop("jpeg");
|
||||||
plop("png");
|
plop("png");
|
||||||
@ -140,14 +140,14 @@ public class WebLauncher {
|
|||||||
// add jackson to be discover when we are ins standalone server
|
// add jackson to be discover when we are ins standalone server
|
||||||
rc.register(JacksonFeature.class);
|
rc.register(JacksonFeature.class);
|
||||||
// enable this to show low level request
|
// enable this to show low level request
|
||||||
//rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName());
|
// rc.property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, Level.WARNING.getName());
|
||||||
|
|
||||||
//System.out.println("Connect on the BDD:");
|
// System.out.println("Connect on the BDD:");
|
||||||
//System.out.println(" getDBHost: '" + ConfigVariable.getDBHost() + "'");
|
// System.out.println(" getDBHost: '" + ConfigVariable.getDBHost() + "'");
|
||||||
//System.out.println(" getDBPort: '" + ConfigVariable.getDBPort() + "'");
|
// System.out.println(" getDBPort: '" + ConfigVariable.getDBPort() + "'");
|
||||||
//System.out.println(" getDBLogin: '" + ConfigVariable.getDBLogin() + "'");
|
// System.out.println(" getDBLogin: '" + ConfigVariable.getDBLogin() + "'");
|
||||||
//System.out.println(" getDBPassword: '" + ConfigVariable.getDBPassword() + "'");
|
// System.out.println(" getDBPassword: '" + ConfigVariable.getDBPassword() + "'");
|
||||||
//System.out.println(" getDBName: '" + ConfigVariable.getDBName() + "'");
|
// System.out.println(" getDBName: '" + ConfigVariable.getDBName() + "'");
|
||||||
System.out.println(" ==> " + GlobalConfiguration.dbConfig);
|
System.out.println(" ==> " + GlobalConfiguration.dbConfig);
|
||||||
System.out.println("OAuth service " + getBaseURI());
|
System.out.println("OAuth service " + getBaseURI());
|
||||||
this.server = GrizzlyHttpServerFactory.createHttpServer(getBaseURI(), rc);
|
this.server = GrizzlyHttpServerFactory.createHttpServer(getBaseURI(), rc);
|
||||||
|
@ -20,13 +20,12 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class WebLauncherLocal extends WebLauncher {
|
public class WebLauncherLocal extends WebLauncher {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(WebLauncherLocal.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(WebLauncherLocal.class);
|
||||||
|
|
||||||
private WebLauncherLocal() {}
|
private WebLauncherLocal() {}
|
||||||
|
|
||||||
public static void generateObjects() throws Exception {
|
public static void generateObjects() throws Exception {
|
||||||
LOGGER.info("Generate APIs");
|
LOGGER.info("Generate APIs");
|
||||||
final List<Class<?>> listOfResources = List.of(AlbumResource.class, ArtistResource.class, Front.class,
|
final List<Class<?>> listOfResources = List.of(AlbumResource.class, ArtistResource.class, Front.class, GenderResource.class, HealthCheck.class, PlaylistResource.class, UserResource.class,
|
||||||
GenderResource.class, HealthCheck.class, PlaylistResource.class, UserResource.class,
|
|
||||||
TrackResource.class, DataResource.class, ProxyResource.class);
|
TrackResource.class, DataResource.class, ProxyResource.class);
|
||||||
final AnalyzeApi api = new AnalyzeApi();
|
final AnalyzeApi api = new AnalyzeApi();
|
||||||
api.addAllApi(listOfResources);
|
api.addAllApi(listOfResources);
|
||||||
@ -42,13 +41,13 @@ public class WebLauncherLocal extends WebLauncher {
|
|||||||
Thread.currentThread().join();
|
Thread.currentThread().join();
|
||||||
launcher.LOGGER.info("STOP the REST server:");
|
launcher.LOGGER.info("STOP the REST server:");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process() throws InterruptedException {
|
public void process() throws InterruptedException {
|
||||||
if (true) {
|
if (true) {
|
||||||
// for local test:
|
// for local test:
|
||||||
ConfigBaseVariable.apiAdress = "http://0.0.0.0:19080/karusic/api/";
|
ConfigBaseVariable.apiAdress = "http://0.0.0.0:19080/karusic/api/";
|
||||||
//ConfigBaseVariable.ssoAdress = "https://atria-soft.org/karso/api/";
|
// ConfigBaseVariable.ssoAdress = "https://atria-soft.org/karso/api/";
|
||||||
ConfigBaseVariable.dbPort = "3906";
|
ConfigBaseVariable.dbPort = "3906";
|
||||||
ConfigBaseVariable.testMode = "true";
|
ConfigBaseVariable.testMode = "true";
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import java.util.UUID;
|
|||||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||||
import org.kar.archidata.annotation.AsyncType;
|
import org.kar.archidata.annotation.AsyncType;
|
||||||
|
import org.kar.archidata.annotation.FormDataOptional;
|
||||||
import org.kar.archidata.annotation.TypeScriptProgress;
|
import org.kar.archidata.annotation.TypeScriptProgress;
|
||||||
import org.kar.archidata.dataAccess.DataAccess;
|
import org.kar.archidata.dataAccess.DataAccess;
|
||||||
import org.kar.archidata.dataAccess.addOn.AddOnDataJson;
|
import org.kar.archidata.dataAccess.addOn.AddOnDataJson;
|
||||||
@ -61,8 +62,7 @@ public class AlbumResource {
|
|||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Operation(description = "Update a specific album")
|
@Operation(description = "Update a specific album")
|
||||||
public Album patch(@PathParam("id") final Long id, @AsyncType(Album.class) final String jsonRequest)
|
public Album patch(@PathParam("id") final Long id, @AsyncType(Album.class) final String jsonRequest) throws Exception {
|
||||||
throws Exception {
|
|
||||||
DataAccess.updateWithJson(Album.class, id, jsonRequest);
|
DataAccess.updateWithJson(Album.class, id, jsonRequest);
|
||||||
return DataAccess.get(Album.class, id);
|
return DataAccess.get(Album.class, id);
|
||||||
}
|
}
|
||||||
@ -89,8 +89,7 @@ public class AlbumResource {
|
|||||||
@Path("{id}/track/{trackId}")
|
@Path("{id}/track/{trackId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Operation(description = "Remove a Track on a specific album")
|
@Operation(description = "Remove a Track on a specific album")
|
||||||
public Album removeTrack(@PathParam("id") final Long id, @PathParam("trackId") final Long trackId)
|
public Album removeTrack(@PathParam("id") final Long id, @PathParam("trackId") final Long trackId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnManyToMany.removeLink(Album.class, id, "track", trackId);
|
AddOnManyToMany.removeLink(Album.class, id, "track", trackId);
|
||||||
return DataAccess.get(Album.class, id);
|
return DataAccess.get(Album.class, id);
|
||||||
}
|
}
|
||||||
@ -101,11 +100,8 @@ public class AlbumResource {
|
|||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
@Operation(description = "Add a cover on a specific album")
|
@Operation(description = "Add a cover on a specific album")
|
||||||
@TypeScriptProgress
|
@TypeScriptProgress
|
||||||
public Album uploadCover(
|
public Album uploadCover(@PathParam("id") final Long id, @FormDataOptional @FormDataParam("uri") final String uri, @FormDataOptional @FormDataParam("file") final InputStream fileInputStream,
|
||||||
@PathParam("id") final Long id,
|
@FormDataOptional @FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
||||||
@FormDataParam("uri") final String uri,
|
|
||||||
@FormDataParam("file") final InputStream fileInputStream,
|
|
||||||
@FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
DataTools.uploadCoverFromUri(Album.class, id, uri);
|
DataTools.uploadCoverFromUri(Album.class, id, uri);
|
||||||
} else {
|
} else {
|
||||||
@ -118,8 +114,7 @@ public class AlbumResource {
|
|||||||
@Path("{id}/cover/{coverId}")
|
@Path("{id}/cover/{coverId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Operation(description = "Remove a cover on a specific album")
|
@Operation(description = "Remove a cover on a specific album")
|
||||||
public Album removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId)
|
public Album removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnDataJson.removeLink(Album.class, id, "covers", coverId);
|
AddOnDataJson.removeLink(Album.class, id, "covers", coverId);
|
||||||
return DataAccess.get(Album.class, id);
|
return DataAccess.get(Album.class, id);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import java.util.UUID;
|
|||||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||||
import org.kar.archidata.annotation.AsyncType;
|
import org.kar.archidata.annotation.AsyncType;
|
||||||
|
import org.kar.archidata.annotation.FormDataOptional;
|
||||||
import org.kar.archidata.annotation.TypeScriptProgress;
|
import org.kar.archidata.annotation.TypeScriptProgress;
|
||||||
import org.kar.archidata.dataAccess.DataAccess;
|
import org.kar.archidata.dataAccess.DataAccess;
|
||||||
import org.kar.archidata.dataAccess.addOn.AddOnDataJson;
|
import org.kar.archidata.dataAccess.addOn.AddOnDataJson;
|
||||||
@ -55,8 +56,7 @@ public class ArtistResource {
|
|||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public Artist patch(@PathParam("id") final Long id, @AsyncType(Artist.class) final String jsonRequest)
|
public Artist patch(@PathParam("id") final Long id, @AsyncType(Artist.class) final String jsonRequest) throws Exception {
|
||||||
throws Exception {
|
|
||||||
DataAccess.updateWithJson(Artist.class, id, jsonRequest);
|
DataAccess.updateWithJson(Artist.class, id, jsonRequest);
|
||||||
return DataAccess.get(Artist.class, id);
|
return DataAccess.get(Artist.class, id);
|
||||||
}
|
}
|
||||||
@ -73,11 +73,8 @@ public class ArtistResource {
|
|||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
@TypeScriptProgress
|
@TypeScriptProgress
|
||||||
public Artist uploadCover(
|
public Artist uploadCover(@PathParam("id") final Long id, @FormDataOptional @FormDataParam("uri") final String uri, @FormDataOptional @FormDataParam("file") final InputStream fileInputStream,
|
||||||
@PathParam("id") final Long id,
|
@FormDataOptional @FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
||||||
@FormDataParam("uri") final String uri,
|
|
||||||
@FormDataParam("file") final InputStream fileInputStream,
|
|
||||||
@FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
DataTools.uploadCoverFromUri(Artist.class, id, uri);
|
DataTools.uploadCoverFromUri(Artist.class, id, uri);
|
||||||
} else {
|
} else {
|
||||||
@ -89,8 +86,7 @@ public class ArtistResource {
|
|||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}/cover/{coverId}")
|
@Path("{id}/cover/{coverId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public Artist removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId)
|
public Artist removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
LOGGER.error("klmlmkmlkmlklmklmk");
|
LOGGER.error("klmlmkmlkmlklmklmk");
|
||||||
AddOnDataJson.removeLink(Artist.class, id, "covers", coverId);
|
AddOnDataJson.removeLink(Artist.class, id, "covers", coverId);
|
||||||
return DataAccess.get(Artist.class, id);
|
return DataAccess.get(Artist.class, id);
|
||||||
|
@ -7,6 +7,7 @@ import java.util.UUID;
|
|||||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||||
import org.kar.archidata.annotation.AsyncType;
|
import org.kar.archidata.annotation.AsyncType;
|
||||||
|
import org.kar.archidata.annotation.FormDataOptional;
|
||||||
import org.kar.archidata.annotation.TypeScriptProgress;
|
import org.kar.archidata.annotation.TypeScriptProgress;
|
||||||
import org.kar.archidata.dataAccess.DataAccess;
|
import org.kar.archidata.dataAccess.DataAccess;
|
||||||
import org.kar.archidata.dataAccess.addOn.AddOnDataJson;
|
import org.kar.archidata.dataAccess.addOn.AddOnDataJson;
|
||||||
@ -30,54 +31,50 @@ import jakarta.ws.rs.core.MediaType;
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public class GenderResource {
|
public class GenderResource {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(GenderResource.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(GenderResource.class);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("USER")
|
@RolesAllowed("USER")
|
||||||
public static Gender get(@PathParam("id") final Long id) throws Exception {
|
public static Gender get(@PathParam("id") final Long id) throws Exception {
|
||||||
return DataAccess.get(Gender.class, id);
|
return DataAccess.get(Gender.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@RolesAllowed("USER")
|
@RolesAllowed("USER")
|
||||||
public List<Gender> gets() throws Exception {
|
public List<Gender> gets() throws Exception {
|
||||||
return DataAccess.gets(Gender.class);
|
return DataAccess.gets(Gender.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public Gender post(@AsyncType(Gender.class) final String jsonRequest) throws Exception {
|
public Gender post(@AsyncType(Gender.class) final String jsonRequest) throws Exception {
|
||||||
return DataAccess.insertWithJson(Gender.class, jsonRequest);
|
return DataAccess.insertWithJson(Gender.class, jsonRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PATCH
|
@PATCH
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public Gender patch(@PathParam("id") final Long id, @AsyncType(Gender.class) final String jsonRequest)
|
public Gender patch(@PathParam("id") final Long id, @AsyncType(Gender.class) final String jsonRequest) throws Exception {
|
||||||
throws Exception {
|
|
||||||
DataAccess.updateWithJson(Gender.class, id, jsonRequest);
|
DataAccess.updateWithJson(Gender.class, id, jsonRequest);
|
||||||
return DataAccess.get(Gender.class, id);
|
return DataAccess.get(Gender.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public void remove(@PathParam("id") final Long id) throws Exception {
|
public void remove(@PathParam("id") final Long id) throws Exception {
|
||||||
DataAccess.delete(Gender.class, id);
|
DataAccess.delete(Gender.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("{id}/cover")
|
@Path("{id}/cover")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
@TypeScriptProgress
|
@TypeScriptProgress
|
||||||
public Gender uploadCover(
|
public Gender uploadCover(@PathParam("id") final Long id, @FormDataOptional @FormDataParam("uri") final String uri, @FormDataOptional @FormDataParam("file") final InputStream fileInputStream,
|
||||||
@PathParam("id") final Long id,
|
@FormDataOptional @FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
||||||
@FormDataParam("uri") final String uri,
|
|
||||||
@FormDataParam("file") final InputStream fileInputStream,
|
|
||||||
@FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
DataTools.uploadCoverFromUri(Gender.class, id, uri);
|
DataTools.uploadCoverFromUri(Gender.class, id, uri);
|
||||||
} else {
|
} else {
|
||||||
@ -85,12 +82,11 @@ public class GenderResource {
|
|||||||
}
|
}
|
||||||
return DataAccess.get(Gender.class, id);
|
return DataAccess.get(Gender.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}/cover/{coverId}")
|
@Path("{id}/cover/{coverId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public Gender removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId)
|
public Gender removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnDataJson.removeLink(Gender.class, id, "covers", coverId);
|
AddOnDataJson.removeLink(Gender.class, id, "covers", coverId);
|
||||||
return DataAccess.get(Gender.class, id);
|
return DataAccess.get(Gender.class, id);
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@ import jakarta.ws.rs.core.Response;
|
|||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public class HealthCheck {
|
public class HealthCheck {
|
||||||
|
|
||||||
public record HealthResult(
|
public record HealthResult(String value) {
|
||||||
String value) {};
|
};
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@PermitAll
|
@PermitAll
|
||||||
|
@ -30,80 +30,74 @@ import jakarta.ws.rs.core.MediaType;
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public class PlaylistResource {
|
public class PlaylistResource {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(PlaylistResource.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(PlaylistResource.class);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("USER")
|
@RolesAllowed("USER")
|
||||||
public static Playlist get(@PathParam("id") final Long id) throws Exception {
|
public static Playlist get(@PathParam("id") final Long id) throws Exception {
|
||||||
return DataAccess.get(Playlist.class, id);
|
return DataAccess.get(Playlist.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@RolesAllowed("USER")
|
@RolesAllowed("USER")
|
||||||
public List<Playlist> gets() throws Exception {
|
public List<Playlist> gets() throws Exception {
|
||||||
return DataAccess.gets(Playlist.class);
|
return DataAccess.gets(Playlist.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public Playlist post(@AsyncType(Playlist.class) final String jsonRequest) throws Exception {
|
public Playlist post(@AsyncType(Playlist.class) final String jsonRequest) throws Exception {
|
||||||
return DataAccess.insertWithJson(Playlist.class, jsonRequest);
|
return DataAccess.insertWithJson(Playlist.class, jsonRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PATCH
|
@PATCH
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public Playlist patch(@PathParam("id") final Long id, @AsyncType(Playlist.class) final String jsonRequest)
|
public Playlist patch(@PathParam("id") final Long id, @AsyncType(Playlist.class) final String jsonRequest) throws Exception {
|
||||||
throws Exception {
|
|
||||||
DataAccess.updateWithJson(Playlist.class, id, jsonRequest);
|
DataAccess.updateWithJson(Playlist.class, id, jsonRequest);
|
||||||
return DataAccess.get(Playlist.class, id);
|
return DataAccess.get(Playlist.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public void remove(@PathParam("id") final Long id) throws Exception {
|
public void remove(@PathParam("id") final Long id) throws Exception {
|
||||||
DataAccess.delete(Playlist.class, id);
|
DataAccess.delete(Playlist.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("{id}/track/{trackId}")
|
@Path("{id}/track/{trackId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
public Playlist addTrack(@PathParam("id") final Long id, @PathParam("trackId") final Long trackId)
|
public Playlist addTrack(@PathParam("id") final Long id, @PathParam("trackId") final Long trackId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnManyToMany.removeLink(Playlist.class, id, "track", trackId);
|
AddOnManyToMany.removeLink(Playlist.class, id, "track", trackId);
|
||||||
return DataAccess.get(Playlist.class, id);
|
return DataAccess.get(Playlist.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}/track/{trackId}")
|
@Path("{id}/track/{trackId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public Playlist removeTrack(@PathParam("id") final Long id, @PathParam("trackId") final Long trackId)
|
public Playlist removeTrack(@PathParam("id") final Long id, @PathParam("trackId") final Long trackId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnManyToMany.removeLink(Playlist.class, id, "track", trackId);
|
AddOnManyToMany.removeLink(Playlist.class, id, "track", trackId);
|
||||||
return DataAccess.get(Playlist.class, id);
|
return DataAccess.get(Playlist.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("{id}/cover")
|
@Path("{id}/cover")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
@AsyncType(Playlist.class)
|
@AsyncType(Playlist.class)
|
||||||
public void uploadCover(
|
public void uploadCover(@PathParam("id") final Long id, @FormDataParam("file") final InputStream fileInputStream, @FormDataParam("file") final FormDataContentDisposition fileMetaData)
|
||||||
@PathParam("id") final Long id,
|
throws Exception {
|
||||||
@FormDataParam("file") final InputStream fileInputStream,
|
|
||||||
@FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
|
||||||
DataTools.uploadCover(Playlist.class, id, fileInputStream, fileMetaData);
|
DataTools.uploadCover(Playlist.class, id, fileInputStream, fileMetaData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}/cover/{coverId}")
|
@Path("{id}/cover/{coverId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public Playlist removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId)
|
public Playlist removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnDataJson.removeLink(Playlist.class, id, "covers", coverId);
|
AddOnDataJson.removeLink(Playlist.class, id, "covers", coverId);
|
||||||
return DataAccess.get(Playlist.class, id);
|
return DataAccess.get(Playlist.class, id);
|
||||||
}
|
}
|
||||||
|
@ -41,44 +41,43 @@ import jakarta.ws.rs.core.Response;
|
|||||||
@Produces({ MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON })
|
||||||
public class TrackResource {
|
public class TrackResource {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TrackResource.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(TrackResource.class);
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("USER")
|
@RolesAllowed("USER")
|
||||||
public static Track get(@PathParam("id") final Long id) throws Exception {
|
public static Track get(@PathParam("id") final Long id) throws Exception {
|
||||||
return DataAccess.get(Track.class, id);
|
return DataAccess.get(Track.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@RolesAllowed("USER")
|
@RolesAllowed("USER")
|
||||||
public List<Track> gets() throws Exception {
|
public List<Track> gets() throws Exception {
|
||||||
return DataAccess.gets(Track.class);
|
return DataAccess.gets(Track.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public Track post(@AsyncType(Track.class) final String jsonRequest) throws Exception {
|
public Track post(@AsyncType(Track.class) final String jsonRequest) throws Exception {
|
||||||
return DataAccess.insertWithJson(Track.class, jsonRequest);
|
return DataAccess.insertWithJson(Track.class, jsonRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PATCH
|
@PATCH
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public Track patch(@PathParam("id") final Long id, @AsyncType(Track.class) final String jsonRequest)
|
public Track patch(@PathParam("id") final Long id, @AsyncType(Track.class) final String jsonRequest) throws Exception {
|
||||||
throws Exception {
|
|
||||||
DataAccess.updateWithJson(Track.class, id, jsonRequest);
|
DataAccess.updateWithJson(Track.class, id, jsonRequest);
|
||||||
return DataAccess.get(Track.class, id);
|
return DataAccess.get(Track.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public void remove(@PathParam("id") final Long id) throws Exception {
|
public void remove(@PathParam("id") final Long id) throws Exception {
|
||||||
DataAccess.delete(Track.class, id);
|
DataAccess.delete(Track.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("{id}/artist/{artistId}")
|
@Path("{id}/artist/{artistId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@ -87,25 +86,21 @@ public class TrackResource {
|
|||||||
AddOnManyToMany.removeLink(Track.class, id, "artist", artistId);
|
AddOnManyToMany.removeLink(Track.class, id, "artist", artistId);
|
||||||
return DataAccess.get(Track.class, id);
|
return DataAccess.get(Track.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}/artist/{trackId}")
|
@Path("{id}/artist/{trackId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public Track removeTrack(@PathParam("id") final Long id, @PathParam("artistId") final Long artistId)
|
public Track removeTrack(@PathParam("id") final Long id, @PathParam("artistId") final Long artistId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnManyToMany.removeLink(Track.class, id, "artist", artistId);
|
AddOnManyToMany.removeLink(Track.class, id, "artist", artistId);
|
||||||
return DataAccess.get(Track.class, id);
|
return DataAccess.get(Track.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("{id}/cover")
|
@Path("{id}/cover")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||||
@TypeScriptProgress
|
@TypeScriptProgress
|
||||||
public Track uploadCover(
|
public Track uploadCover(@PathParam("id") final Long id, @FormDataParam("uri") final String uri, @FormDataParam("file") final InputStream fileInputStream,
|
||||||
@PathParam("id") final Long id,
|
|
||||||
@FormDataParam("uri") final String uri,
|
|
||||||
@FormDataParam("file") final InputStream fileInputStream,
|
|
||||||
@FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
@FormDataParam("file") final FormDataContentDisposition fileMetaData) throws Exception {
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
DataTools.uploadCoverFromUri(Track.class, id, uri);
|
DataTools.uploadCoverFromUri(Track.class, id, uri);
|
||||||
@ -114,16 +109,15 @@ public class TrackResource {
|
|||||||
}
|
}
|
||||||
return DataAccess.get(Track.class, id);
|
return DataAccess.get(Track.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("{id}/cover/{coverId}")
|
@Path("{id}/cover/{coverId}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public Track removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId)
|
public Track removeCover(@PathParam("id") final Long id, @PathParam("coverId") final UUID coverId) throws Exception {
|
||||||
throws Exception {
|
|
||||||
AddOnDataJson.removeLink(Track.class, id, "covers", coverId);
|
AddOnDataJson.removeLink(Track.class, id, "covers", coverId);
|
||||||
return DataAccess.get(Track.class, id);
|
return DataAccess.get(Track.class, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("upload/")
|
@Path("upload/")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
@ -131,11 +125,10 @@ public class TrackResource {
|
|||||||
// Formatter:off
|
// Formatter:off
|
||||||
@AsyncType(Track.class)
|
@AsyncType(Track.class)
|
||||||
@TypeScriptProgress
|
@TypeScriptProgress
|
||||||
public Response uploadTrack(
|
public Response uploadTrack(@FormDataParam("fileName") String fileName, //
|
||||||
@FormDataParam("fileName") String fileName, //
|
|
||||||
@FormDataParam("gender") String gender, //
|
@FormDataParam("gender") String gender, //
|
||||||
@FormDataParam("artist") String artist, //
|
@FormDataParam("artist") String artist, //
|
||||||
//@FormDataParam("seriesId") String seriesId, Not used ...
|
// @FormDataParam("seriesId") String seriesId, Not used ...
|
||||||
@FormDataParam("album") String album, //
|
@FormDataParam("album") String album, //
|
||||||
@AsyncType(Long.class) @FormDataParam("trackId") String trackId, //
|
@AsyncType(Long.class) @FormDataParam("trackId") String trackId, //
|
||||||
@FormDataParam("title") String title, //
|
@FormDataParam("title") String title, //
|
||||||
@ -151,8 +144,8 @@ public class TrackResource {
|
|||||||
album = DataTools.multipartCorrection(album);
|
album = DataTools.multipartCorrection(album);
|
||||||
trackId = DataTools.multipartCorrection(trackId);
|
trackId = DataTools.multipartCorrection(trackId);
|
||||||
title = DataTools.multipartCorrection(title);
|
title = DataTools.multipartCorrection(title);
|
||||||
|
|
||||||
//public NodeSmall uploadFile(final FormDataMultiPart form) {
|
// public NodeSmall uploadFile(final FormDataMultiPart form) {
|
||||||
LOGGER.info("Upload media file: " + fileMetaData);
|
LOGGER.info("Upload media file: " + fileMetaData);
|
||||||
LOGGER.info(" > fileName: " + fileName);
|
LOGGER.info(" > fileName: " + fileName);
|
||||||
LOGGER.info(" > gender: " + gender);
|
LOGGER.info(" > gender: " + gender);
|
||||||
@ -162,21 +155,14 @@ public class TrackResource {
|
|||||||
LOGGER.info(" > title: " + title);
|
LOGGER.info(" > title: " + title);
|
||||||
LOGGER.info(" > fileInputStream: " + fileInputStream);
|
LOGGER.info(" > fileInputStream: " + fileInputStream);
|
||||||
LOGGER.info(" > fileMetaData: " + fileMetaData);
|
LOGGER.info(" > fileMetaData: " + fileMetaData);
|
||||||
/*
|
/* if (typeId == null) { return Response.status(406). entity("Missong Input 'type'"). type("text/plain"). build(); } */
|
||||||
if (typeId == null) {
|
|
||||||
return Response.status(406).
|
|
||||||
entity("Missong Input 'type'").
|
|
||||||
type("text/plain").
|
|
||||||
build();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
final long tmpUID = DataTools.getTmpDataId();
|
final long tmpUID = DataTools.getTmpDataId();
|
||||||
final String sha512 = DataTools.saveTemporaryFile(fileInputStream, tmpUID);
|
final String sha512 = DataTools.saveTemporaryFile(fileInputStream, tmpUID);
|
||||||
Data data = DataTools.getWithSha512(sha512);
|
Data data = DataTools.getWithSha512(sha512);
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
LOGGER.info("Need to add the data in the BDD ... ");
|
LOGGER.info("Need to add the data in the BDD ... ");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
data = DataTools.createNewData(tmpUID, fileName, sha512);
|
data = DataTools.createNewData(tmpUID, fileName, sha512);
|
||||||
} catch (final IOException ex) {
|
} catch (final IOException ex) {
|
||||||
@ -206,13 +192,13 @@ public class TrackResource {
|
|||||||
genderElem = DataAccess.insert(genderElem);
|
genderElem = DataAccess.insert(genderElem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// NodeSmall typeNode = TypeResource.getWithId(Long.parseLong(typeId));
|
// NodeSmall typeNode = TypeResource.getWithId(Long.parseLong(typeId));
|
||||||
// if (typeNode == null) {
|
// if (typeNode == null) {
|
||||||
// DataTools.removeTemporaryFile(tmpUID);
|
// DataTools.removeTemporaryFile(tmpUID);
|
||||||
// return Response.notModified("TypeId does not exist ...").build();
|
// return Response.notModified("TypeId does not exist ...").build();
|
||||||
// }
|
// }
|
||||||
LOGGER.info(" ==> genderElem={}", genderElem);
|
LOGGER.info(" ==> genderElem={}", genderElem);
|
||||||
|
|
||||||
Artist artistElem = null;
|
Artist artistElem = null;
|
||||||
if (artist != null) {
|
if (artist != null) {
|
||||||
LOGGER.info(" Try to find Artist: '{}'", artist);
|
LOGGER.info(" Try to find Artist: '{}'", artist);
|
||||||
@ -225,7 +211,7 @@ public class TrackResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.info(" ==> artistElem={}", artistElem);
|
LOGGER.info(" ==> artistElem={}", artistElem);
|
||||||
|
|
||||||
Album albumElem = null;
|
Album albumElem = null;
|
||||||
if (album != null) {
|
if (album != null) {
|
||||||
albumElem = DataAccess.getWhere(Album.class, new Condition(new QueryCondition("name", "=", album)));
|
albumElem = DataAccess.getWhere(Album.class, new Condition(new QueryCondition("name", "=", album)));
|
||||||
@ -236,9 +222,9 @@ public class TrackResource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.info(" ==> " + album);
|
LOGGER.info(" ==> " + album);
|
||||||
|
|
||||||
LOGGER.info("add media");
|
LOGGER.info("add media");
|
||||||
|
|
||||||
Track trackElem = new Track();
|
Track trackElem = new Track();
|
||||||
trackElem.name = title;
|
trackElem.name = title;
|
||||||
trackElem.track = trackId != null ? Long.parseLong(trackId) : null;
|
trackElem.track = trackId != null ? Long.parseLong(trackId) : null;
|
||||||
@ -251,12 +237,7 @@ public class TrackResource {
|
|||||||
trackElem.artists.add(artistElem.id);
|
trackElem.artists.add(artistElem.id);
|
||||||
}
|
}
|
||||||
trackElem = DataAccess.insert(trackElem);
|
trackElem = DataAccess.insert(trackElem);
|
||||||
/*
|
/* Old mode of artist insertion (removed due to the slowlest request of getting value if (artistElem != null) { DataAccess.addLink(Track.class, trackElem.id, "artist", artistElem.id); } */
|
||||||
Old mode of artist insertion (removed due to the slowlest request of getting value
|
|
||||||
if (artistElem != null) {
|
|
||||||
DataAccess.addLink(Track.class, trackElem.id, "artist", artistElem.id);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return Response.ok(trackElem).build();
|
return Response.ok(trackElem).build();
|
||||||
} catch (final Exception ex) {
|
} catch (final Exception ex) {
|
||||||
LOGGER.info("Catch an unexpected error ... {}", ex.getMessage());
|
LOGGER.info("Catch an unexpected error ... {}", ex.getMessage());
|
||||||
@ -264,5 +245,5 @@ public class TrackResource {
|
|||||||
return Response.status(417).entity("Back-end error : " + ex.getMessage()).type("text/plain").build();
|
return Response.status(417).entity("Back-end error : " + ex.getMessage()).type("text/plain").build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@ import jakarta.annotation.Priority;
|
|||||||
@Priority(Priorities.AUTHENTICATION)
|
@Priority(Priorities.AUTHENTICATION)
|
||||||
public class KarusicAuthenticationFilter extends AuthenticationFilter {
|
public class KarusicAuthenticationFilter extends AuthenticationFilter {
|
||||||
final Logger logger = LoggerFactory.getLogger(KarusicAuthenticationFilter.class);
|
final Logger logger = LoggerFactory.getLogger(KarusicAuthenticationFilter.class);
|
||||||
|
|
||||||
public KarusicAuthenticationFilter() {
|
public KarusicAuthenticationFilter() {
|
||||||
super("karusic");
|
super("karusic");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,57 +4,57 @@ package org.kar.karusic.internal;
|
|||||||
//import io.scenarium.logger.Logger;
|
//import io.scenarium.logger.Logger;
|
||||||
|
|
||||||
public class Log {
|
public class Log {
|
||||||
// private static final String LIB_NAME = "logger";
|
// private static final String LIB_NAME = "logger";
|
||||||
// private static final String LIB_NAME_DRAW = Logger.getDrawableName(LIB_NAME);
|
// private static final String LIB_NAME_DRAW = Logger.getDrawableName(LIB_NAME);
|
||||||
// private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(LIB_NAME, LogLevel.CRITICAL);
|
// private static final boolean PRINT_CRITICAL = Logger.getNeedPrint(LIB_NAME, LogLevel.CRITICAL);
|
||||||
// private static final boolean PRINT_ERROR = Logger.getNeedPrint(LIB_NAME, LogLevel.ERROR);
|
// private static final boolean PRINT_ERROR = Logger.getNeedPrint(LIB_NAME, LogLevel.ERROR);
|
||||||
// private static final boolean PRINT_WARNING = Logger.getNeedPrint(LIB_NAME, LogLevel.WARNING);
|
// private static final boolean PRINT_WARNING = Logger.getNeedPrint(LIB_NAME, LogLevel.WARNING);
|
||||||
// private static final boolean PRINT_INFO = Logger.getNeedPrint(LIB_NAME, LogLevel.INFO);
|
// private static final boolean PRINT_INFO = Logger.getNeedPrint(LIB_NAME, LogLevel.INFO);
|
||||||
// private static final boolean PRINT_DEBUG = Logger.getNeedPrint(LIB_NAME, LogLevel.DEBUG);
|
// private static final boolean PRINT_DEBUG = Logger.getNeedPrint(LIB_NAME, LogLevel.DEBUG);
|
||||||
// private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(LIB_NAME, LogLevel.VERBOSE);
|
// private static final boolean PRINT_VERBOSE = Logger.getNeedPrint(LIB_NAME, LogLevel.VERBOSE);
|
||||||
// private static final boolean PRINT_TODO = Logger.getNeedPrint(LIB_NAME, LogLevel.TODO);
|
// private static final boolean PRINT_TODO = Logger.getNeedPrint(LIB_NAME, LogLevel.TODO);
|
||||||
// private static final boolean PRINT_PRINT = Logger.getNeedPrint(LIB_NAME, LogLevel.PRINT);
|
// private static final boolean PRINT_PRINT = Logger.getNeedPrint(LIB_NAME, LogLevel.PRINT);
|
||||||
//
|
//
|
||||||
// private Log() {}
|
// private Log() {}
|
||||||
//
|
//
|
||||||
// public static void print(String data) {
|
// public static void print(String data) {
|
||||||
// if (PRINT_PRINT)
|
// if (PRINT_PRINT)
|
||||||
// Logger.print(LIB_NAME_DRAW, data);
|
// Logger.print(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static void todo(String data) {
|
// public static void todo(String data) {
|
||||||
// if (PRINT_TODO)
|
// if (PRINT_TODO)
|
||||||
// Logger.todo(LIB_NAME_DRAW, data);
|
// Logger.todo(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static void critical(String data) {
|
// public static void critical(String data) {
|
||||||
// if (PRINT_CRITICAL)
|
// if (PRINT_CRITICAL)
|
||||||
// Logger.critical(LIB_NAME_DRAW, data);
|
// Logger.critical(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static void error(String data) {
|
// public static void error(String data) {
|
||||||
// if (PRINT_ERROR)
|
// if (PRINT_ERROR)
|
||||||
// Logger.error(LIB_NAME_DRAW, data);
|
// Logger.error(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static void warning(String data) {
|
// public static void warning(String data) {
|
||||||
// if (PRINT_WARNING)
|
// if (PRINT_WARNING)
|
||||||
// Logger.warning(LIB_NAME_DRAW, data);
|
// Logger.warning(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static void info(String data) {
|
// public static void info(String data) {
|
||||||
// if (PRINT_INFO)
|
// if (PRINT_INFO)
|
||||||
// Logger.info(LIB_NAME_DRAW, data);
|
// Logger.info(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static void debug(String data) {
|
// public static void debug(String data) {
|
||||||
// if (PRINT_DEBUG)
|
// if (PRINT_DEBUG)
|
||||||
// Logger.debug(LIB_NAME_DRAW, data);
|
// Logger.debug(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public static void verbose(String data) {
|
// public static void verbose(String data) {
|
||||||
// if (PRINT_VERBOSE)
|
// if (PRINT_VERBOSE)
|
||||||
// Logger.verbose(LIB_NAME_DRAW, data);
|
// Logger.verbose(LIB_NAME_DRAW, data);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,26 +16,25 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class Initialization extends MigrationSqlStep {
|
public class Initialization extends MigrationSqlStep {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Initialization.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Initialization.class);
|
||||||
|
|
||||||
public static final int KARSO_INITIALISATION_ID = 1;
|
public static final int KARSO_INITIALISATION_ID = 1;
|
||||||
public static final List<Class<?>> CLASSES_BASE = List.of(Album.class, Artist.class, Data.class, Gender.class,
|
public static final List<Class<?>> CLASSES_BASE = List.of(Album.class, Artist.class, Data.class, Gender.class, Playlist.class, Track.class, User.class);
|
||||||
Playlist.class, Track.class, User.class);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Initialization";
|
return "Initialization";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Initialization() {
|
public Initialization() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generateStep() throws Exception {
|
public void generateStep() throws Exception {
|
||||||
for (final Class<?> elem : CLASSES_BASE) {
|
for (final Class<?> elem : CLASSES_BASE) {
|
||||||
addClass(elem);
|
addClass(elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
addAction("""
|
addAction("""
|
||||||
INSERT INTO `gender` (`id`, `name`, `description`) VALUES
|
INSERT INTO `gender` (`id`, `name`, `description`) VALUES
|
||||||
(1, 'Variété française', NULL),
|
(1, 'Variété française', NULL),
|
||||||
@ -85,7 +84,7 @@ public class Initialization extends MigrationSqlStep {
|
|||||||
ALTER TABLE `user` AUTO_INCREMENT = 1000;
|
ALTER TABLE `user` AUTO_INCREMENT = 1000;
|
||||||
""", "mysql");
|
""", "mysql");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dropAll() {
|
public static void dropAll() {
|
||||||
for (final Class<?> element : CLASSES_BASE) {
|
for (final Class<?> element : CLASSES_BASE) {
|
||||||
try {
|
try {
|
||||||
@ -96,7 +95,7 @@ public class Initialization extends MigrationSqlStep {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void cleanAll() {
|
public static void cleanAll() {
|
||||||
for (final Class<?> element : CLASSES_BASE) {
|
for (final Class<?> element : CLASSES_BASE) {
|
||||||
try {
|
try {
|
||||||
|
@ -31,7 +31,7 @@ public class Migration20231126 extends MigrationSqlStep {
|
|||||||
CHANGE `count` `count` int NULL COMMENT 'number of element in the migration' AFTER `stepId`,
|
CHANGE `count` `count` int NULL COMMENT 'number of element in the migration' AFTER `stepId`,
|
||||||
CHANGE `log` `log` text COLLATE 'utf8mb3_general_ci' NULL COMMENT 'Log generate by the migration' AFTER `count`;
|
CHANGE `log` `log` text COLLATE 'utf8mb3_general_ci' NULL COMMENT 'Log generate by the migration' AFTER `count`;
|
||||||
""");
|
""");
|
||||||
|
|
||||||
addAction("""
|
addAction("""
|
||||||
ALTER TABLE `album`
|
ALTER TABLE `album`
|
||||||
CHANGE `id` `id` bigint NOT NULL COMMENT 'Primary key of the base' AUTO_INCREMENT FIRST,
|
CHANGE `id` `id` bigint NOT NULL COMMENT 'Primary key of the base' AUTO_INCREMENT FIRST,
|
||||||
|
@ -22,26 +22,25 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class Migration20240226 extends MigrationSqlStep {
|
public class Migration20240226 extends MigrationSqlStep {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(Migration20240226.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(Migration20240226.class);
|
||||||
|
|
||||||
public static final int KARSO_INITIALISATION_ID = 1;
|
public static final int KARSO_INITIALISATION_ID = 1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "migration-2024-02-26: convert base with UUID";
|
return "migration-2024-02-26: convert base with UUID";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Migration20240226() {
|
public Migration20240226() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void generateStep() throws Exception {
|
public void generateStep() throws Exception {
|
||||||
addAction("""
|
addAction("""
|
||||||
ALTER TABLE `data` ADD `uuid` binary(16) AFTER `id`;
|
ALTER TABLE `data` ADD `uuid` binary(16) AFTER `id`;
|
||||||
""");
|
""");
|
||||||
addAction(() -> {
|
addAction(() -> {
|
||||||
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(),
|
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
|
||||||
new OverrideTableName("data"));
|
|
||||||
for (final UUIDConversion elem : datas) {
|
for (final UUIDConversion elem : datas) {
|
||||||
elem.uuid = UuidUtils.nextUUID();
|
elem.uuid = UuidUtils.nextUUID();
|
||||||
}
|
}
|
||||||
@ -56,12 +55,9 @@ public class Migration20240226 extends MigrationSqlStep {
|
|||||||
for (final String tableName : tableToTransform) {
|
for (final String tableName : tableToTransform) {
|
||||||
addAction("ALTER TABLE `" + tableName + "` ADD `covers` text NULL;");
|
addAction("ALTER TABLE `" + tableName + "` ADD `covers` text NULL;");
|
||||||
addAction(() -> {
|
addAction(() -> {
|
||||||
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(),
|
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
|
||||||
new OverrideTableName("data"));
|
final List<CoverConversion> medias = DataAccess.gets(CoverConversion.class, new AccessDeletedItems(), new OverrideTableName(tableName));
|
||||||
final List<CoverConversion> medias = DataAccess.gets(CoverConversion.class, new AccessDeletedItems(),
|
final List<LinkTableLongLong> links = DataAccess.gets(LinkTableLongLong.class, new OverrideTableName(tableName + "_link_cover"));
|
||||||
new OverrideTableName(tableName));
|
|
||||||
final List<LinkTableLongLong> links = DataAccess.gets(LinkTableLongLong.class,
|
|
||||||
new OverrideTableName(tableName + "_link_cover"));
|
|
||||||
LOGGER.info("Get somes data: {} {} {}", datas.size(), medias.size(), links.size());
|
LOGGER.info("Get somes data: {} {} {}", datas.size(), medias.size(), links.size());
|
||||||
for (final CoverConversion media : medias) {
|
for (final CoverConversion media : medias) {
|
||||||
final List<UUID> values = new ArrayList<>();
|
final List<UUID> values = new ArrayList<>();
|
||||||
@ -89,10 +85,8 @@ public class Migration20240226 extends MigrationSqlStep {
|
|||||||
ALTER TABLE `track` ADD `dataUUID` binary(16) AFTER dataId;
|
ALTER TABLE `track` ADD `dataUUID` binary(16) AFTER dataId;
|
||||||
""");
|
""");
|
||||||
addAction(() -> {
|
addAction(() -> {
|
||||||
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(),
|
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
|
||||||
new OverrideTableName("data"));
|
final List<MediaConversion> medias = DataAccess.gets(MediaConversion.class, new AccessDeletedItems(), new OverrideTableName("track"));
|
||||||
final List<MediaConversion> medias = DataAccess.gets(MediaConversion.class, new AccessDeletedItems(),
|
|
||||||
new OverrideTableName("track"));
|
|
||||||
for (final MediaConversion media : medias) {
|
for (final MediaConversion media : medias) {
|
||||||
for (final UUIDConversion data : datas) {
|
for (final UUIDConversion data : datas) {
|
||||||
if (data.id.equals(media.dataId)) {
|
if (data.id.equals(media.dataId)) {
|
||||||
@ -103,7 +97,7 @@ public class Migration20240226 extends MigrationSqlStep {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
addAction("""
|
addAction("""
|
||||||
DROP TABLE `playlist`;
|
DROP TABLE `playlist`;
|
||||||
""");
|
""");
|
||||||
@ -118,8 +112,7 @@ public class Migration20240226 extends MigrationSqlStep {
|
|||||||
""");
|
""");
|
||||||
// Move the files...
|
// Move the files...
|
||||||
addAction(() -> {
|
addAction(() -> {
|
||||||
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(),
|
final List<UUIDConversion> datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
|
||||||
new OverrideTableName("data"));
|
|
||||||
for (final UUIDConversion data : datas) {
|
for (final UUIDConversion data : datas) {
|
||||||
final String origin = DataResource.getFileDataOld(data.id);
|
final String origin = DataResource.getFileDataOld(data.id);
|
||||||
final String destination = DataResource.getFileData(data.uuid);
|
final String destination = DataResource.getFileData(data.uuid);
|
||||||
@ -138,5 +131,5 @@ public class Migration20240226 extends MigrationSqlStep {
|
|||||||
ALTER TABLE `data` ADD PRIMARY KEY `id` (`id`);
|
ALTER TABLE `data` ADD PRIMARY KEY `id` (`id`);
|
||||||
""");
|
""");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -34,11 +34,10 @@ public class Artist extends GenericDataSoftDelete {
|
|||||||
public String surname = null;
|
public String surname = null;
|
||||||
public LocalDate birth = null;
|
public LocalDate birth = null;
|
||||||
public LocalDate death = null;
|
public LocalDate death = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Artist [id=" + this.id + ", name=" + this.name + ", description=" + this.description + ", covers="
|
return "Artist [id=" + this.id + ", name=" + this.name + ", description=" + this.description + ", covers=" + this.covers + ", firstName=" + this.firstName + ", surname=" + this.surname
|
||||||
+ this.covers + ", firstName=" + this.firstName + ", surname=" + this.surname + ", birth=" + this.birth
|
+ ", birth=" + this.birth + ", death=" + this.death + "]";
|
||||||
+ ", death=" + this.death + "]";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,5 +39,5 @@ public class Gender extends GenericDataSoftDelete {
|
|||||||
@DataJson(targetEntity = Data.class)
|
@DataJson(targetEntity = Data.class)
|
||||||
@Nullable
|
@Nullable
|
||||||
public List<UUID> covers = null;
|
public List<UUID> covers = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package org.kar.karusic.model;
|
package org.kar.karusic.model;
|
||||||
|
|
||||||
public enum State {
|
public enum State {
|
||||||
// User has remove his account
|
// User has remove his account
|
||||||
REMOVED,
|
REMOVED,
|
||||||
// User has been blocked his account
|
// User has been blocked his account
|
||||||
BLOCKED,
|
BLOCKED,
|
||||||
// generic user
|
// generic user
|
||||||
USER
|
USER
|
||||||
}
|
}
|
||||||
|
@ -43,16 +43,14 @@ public class Track extends GenericDataSoftDelete {
|
|||||||
public Long albumId = null;
|
public Long albumId = null;
|
||||||
public Long track = null;
|
public Long track = null;
|
||||||
public UUID dataId = null;
|
public UUID dataId = null;
|
||||||
//@ManyToMany(fetch = FetchType.LAZY, targetEntity = Artist.class)
|
// @ManyToMany(fetch = FetchType.LAZY, targetEntity = Artist.class)
|
||||||
@DataJson
|
@DataJson
|
||||||
@Column(length = 0)
|
@Column(length = 0)
|
||||||
public List<Long> artists = null;
|
public List<Long> artists = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Track [id=" + this.id + ", deleted=" + this.deleted + ", createdAt=" + this.createdAt + ", updatedAt="
|
return "Track [id=" + this.id + ", deleted=" + this.deleted + ", createdAt=" + this.createdAt + ", updatedAt=" + this.updatedAt + ", name=" + this.name + ", description=" + this.description
|
||||||
+ this.updatedAt + ", name=" + this.name + ", description=" + this.description + ", covers="
|
+ ", covers=" + this.covers + ", genderId=" + this.genderId + ", albumId=" + this.albumId + ", track=" + this.track + ", dataId=" + this.dataId + ", artists=" + this.artists + "]";
|
||||||
+ this.covers + ", genderId=" + this.genderId + ", albumId=" + this.albumId + ", track=" + this.track
|
|
||||||
+ ", dataId=" + this.dataId + ", artists=" + this.artists + "]";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,12 @@ package org.kar.karusic.util;
|
|||||||
public class ConfigVariable {
|
public class ConfigVariable {
|
||||||
public static final String BASE_NAME = "ORG_KARUSIC_";
|
public static final String BASE_NAME = "ORG_KARUSIC_";
|
||||||
|
|
||||||
|
public static String getFrontFolder() {
|
||||||
public static String getFrontFolder() {
|
String out = System.getenv(BASE_NAME + "FRONT_FOLDER");
|
||||||
String out = System.getenv(BASE_NAME + "FRONT_FOLDER");
|
if (out == null) {
|
||||||
if (out == null) {
|
return "/application/front";
|
||||||
return "/application/front";
|
}
|
||||||
}
|
return out;
|
||||||
return out;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,6 @@ import java.util.Map;
|
|||||||
import org.kar.archidata.tools.JWTWrapper;
|
import org.kar.archidata.tools.JWTWrapper;
|
||||||
|
|
||||||
public class Common {
|
public class Common {
|
||||||
static String USER_TOKEN = JWTWrapper.createJwtTestToken(16512, "test_user_login", "KarAuth", "karusic",
|
static String USER_TOKEN = JWTWrapper.createJwtTestToken(16512, "test_user_login", "KarAuth", "karusic", Map.of("karusic", Map.of("USER", Boolean.TRUE)));
|
||||||
Map.of("karusic", Map.of("USER", Boolean.TRUE)));
|
static String ADMIN_TOKEN = JWTWrapper.createJwtTestToken(16512, "test_admin_login", "KarAuth", "karusic", Map.of("karusic", Map.of("USER", Boolean.TRUE, "ADMIN", Boolean.TRUE)));
|
||||||
static String ADMIN_TOKEN = JWTWrapper.createJwtTestToken(16512, "test_admin_login", "KarAuth", "karusic",
|
|
||||||
Map.of("karusic", Map.of("USER", Boolean.TRUE, "ADMIN", Boolean.TRUE)));
|
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,12 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class TestBase {
|
public class TestBase {
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(TestBase.class);
|
private final static Logger LOGGER = LoggerFactory.getLogger(TestBase.class);
|
||||||
public final static String ENDPOINT_NAME = "species/";
|
public final static String ENDPOINT_NAME = "species/";
|
||||||
|
|
||||||
static WebLauncherTest webInterface = null;
|
static WebLauncherTest webInterface = null;
|
||||||
static RESTApi api = null;
|
static RESTApi api = null;
|
||||||
|
|
||||||
private static UUID idTest;
|
private static UUID idTest;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void configureWebServer() throws Exception {
|
public static void configureWebServer() throws Exception {
|
||||||
LOGGER.info("configure server ...");
|
LOGGER.info("configure server ...");
|
||||||
@ -51,7 +51,7 @@ public class TestBase {
|
|||||||
LOGGER.info("Start REST (DONE)");
|
LOGGER.info("Start REST (DONE)");
|
||||||
api = new RESTApi(ConfigBaseVariable.apiAdress);
|
api = new RESTApi(ConfigBaseVariable.apiAdress);
|
||||||
api.setToken(Common.USER_TOKEN);
|
api.setToken(Common.USER_TOKEN);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
@ -63,5 +63,5 @@ public class TestBase {
|
|||||||
DBEntry.closeAllForceMode();
|
DBEntry.closeAllForceMode();
|
||||||
ConfigBaseVariable.clearAllValue();
|
ConfigBaseVariable.clearAllValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
public class WebLauncherTest extends WebLauncher {
|
public class WebLauncherTest extends WebLauncher {
|
||||||
final private static Logger LOGGER = LoggerFactory.getLogger(WebLauncherTest.class);
|
final private static Logger LOGGER = LoggerFactory.getLogger(WebLauncherTest.class);
|
||||||
|
|
||||||
public WebLauncherTest() {
|
public WebLauncherTest() {
|
||||||
LOGGER.debug("Configure REST system");
|
LOGGER.debug("Configure REST system");
|
||||||
// for local test:
|
// for local test:
|
||||||
@ -28,7 +28,7 @@ public class WebLauncherTest extends WebLauncher {
|
|||||||
ConfigBaseVariable.bdDatabase = "test_db";
|
ConfigBaseVariable.bdDatabase = "test_db";
|
||||||
ConfigBaseVariable.dbPort = "3309";
|
ConfigBaseVariable.dbPort = "3309";
|
||||||
ConfigBaseVariable.dbUser = "root";
|
ConfigBaseVariable.dbUser = "root";
|
||||||
//ConfigBaseVariable.dbPassword = "password";
|
// ConfigBaseVariable.dbPassword = "password";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
"*.{ts,tsx,js,jsx,json}": "prettier --write"
|
"*.{ts,tsx,js,jsx,json}": "prettier --write"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"framer-motion": "11.5.4",
|
||||||
"@chakra-ui/anatomy": "2.2.2",
|
"@chakra-ui/anatomy": "2.2.2",
|
||||||
"@chakra-ui/cli": "2.4.1",
|
"@chakra-ui/cli": "2.4.1",
|
||||||
"@chakra-ui/react": "2.8.2",
|
"@chakra-ui/react": "2.8.2",
|
||||||
@ -44,22 +45,22 @@
|
|||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.13",
|
||||||
"history": "5.3.0",
|
"history": "5.3.0",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-color-palette": "7.2.2",
|
"react-color-palette": "7.3.0",
|
||||||
"react-currency-input-field": "3.8.0",
|
"react-currency-input-field": "3.8.0",
|
||||||
"react-custom-scrollbars": "4.2.1",
|
"react-custom-scrollbars": "4.2.1",
|
||||||
"react-day-picker": "9.0.8",
|
"react-day-picker": "9.0.9",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"react-error-boundary": "4.0.13",
|
"react-error-boundary": "4.0.13",
|
||||||
"react-focus-lock": "2.13.2",
|
"react-focus-lock": "2.13.2",
|
||||||
"react-icons": "5.3.0",
|
"react-icons": "5.3.0",
|
||||||
"react-popper": "2.3.0",
|
"react-popper": "2.3.0",
|
||||||
"react-router-dom": "6.26.1",
|
"react-router-dom": "6.26.2",
|
||||||
"react-select": "5.8.0",
|
"react-select": "5.8.0",
|
||||||
"react-simple-keyboard": "3.7.148",
|
"react-simple-keyboard": "3.8.1",
|
||||||
"react-sticky-el": "2.1.1",
|
"react-sticky-el": "2.1.1",
|
||||||
"react-use": "17.5.1",
|
"react-use": "17.5.1",
|
||||||
"react-use-draggable-scroll": "0.4.7",
|
"react-use-draggable-scroll": "0.4.7",
|
||||||
"react-virtuoso": "4.10.2",
|
"react-virtuoso": "4.10.4",
|
||||||
"ts-pattern": "5.3.1",
|
"ts-pattern": "5.3.1",
|
||||||
"uuid": "10.0.0",
|
"uuid": "10.0.0",
|
||||||
"zod": "3.23.8",
|
"zod": "3.23.8",
|
||||||
@ -67,44 +68,44 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@chakra-ui/styled-system": "2.9.2",
|
"@chakra-ui/styled-system": "2.9.2",
|
||||||
"@playwright/test": "1.46.1",
|
"@playwright/test": "1.47.1",
|
||||||
"@storybook/addon-actions": "8.2.9",
|
"@storybook/addon-actions": "8.3.0",
|
||||||
"@storybook/addon-essentials": "8.2.9",
|
"@storybook/addon-essentials": "8.3.0",
|
||||||
"@storybook/addon-links": "8.2.9",
|
"@storybook/addon-links": "8.3.0",
|
||||||
"@storybook/addon-mdx-gfm": "8.2.9",
|
"@storybook/addon-mdx-gfm": "8.3.0",
|
||||||
"@storybook/react": "8.2.9",
|
"@storybook/react": "8.3.0",
|
||||||
"@storybook/react-vite": "8.2.9",
|
"@storybook/react-vite": "8.3.0",
|
||||||
"@storybook/theming": "8.2.9",
|
"@storybook/theming": "8.3.0",
|
||||||
"@testing-library/jest-dom": "6.5.0",
|
"@testing-library/jest-dom": "6.5.0",
|
||||||
"@testing-library/react": "16.0.1",
|
"@testing-library/react": "16.0.1",
|
||||||
"@testing-library/user-event": "14.5.2",
|
"@testing-library/user-event": "14.5.2",
|
||||||
"@trivago/prettier-plugin-sort-imports": "4.3.0",
|
"@trivago/prettier-plugin-sort-imports": "4.3.0",
|
||||||
"@types/jest": "29.5.12",
|
"@types/jest": "29.5.13",
|
||||||
"@types/node": "22.5.2",
|
"@types/node": "22.5.5",
|
||||||
"@types/react": "18.3.5",
|
"@types/react": "18.3.5",
|
||||||
"@types/react-dom": "18.3.0",
|
"@types/react-dom": "18.3.0",
|
||||||
"@types/react-sticky-el": "1.0.7",
|
"@types/react-sticky-el": "1.0.7",
|
||||||
"@typescript-eslint/eslint-plugin": "8.3.0",
|
"@typescript-eslint/eslint-plugin": "8.5.0",
|
||||||
"@typescript-eslint/parser": "8.3.0",
|
"@typescript-eslint/parser": "8.5.0",
|
||||||
"@vitejs/plugin-react": "4.3.1",
|
"@vitejs/plugin-react": "4.3.1",
|
||||||
"eslint": "9.9.1",
|
"eslint": "9.10.0",
|
||||||
"eslint-plugin-codeceptjs": "1.3.0",
|
"eslint-plugin-codeceptjs": "1.3.0",
|
||||||
"eslint-plugin-import": "2.29.1",
|
"eslint-plugin-import": "2.30.0",
|
||||||
"eslint-plugin-react": "7.35.0",
|
"eslint-plugin-react": "7.36.1",
|
||||||
"eslint-plugin-react-hooks": "4.6.2",
|
"eslint-plugin-react-hooks": "4.6.2",
|
||||||
"eslint-plugin-storybook": "0.8.0",
|
"eslint-plugin-storybook": "0.8.0",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"jest-environment-jsdom": "29.7.0",
|
"jest-environment-jsdom": "29.7.0",
|
||||||
"knip": "5.29.1",
|
"knip": "5.30.2",
|
||||||
"lint-staged": "15.2.9",
|
"lint-staged": "15.2.10",
|
||||||
"npm-check-updates": "^17.1.0",
|
"npm-check-updates": "^17.1.1",
|
||||||
"prettier": "3.3.3",
|
"prettier": "3.3.3",
|
||||||
"puppeteer": "23.2.1",
|
"puppeteer": "23.3.0",
|
||||||
"react-is": "18.3.1",
|
"react-is": "18.3.1",
|
||||||
"storybook": "8.2.9",
|
"storybook": "8.3.0",
|
||||||
"ts-node": "10.9.2",
|
"ts-node": "10.9.2",
|
||||||
"typescript": "5.5.4",
|
"typescript": "5.6.2",
|
||||||
"vite": "5.4.2",
|
"vite": "5.4.5",
|
||||||
"vitest": "2.0.5"
|
"vitest": "2.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
3040
front2/pnpm-lock.yaml
generated
3040
front2/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -230,8 +230,8 @@ export namespace AlbumResource {
|
|||||||
id: Long,
|
id: Long,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
file: File,
|
file?: File,
|
||||||
uri: string,
|
uri?: string,
|
||||||
},
|
},
|
||||||
callbacks?: RESTCallbacks,
|
callbacks?: RESTCallbacks,
|
||||||
}): Promise<Album> {
|
}): Promise<Album> {
|
||||||
|
@ -161,8 +161,8 @@ export namespace ArtistResource {
|
|||||||
id: Long,
|
id: Long,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
file: File,
|
file?: File,
|
||||||
uri: string,
|
uri?: string,
|
||||||
},
|
},
|
||||||
callbacks?: RESTCallbacks,
|
callbacks?: RESTCallbacks,
|
||||||
}): Promise<Artist> {
|
}): Promise<Artist> {
|
||||||
|
@ -161,8 +161,8 @@ export namespace GenderResource {
|
|||||||
id: Long,
|
id: Long,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
file: File,
|
file?: File,
|
||||||
uri: string,
|
uri?: string,
|
||||||
},
|
},
|
||||||
callbacks?: RESTCallbacks,
|
callbacks?: RESTCallbacks,
|
||||||
}): Promise<Gender> {
|
}): Promise<Gender> {
|
||||||
|
@ -8,7 +8,7 @@ export * from "./generic-data"
|
|||||||
export * from "./generic-data-soft-delete"
|
export * from "./generic-data-soft-delete"
|
||||||
export * from "./generic-timing"
|
export * from "./generic-timing"
|
||||||
export * from "./health-result"
|
export * from "./health-result"
|
||||||
export * from "./int"
|
export * from "./integer"
|
||||||
export * from "./iso-date"
|
export * from "./iso-date"
|
||||||
export * from "./local-date"
|
export * from "./local-date"
|
||||||
export * from "./long"
|
export * from "./long"
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
/**
|
|
||||||
* Interface of the server (auto-generated code)
|
|
||||||
*/
|
|
||||||
import { z as zod } from "zod";
|
|
||||||
|
|
||||||
|
|
||||||
export const Zodint = zod.object({
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export type int = zod.infer<typeof Zodint>;
|
|
||||||
|
|
||||||
export function isint(data: any): data is int {
|
|
||||||
try {
|
|
||||||
Zodint.parse(data);
|
|
||||||
return true;
|
|
||||||
} catch (e: any) {
|
|
||||||
console.log(`Fail to parse data type='Zodint' error=${e}`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export const ZodintWrite = zod.object({
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export type intWrite = zod.infer<typeof ZodintWrite>;
|
|
||||||
|
|
||||||
export function isintWrite(data: any): data is intWrite {
|
|
||||||
try {
|
|
||||||
ZodintWrite.parse(data);
|
|
||||||
return true;
|
|
||||||
} catch (e: any) {
|
|
||||||
console.log(`Fail to parse data type='ZodintWrite' error=${e}`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,33 +4,5 @@
|
|||||||
import { z as zod } from "zod";
|
import { z as zod } from "zod";
|
||||||
|
|
||||||
|
|
||||||
export const ZodInteger = zod.object({
|
export const ZodInteger = zod.number().safe();
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export type Integer = zod.infer<typeof ZodInteger>;
|
export type Integer = zod.infer<typeof ZodInteger>;
|
||||||
|
|
||||||
export function isInteger(data: any): data is Integer {
|
|
||||||
try {
|
|
||||||
ZodInteger.parse(data);
|
|
||||||
return true;
|
|
||||||
} catch (e: any) {
|
|
||||||
console.log(`Fail to parse data type='ZodInteger' error=${e}`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export const ZodIntegerWrite = zod.object({
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export type IntegerWrite = zod.infer<typeof ZodIntegerWrite>;
|
|
||||||
|
|
||||||
export function isIntegerWrite(data: any): data is IntegerWrite {
|
|
||||||
try {
|
|
||||||
ZodIntegerWrite.parse(data);
|
|
||||||
return true;
|
|
||||||
} catch (e: any) {
|
|
||||||
console.log(`Fail to parse data type='ZodIntegerWrite' error=${e}`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
import { z as zod } from "zod";
|
import { z as zod } from "zod";
|
||||||
|
|
||||||
import {ZodUUID} from "./uuid";
|
import {ZodUUID} from "./uuid";
|
||||||
import {Zodint, ZodintWrite } from "./int";
|
import {ZodInteger} from "./integer";
|
||||||
|
|
||||||
export const ZodRestErrorResponse = zod.object({
|
export const ZodRestErrorResponse = zod.object({
|
||||||
uuid: ZodUUID.optional(),
|
uuid: ZodUUID.optional(),
|
||||||
name: zod.string(),
|
name: zod.string(),
|
||||||
message: zod.string(),
|
message: zod.string(),
|
||||||
time: zod.string(),
|
time: zod.string(),
|
||||||
status: Zodint,
|
status: ZodInteger,
|
||||||
statusMessage: zod.string(),
|
statusMessage: zod.string(),
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
/**
|
|
||||||
* Interface of the server (auto-generated code)
|
|
||||||
*/
|
|
||||||
import { z as zod } from "zod";
|
|
||||||
|
|
||||||
import {ZodLong} from "./long";
|
|
||||||
|
|
||||||
export const ZodUserOut = zod.object({
|
|
||||||
id: ZodLong,
|
|
||||||
login: zod.string().max(255).optional(),
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export type UserOut = zod.infer<typeof ZodUserOut>;
|
|
||||||
|
|
||||||
export function isUserOut(data: any): data is UserOut {
|
|
||||||
try {
|
|
||||||
ZodUserOut.parse(data);
|
|
||||||
return true;
|
|
||||||
} catch (e: any) {
|
|
||||||
console.log(`Fail to parse data type='ZodUserOut' error=${e}`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export const ZodUserOutWrite = zod.object({
|
|
||||||
id: ZodLong,
|
|
||||||
login: zod.string().max(255).nullable().optional(),
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
export type UserOutWrite = zod.infer<typeof ZodUserOutWrite>;
|
|
||||||
|
|
||||||
export function isUserOutWrite(data: any): data is UserOutWrite {
|
|
||||||
try {
|
|
||||||
ZodUserOutWrite.parse(data);
|
|
||||||
return true;
|
|
||||||
} catch (e: any) {
|
|
||||||
console.log(`Fail to parse data type='ZodUserOutWrite' error=${e}`);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
import { ReactElement } from 'react';
|
import { ReactElement, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { Box, BoxProps } from '@chakra-ui/react';
|
import { Box, BoxProps, Flex } from '@chakra-ui/react';
|
||||||
import { Image } from '@chakra-ui/react';
|
import { Image } from '@chakra-ui/react';
|
||||||
|
|
||||||
import { DataUrlAccess } from '@/utils/data-url-access';
|
import { DataUrlAccess } from '@/utils/data-url-access';
|
||||||
@ -17,6 +17,9 @@ export const Covers = ({
|
|||||||
size = '100px',
|
size = '100px',
|
||||||
...rest
|
...rest
|
||||||
}: CoversProps) => {
|
}: CoversProps) => {
|
||||||
|
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
||||||
|
const [previousImageIndex, setPreviousImageIndex] = useState(0);
|
||||||
|
const [topOpacity, setTopOpacity] = useState(0.0);
|
||||||
if (!data || data.length < 1) {
|
if (!data || data.length < 1) {
|
||||||
if (iconEmpty) {
|
if (iconEmpty) {
|
||||||
return iconEmpty;
|
return iconEmpty;
|
||||||
@ -35,6 +38,48 @@ export const Covers = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const url = DataUrlAccess.getThumbnailUrl(data[0]);
|
if (data.length == 1) {
|
||||||
return <Image loading="lazy" src={url} boxSize={size} {...rest} />;
|
const url = DataUrlAccess.getThumbnailUrl(data[0]);
|
||||||
|
return <Image loading="lazy" src={url} boxSize={size} {...rest} />;
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
setPreviousImageIndex(currentImageIndex);
|
||||||
|
setTopOpacity(0.0);
|
||||||
|
setTimeout(() => {
|
||||||
|
setCurrentImageIndex((prevIndex) => (prevIndex + 1) % data.length);
|
||||||
|
setTopOpacity(1.0);
|
||||||
|
}, 1500);
|
||||||
|
}, 3000);
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}, []);
|
||||||
|
const urlCurrent = DataUrlAccess.getThumbnailUrl(data[currentImageIndex]);
|
||||||
|
const urlPrevious = DataUrlAccess.getThumbnailUrl(data[previousImageIndex]);
|
||||||
|
return <Flex position="relative" {...rest} maxWidth={size} width={size} height={size} overflow="hidden" border="1px">
|
||||||
|
<Image
|
||||||
|
src={urlPrevious}
|
||||||
|
loading="lazy"
|
||||||
|
position="absolute"
|
||||||
|
top="0"
|
||||||
|
left="0"
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
zIndex={1}
|
||||||
|
boxSize={size}
|
||||||
|
/>
|
||||||
|
<Image
|
||||||
|
src={urlCurrent}
|
||||||
|
loading="lazy"
|
||||||
|
position="absolute"
|
||||||
|
top="0"
|
||||||
|
left="0"
|
||||||
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
boxSize={size}
|
||||||
|
transition="opacity 0.5s ease-in-out"
|
||||||
|
opacity={topOpacity}
|
||||||
|
zIndex={2}
|
||||||
|
border="1px"
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
};
|
};
|
||||||
|
@ -23,6 +23,7 @@ export const DisplayAlbum = ({ dataAlbum }: DisplayAlbumProps) => {
|
|||||||
data={dataAlbum?.covers}
|
data={dataAlbum?.covers}
|
||||||
size="100"
|
size="100"
|
||||||
height="full"
|
height="full"
|
||||||
|
flex={1}
|
||||||
iconEmpty={<LuDisc3 size="100" height="full" />}
|
iconEmpty={<LuDisc3 size="100" height="full" />}
|
||||||
/>
|
/>
|
||||||
<Flex
|
<Flex
|
||||||
|
@ -35,7 +35,7 @@ import { isNullOrUndefined } from '@/utils/validator';
|
|||||||
|
|
||||||
export type AlbumEditPopUpProps = {};
|
export type AlbumEditPopUpProps = {};
|
||||||
|
|
||||||
export const AlbumEditPopUp = ({}: AlbumEditPopUpProps) => {
|
export const AlbumEditPopUp = ({ }: AlbumEditPopUpProps) => {
|
||||||
const { albumId } = useParams();
|
const { albumId } = useParams();
|
||||||
const albumIdInt = isNullOrUndefined(albumId)
|
const albumIdInt = isNullOrUndefined(albumId)
|
||||||
? undefined
|
? undefined
|
||||||
@ -91,15 +91,10 @@ export const AlbumEditPopUp = ({}: AlbumEditPopUpProps) => {
|
|||||||
if (isNullOrUndefined(albumIdInt)) {
|
if (isNullOrUndefined(albumIdInt)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// no real need the wrapper must be able to set optional the uri our file ...
|
|
||||||
const plop = new File([], 'emptyFile.txt', {
|
|
||||||
type: 'text/plain',
|
|
||||||
});
|
|
||||||
store.update(
|
store.update(
|
||||||
AlbumResource.uploadCover({
|
AlbumResource.uploadCover({
|
||||||
restConfig: session.getRestConfig(),
|
restConfig: session.getRestConfig(),
|
||||||
data: {
|
data: {
|
||||||
file: plop,
|
|
||||||
uri: uri,
|
uri: uri,
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
@ -121,7 +116,6 @@ export const AlbumEditPopUp = ({}: AlbumEditPopUpProps) => {
|
|||||||
restConfig: session.getRestConfig(),
|
restConfig: session.getRestConfig(),
|
||||||
data: {
|
data: {
|
||||||
file: files[0],
|
file: files[0],
|
||||||
uri: null,
|
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
id: albumIdInt,
|
id: albumIdInt,
|
||||||
|
@ -35,7 +35,7 @@ import { isNullOrUndefined } from '@/utils/validator';
|
|||||||
|
|
||||||
export type ArtistEditPopUpProps = {};
|
export type ArtistEditPopUpProps = {};
|
||||||
|
|
||||||
export const ArtistEditPopUp = ({}: ArtistEditPopUpProps) => {
|
export const ArtistEditPopUp = ({ }: ArtistEditPopUpProps) => {
|
||||||
const { artistId } = useParams();
|
const { artistId } = useParams();
|
||||||
const artistIdInt = isNullOrUndefined(artistId)
|
const artistIdInt = isNullOrUndefined(artistId)
|
||||||
? undefined
|
? undefined
|
||||||
@ -91,15 +91,10 @@ export const ArtistEditPopUp = ({}: ArtistEditPopUpProps) => {
|
|||||||
if (isNullOrUndefined(artistIdInt)) {
|
if (isNullOrUndefined(artistIdInt)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// no real need the wrapper must be able to set optional the uri our file ...
|
|
||||||
const plop = new File([], 'emptyFile.txt', {
|
|
||||||
type: 'text/plain',
|
|
||||||
});
|
|
||||||
store.update(
|
store.update(
|
||||||
ArtistResource.uploadCover({
|
ArtistResource.uploadCover({
|
||||||
restConfig: session.getRestConfig(),
|
restConfig: session.getRestConfig(),
|
||||||
data: {
|
data: {
|
||||||
file: plop,
|
|
||||||
uri: uri,
|
uri: uri,
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
@ -120,7 +115,6 @@ export const ArtistEditPopUp = ({}: ArtistEditPopUpProps) => {
|
|||||||
restConfig: session.getRestConfig(),
|
restConfig: session.getRestConfig(),
|
||||||
data: {
|
data: {
|
||||||
file: files[0],
|
file: files[0],
|
||||||
uri: null,
|
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
id: artistIdInt,
|
id: artistIdInt,
|
||||||
|
@ -35,7 +35,7 @@ import { isNullOrUndefined } from '@/utils/validator';
|
|||||||
|
|
||||||
export type GenderEditPopUpProps = {};
|
export type GenderEditPopUpProps = {};
|
||||||
|
|
||||||
export const GenderEditPopUp = ({}: GenderEditPopUpProps) => {
|
export const GenderEditPopUp = ({ }: GenderEditPopUpProps) => {
|
||||||
const { genderId } = useParams();
|
const { genderId } = useParams();
|
||||||
const genderIdInt = isNullOrUndefined(genderId)
|
const genderIdInt = isNullOrUndefined(genderId)
|
||||||
? undefined
|
? undefined
|
||||||
@ -90,15 +90,10 @@ export const GenderEditPopUp = ({}: GenderEditPopUpProps) => {
|
|||||||
if (isNullOrUndefined(genderIdInt)) {
|
if (isNullOrUndefined(genderIdInt)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// no real need the wrapper must be able to set optional the uri our file ...
|
|
||||||
const plop = new File([], 'emptyFile.txt', {
|
|
||||||
type: 'text/plain',
|
|
||||||
});
|
|
||||||
store.update(
|
store.update(
|
||||||
GenderResource.uploadCover({
|
GenderResource.uploadCover({
|
||||||
restConfig: session.getRestConfig(),
|
restConfig: session.getRestConfig(),
|
||||||
data: {
|
data: {
|
||||||
file: plop,
|
|
||||||
uri: uri,
|
uri: uri,
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
@ -119,7 +114,6 @@ export const GenderEditPopUp = ({}: GenderEditPopUpProps) => {
|
|||||||
restConfig: session.getRestConfig(),
|
restConfig: session.getRestConfig(),
|
||||||
data: {
|
data: {
|
||||||
file: files[0],
|
file: files[0],
|
||||||
uri: null,
|
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
id: genderIdInt,
|
id: genderIdInt,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user