diff --git a/back/pom.xml b/back/pom.xml
index e92b4c3..b156f48 100644
--- a/back/pom.xml
+++ b/back/pom.xml
@@ -6,8 +6,8 @@
3.1
- 17
- 17
+ 21
+ 21
3.1.1
diff --git a/back/src/org/kar/karusic/WebLauncherLocal.java b/back/src/org/kar/karusic/WebLauncherLocal.java
index aef9a96..0bb15bb 100755
--- a/back/src/org/kar/karusic/WebLauncherLocal.java
+++ b/back/src/org/kar/karusic/WebLauncherLocal.java
@@ -6,9 +6,9 @@ import org.slf4j.LoggerFactory;
public class WebLauncherLocal extends WebLauncher {
final Logger logger = LoggerFactory.getLogger(WebLauncherLocal.class);
-
+
private WebLauncherLocal() {}
-
+
public static void main(final String[] args) throws InterruptedException {
final WebLauncherLocal launcher = new WebLauncherLocal();
launcher.process();
@@ -16,14 +16,14 @@ public class WebLauncherLocal extends WebLauncher {
Thread.currentThread().join();
launcher.logger.info("STOP the REST server:");
}
-
+
@Override
public void process() throws InterruptedException {
if (true) {
// for local test:
ConfigBaseVariable.apiAdress = "http://0.0.0.0:19080/karusic/api/";
//ConfigBaseVariable.ssoAdress = "https://atria-soft.org/karso/api/";
- ConfigBaseVariable.dbPort = "3307";
+ ConfigBaseVariable.dbPort = "3906";
}
try {
super.migrateDB();
diff --git a/back/src/org/kar/karusic/api/AlbumResource.java b/back/src/org/kar/karusic/api/AlbumResource.java
index c29574f..bf22c04 100644
--- a/back/src/org/kar/karusic/api/AlbumResource.java
+++ b/back/src/org/kar/karusic/api/AlbumResource.java
@@ -14,8 +14,8 @@ import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PATCH;
import jakarta.ws.rs.POST;
-import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
@@ -25,28 +25,28 @@ import jakarta.ws.rs.core.Response;
@Path("/album")
@Produces({ MediaType.APPLICATION_JSON })
public class AlbumResource {
-
+
@GET
@Path("{id}")
@RolesAllowed("USER")
public static Album getWithId(@PathParam("id") final Long id) throws Exception {
return DataAccess.get(Album.class, id);
}
-
+
@GET
@RolesAllowed("USER")
public List get() throws Exception {
return DataAccess.gets(Album.class);
}
-
+
@POST
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
public Album post(final String jsonRequest) throws Exception {
return DataAccess.insertWithJson(Album.class, jsonRequest);
}
-
- @PUT
+
+ @PATCH
@Path("{id}")
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
@@ -54,7 +54,7 @@ public class AlbumResource {
DataAccess.updateWithJson(Album.class, id, jsonRequest);
return DataAccess.get(Album.class, id);
}
-
+
@DELETE
@Path("{id}")
@RolesAllowed("ADMIN")
@@ -62,7 +62,7 @@ public class AlbumResource {
DataAccess.delete(Album.class, id);
return Response.ok().build();
}
-
+
@POST
@Path("{id}/add_track/{trackId}")
@RolesAllowed("ADMIN")
@@ -71,7 +71,7 @@ public class AlbumResource {
AddOnManyToMany.removeLink(Album.class, id, "track", trackId);
return DataAccess.get(Album.class, id);
}
-
+
@GET
@Path("{id}/rm_track/{trackId}")
@RolesAllowed("ADMIN")
@@ -79,7 +79,7 @@ public class AlbumResource {
AddOnManyToMany.removeLink(Album.class, id, "track", trackId);
return DataAccess.get(Album.class, id);
}
-
+
@POST
@Path("{id}/add_cover")
@RolesAllowed("ADMIN")
@@ -88,7 +88,7 @@ public class AlbumResource {
@FormDataParam("file") final FormDataContentDisposition fileMetaData) {
return DataTools.uploadCover(Album.class, id, fileName, fileInputStream, fileMetaData);
}
-
+
@GET
@Path("{id}/rm_cover/{coverId}")
@RolesAllowed("ADMIN")
diff --git a/back/src/org/kar/karusic/api/ArtistResource.java b/back/src/org/kar/karusic/api/ArtistResource.java
index d83da4e..415ace9 100644
--- a/back/src/org/kar/karusic/api/ArtistResource.java
+++ b/back/src/org/kar/karusic/api/ArtistResource.java
@@ -14,8 +14,8 @@ import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PATCH;
import jakarta.ws.rs.POST;
-import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
@@ -25,28 +25,28 @@ import jakarta.ws.rs.core.Response;
@Path("/artist")
@Produces({ MediaType.APPLICATION_JSON })
public class ArtistResource {
-
+
@GET
@Path("{id}")
@RolesAllowed("USER")
public static Artist getWithId(@PathParam("id") final Long id) throws Exception {
return DataAccess.get(Artist.class, id);
}
-
+
@GET
@RolesAllowed("USER")
public List get() throws Exception {
return DataAccess.gets(Artist.class);
}
-
+
@POST
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
public Artist put(final String jsonRequest) throws Exception {
return DataAccess.insertWithJson(Artist.class, jsonRequest);
}
-
- @PUT
+
+ @PATCH
@Path("{id}")
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
@@ -54,7 +54,7 @@ public class ArtistResource {
DataAccess.updateWithJson(Artist.class, id, jsonRequest);
return DataAccess.get(Artist.class, id);
}
-
+
@DELETE
@Path("{id}")
@RolesAllowed("ADMIN")
@@ -62,7 +62,7 @@ public class ArtistResource {
DataAccess.delete(Artist.class, id);
return Response.ok().build();
}
-
+
@POST
@Path("{id}/add_cover")
@RolesAllowed("ADMIN")
@@ -71,7 +71,7 @@ public class ArtistResource {
@FormDataParam("file") final FormDataContentDisposition fileMetaData) {
return DataTools.uploadCover(Artist.class, id, fileName, fileInputStream, fileMetaData);
}
-
+
@GET
@Path("{id}/rm_cover/{coverId}")
@RolesAllowed("ADMIN")
diff --git a/back/src/org/kar/karusic/api/GenderResource.java b/back/src/org/kar/karusic/api/GenderResource.java
index ce4ec59..93fff2f 100644
--- a/back/src/org/kar/karusic/api/GenderResource.java
+++ b/back/src/org/kar/karusic/api/GenderResource.java
@@ -14,8 +14,8 @@ import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PATCH;
import jakarta.ws.rs.POST;
-import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
@@ -25,28 +25,28 @@ import jakarta.ws.rs.core.Response;
@Path("/gender")
@Produces({ MediaType.APPLICATION_JSON })
public class GenderResource {
-
+
@GET
@Path("{id}")
@RolesAllowed("USER")
public static Gender getWithId(@PathParam("id") final Long id) throws Exception {
return DataAccess.get(Gender.class, id);
}
-
+
@GET
@RolesAllowed("USER")
public List get() throws Exception {
return DataAccess.gets(Gender.class);
}
-
+
@POST
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
public Gender put(final String jsonRequest) throws Exception {
return DataAccess.insertWithJson(Gender.class, jsonRequest);
}
-
- @PUT
+
+ @PATCH
@Path("{id}")
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
@@ -54,7 +54,7 @@ public class GenderResource {
DataAccess.updateWithJson(Gender.class, id, jsonRequest);
return DataAccess.get(Gender.class, id);
}
-
+
@DELETE
@Path("{id}")
@RolesAllowed("ADMIN")
@@ -62,7 +62,7 @@ public class GenderResource {
DataAccess.delete(Gender.class, id);
return Response.ok().build();
}
-
+
@POST
@Path("{id}/add_cover")
@RolesAllowed("ADMIN")
@@ -71,7 +71,7 @@ public class GenderResource {
@FormDataParam("file") final FormDataContentDisposition fileMetaData) {
return DataTools.uploadCover(Gender.class, id, fileName, fileInputStream, fileMetaData);
}
-
+
@GET
@Path("{id}/rm_cover/{coverId}")
@RolesAllowed("ADMIN")
diff --git a/back/src/org/kar/karusic/api/PlaylistResource.java b/back/src/org/kar/karusic/api/PlaylistResource.java
index 367fcac..df6e0d6 100644
--- a/back/src/org/kar/karusic/api/PlaylistResource.java
+++ b/back/src/org/kar/karusic/api/PlaylistResource.java
@@ -14,8 +14,8 @@ import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PATCH;
import jakarta.ws.rs.POST;
-import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
@@ -25,28 +25,28 @@ import jakarta.ws.rs.core.Response;
@Path("/playlist")
@Produces({ MediaType.APPLICATION_JSON })
public class PlaylistResource {
-
+
@GET
@Path("{id}")
@RolesAllowed("USER")
public static Playlist getWithId(@PathParam("id") final Long id) throws Exception {
return DataAccess.get(Playlist.class, id);
}
-
+
@GET
@RolesAllowed("USER")
public List get() throws Exception {
return DataAccess.gets(Playlist.class);
}
-
+
@POST
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
public Playlist put(final String jsonRequest) throws Exception {
return DataAccess.insertWithJson(Playlist.class, jsonRequest);
}
-
- @PUT
+
+ @PATCH
@Path("{id}")
@RolesAllowed("ADMIN")
@Consumes(MediaType.APPLICATION_JSON)
@@ -54,7 +54,7 @@ public class PlaylistResource {
DataAccess.updateWithJson(Playlist.class, id, jsonRequest);
return DataAccess.get(Playlist.class, id);
}
-
+
@DELETE
@Path("{id}")
@RolesAllowed("ADMIN")
@@ -62,7 +62,7 @@ public class PlaylistResource {
DataAccess.delete(Playlist.class, id);
return Response.ok().build();
}
-
+
@POST
@Path("{id}/add_track/{trackId}")
@RolesAllowed("ADMIN")
@@ -71,7 +71,7 @@ public class PlaylistResource {
AddOnManyToMany.removeLink(Playlist.class, id, "track", trackId);
return DataAccess.get(Playlist.class, id);
}
-
+
@GET
@Path("{id}/rm_track/{trackId}")
@RolesAllowed("ADMIN")
@@ -79,7 +79,7 @@ public class PlaylistResource {
AddOnManyToMany.removeLink(Playlist.class, id, "track", trackId);
return DataAccess.get(Playlist.class, id);
}
-
+
@POST
@Path("{id}/add_cover")
@RolesAllowed("ADMIN")
@@ -88,7 +88,7 @@ public class PlaylistResource {
@FormDataParam("file") final FormDataContentDisposition fileMetaData) {
return DataTools.uploadCover(Playlist.class, id, fileName, fileInputStream, fileMetaData);
}
-
+
@GET
@Path("{id}/rm_cover/{coverId}")
@RolesAllowed("ADMIN")
diff --git a/back/src/org/kar/karusic/api/TrackResource.java b/back/src/org/kar/karusic/api/TrackResource.java
index d96d39b..eb713df 100644
--- a/back/src/org/kar/karusic/api/TrackResource.java
+++ b/back/src/org/kar/karusic/api/TrackResource.java
@@ -23,8 +23,8 @@ import jakarta.annotation.security.RolesAllowed;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
+import jakarta.ws.rs.PATCH;
import jakarta.ws.rs.POST;
-import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
@@ -34,28 +34,28 @@ import jakarta.ws.rs.core.Response;
@Path("/track")
@Produces({ MediaType.APPLICATION_JSON })
public class TrackResource {
-
+
@GET
@Path("{id}")
@RolesAllowed("USER")
public static Track getWithId(@PathParam("id") final Long id) throws Exception {
return DataAccess.get(Track.class, id);
}
-
+
@GET
@RolesAllowed("USER")
public List