[DEV] better get user interface (no propagate password
This commit is contained in:
parent
c845ab6847
commit
0c5f524906
@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.kar</groupId>
|
<groupId>org.kar</groupId>
|
||||||
<artifactId>karso</artifactId>
|
<artifactId>karso</artifactId>
|
||||||
<version>0.2.0</version>
|
<version>0.3.0</version>
|
||||||
<properties>
|
<properties>
|
||||||
<!--
|
<!--
|
||||||
<jaxb.version>2.3.1</jaxb.version>
|
<jaxb.version>2.3.1</jaxb.version>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>kangaroo-and-rabbit</groupId>
|
<groupId>kangaroo-and-rabbit</groupId>
|
||||||
<artifactId>archidata</artifactId>
|
<artifactId>archidata</artifactId>
|
||||||
<version>0.2.2</version>
|
<version>0.2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- testing -->
|
<!-- testing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -34,16 +34,16 @@ public class UserResource {
|
|||||||
}
|
}
|
||||||
@GET
|
@GET
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public List<UserAuth> getUsers() throws Exception {
|
public List<UserAuthGet> getUsers() throws Exception {
|
||||||
return SqlWrapper.gets(UserAuth.class, false);
|
return SqlWrapper.gets(UserAuthGet.class, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@RolesAllowed("ADMIN")
|
@RolesAllowed("ADMIN")
|
||||||
public UserAuth getUser(@Context SecurityContext sc, @PathParam("id") long userId) throws Exception {
|
public UserAuthGet getUser(@Context SecurityContext sc, @PathParam("id") long userId) throws Exception {
|
||||||
GenericContext gc = (GenericContext) sc.getUserPrincipal();
|
GenericContext gc = (GenericContext) sc.getUserPrincipal();
|
||||||
return SqlWrapper.get(UserAuth.class, userId);
|
return SqlWrapper.get(UserAuthGet.class, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
24
back/src/org/kar/karso/model/UserAuthGet.java
Normal file
24
back/src/org/kar/karso/model/UserAuthGet.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package org.kar.karso.model;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
|
import org.kar.archidata.annotation.SQLDefault;
|
||||||
|
import org.kar.archidata.annotation.SQLIfNotExists;
|
||||||
|
import org.kar.archidata.annotation.SQLLimitSize;
|
||||||
|
import org.kar.archidata.annotation.SQLNotNull;
|
||||||
|
import org.kar.archidata.annotation.SQLTableName;
|
||||||
|
import org.kar.archidata.model.User;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
|
||||||
|
@SQLTableName ("user")
|
||||||
|
@SQLIfNotExists
|
||||||
|
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
|
||||||
|
public class UserAuthGet extends User {
|
||||||
|
@SQLLimitSize(512)
|
||||||
|
@SQLNotNull
|
||||||
|
public String email;
|
||||||
|
@SQLDefault("'0'")
|
||||||
|
@SQLNotNull
|
||||||
|
public boolean avatar = false;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user