mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
Use versioned media type
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package sonia.scm.api.v2.resources;
|
||||
|
||||
public class ScmMediaType {
|
||||
private static final String VERSION = "2";
|
||||
private static final String PREFIX = "application/vnd.scmm-";
|
||||
private static final String SUFFIX = "+json;v=" + VERSION;
|
||||
|
||||
public static final String USER = PREFIX + "user" + SUFFIX;
|
||||
}
|
||||
@@ -18,8 +18,10 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static sonia.scm.api.v2.resources.ScmMediaType.USER;
|
||||
|
||||
@Singleton
|
||||
@Produces("application/vnd.scmm-user+json")
|
||||
@Produces(USER)
|
||||
public class UserCollectionResource extends AbstractManagerResource<User, UserException> {
|
||||
private final UserDto2UserMapper dtoToUserMapper;
|
||||
private final User2UserDtoMapper userToDtoMapper;
|
||||
|
||||
@@ -16,8 +16,10 @@ import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.*;
|
||||
import java.util.Collection;
|
||||
|
||||
import static sonia.scm.api.v2.resources.ScmMediaType.USER;
|
||||
|
||||
@Singleton
|
||||
@Produces("application/vnd.scmm-user+json")
|
||||
@Produces(USER)
|
||||
public class UserSubResource extends AbstractManagerResource<User, UserException> {
|
||||
private final UserDto2UserMapper dtoToUserMapper;
|
||||
private final User2UserDtoMapper userToDtoMapper;
|
||||
|
||||
Reference in New Issue
Block a user