task(module-web,module-ejb): add CRUD for the BoardGameEntity
This commit is contained in:
parent
7ecd940ab4
commit
ddf0d3862f
@ -1,43 +0,0 @@
|
|||||||
package pl.myboardgames;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import javax.ejb.Stateless;
|
|
||||||
|
|
||||||
@Stateless
|
|
||||||
public class BoardGameDao {
|
|
||||||
|
|
||||||
private Set<BoardGameEntity> boardgames;
|
|
||||||
|
|
||||||
public BoardGameDao() {
|
|
||||||
|
|
||||||
boardgames = new HashSet<>();
|
|
||||||
|
|
||||||
BoardGameEntity boardGame1 = new BoardGameEntity();
|
|
||||||
BoardGameEntity boardGame2 = new BoardGameEntity();
|
|
||||||
boardGame1.setName("Dominion");
|
|
||||||
boardGame2.setName("Agricola");
|
|
||||||
boardGame1.setId(new Long(0));
|
|
||||||
boardGame2.setId(new Long(1));
|
|
||||||
|
|
||||||
boardgames.add(boardGame1);
|
|
||||||
boardgames.add(boardGame2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<BoardGameEntity>getAll() {
|
|
||||||
return boardgames;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BoardGameEntity getById(Long aId) {
|
|
||||||
return boardgames.stream().filter(boardGame -> boardGame.getId().equals(aId)).findFirst().get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BoardGameEntity add(BoardGameEntity aBoardGame) {
|
|
||||||
aBoardGame.setId(Long.valueOf(boardgames.size()+1));
|
|
||||||
boardgames.add(aBoardGame);
|
|
||||||
return aBoardGame;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,62 @@
|
|||||||
|
package pl.myboardgames.boardgame;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import javax.ejb.Stateless;
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.EntityNotFoundException;
|
||||||
|
import javax.persistence.PersistenceContext;
|
||||||
|
import javax.persistence.Query;
|
||||||
|
|
||||||
|
@Stateless
|
||||||
|
public class BoardGameDao {
|
||||||
|
|
||||||
|
@PersistenceContext
|
||||||
|
EntityManager em;
|
||||||
|
|
||||||
|
public BoardGameDao() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<BoardGameEntity>getAll() {
|
||||||
|
Query query = em.createQuery("SELECT u FROM BoardGameEntity u", BoardGameEntity.class);
|
||||||
|
Set<BoardGameEntity> boardGames = new HashSet<BoardGameEntity>(query.getResultList());
|
||||||
|
return boardGames;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoardGameEntity getById(Long aId) {
|
||||||
|
BoardGameEntity boardGame = em.find(BoardGameEntity.class, aId);
|
||||||
|
if (boardGame == null) {
|
||||||
|
throw new EntityNotFoundException("Can't find BoardGame for ID "
|
||||||
|
+ aId);
|
||||||
|
}
|
||||||
|
return boardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoardGameEntity add(BoardGameEntity aBoardGame) {
|
||||||
|
em.persist(aBoardGame);
|
||||||
|
return aBoardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean remove(Long aId) {
|
||||||
|
BoardGameEntity boardGame = em.find(BoardGameEntity.class, aId);
|
||||||
|
if (boardGame == null) {
|
||||||
|
throw new EntityNotFoundException("Can't find BoardGame for ID "
|
||||||
|
+ aId);
|
||||||
|
}
|
||||||
|
em.remove(boardGame);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BoardGameEntity update(Long aId, BoardGameEntity aBoardGame){
|
||||||
|
BoardGameEntity boardGame = em.find(BoardGameEntity.class, aId);
|
||||||
|
if (aBoardGame == null) {
|
||||||
|
throw new EntityNotFoundException("Can't find BoardGame for ID "
|
||||||
|
+ aId);
|
||||||
|
}
|
||||||
|
em.merge(aBoardGame);
|
||||||
|
return boardGame;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,14 +1,18 @@
|
|||||||
package pl.myboardgames;
|
package pl.myboardgames.boardgame;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@Table(name = "boardgames")
|
||||||
public class BoardGameEntity {
|
public class BoardGameEntity {
|
||||||
|
|
||||||
@GeneratedValue
|
|
||||||
@Id
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
@Column(name = "id", updatable = false, nullable = false)
|
||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
private Integer minPlayers;
|
private Integer minPlayers;
|
@ -1,4 +1,4 @@
|
|||||||
package pl.myboardgames;
|
package pl.myboardgames.user;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -10,8 +10,6 @@ import javax.persistence.Query;
|
|||||||
|
|
||||||
@Stateless
|
@Stateless
|
||||||
public class UserDao {
|
public class UserDao {
|
||||||
|
|
||||||
private Set<UserEntity> users;
|
|
||||||
|
|
||||||
@PersistenceContext
|
@PersistenceContext
|
||||||
EntityManager em;
|
EntityManager em;
|
@ -3,7 +3,7 @@
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package pl.myboardgames;
|
package pl.myboardgames.user;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@ -15,9 +15,8 @@ import javax.persistence.Table;
|
|||||||
*
|
*
|
||||||
* @author Nao
|
* @author Nao
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table( name = "users" )
|
@Table(name = "users")
|
||||||
public class UserEntity {
|
public class UserEntity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@ -25,7 +24,8 @@ public class UserEntity {
|
|||||||
@Column(name = "id", updatable = false, nullable = false)
|
@Column(name = "id", updatable = false, nullable = false)
|
||||||
private Long id;
|
private Long id;
|
||||||
private String username;
|
private String username;
|
||||||
private String address;
|
private String description;
|
||||||
|
private String location;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
@ -35,8 +35,12 @@ public class UserEntity {
|
|||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddress() {
|
public String getDescription() {
|
||||||
return address;
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
@ -46,11 +50,13 @@ public class UserEntity {
|
|||||||
public void setUsername(String username) {
|
public void setUsername(String username) {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddress(String address) {
|
public void setDescription(String description) {
|
||||||
this.address = address;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
package pl.myboardgames;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Nao
|
|
||||||
*/
|
|
||||||
public class BoardGameDto {
|
|
||||||
|
|
||||||
private Long id;
|
|
||||||
private String name;
|
|
||||||
private Integer minPlayers;
|
|
||||||
private Integer maxPlayers;
|
|
||||||
private Integer playTime;
|
|
||||||
|
|
||||||
public BoardGameDto() {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public BoardGameDto(BoardGameEntity aBoardGame) {
|
|
||||||
this.name = aBoardGame.getName();
|
|
||||||
this.minPlayers = aBoardGame.getMinPlayers();
|
|
||||||
this.maxPlayers = aBoardGame.getMaxPlayers();
|
|
||||||
this.playTime = aBoardGame.getPlayTime();
|
|
||||||
this.id = aBoardGame.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getMinPlayers() {
|
|
||||||
return minPlayers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getMaxPlayers() {
|
|
||||||
return maxPlayers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getPlayTime() {
|
|
||||||
return playTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,24 +1,25 @@
|
|||||||
package pl.myboardgames;
|
package pl.myboardgames.boardgame;
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.ejb.EJB;
|
import javax.ejb.EJB;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.PathParam;
|
import javax.ws.rs.PathParam;
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
@Path("/board")
|
@Path("/boardgame")
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class BoardGameController {
|
public class BoardGameController {
|
||||||
|
|
||||||
@EJB
|
@EJB
|
||||||
BoardGameDao boardGameDatabase;
|
BoardGameDao boardGameDatabase;
|
||||||
|
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Produces("application/json; charset=UTF-8")
|
@Produces("application/json; charset=UTF-8")
|
||||||
public Response getAllBoardGames() {
|
public Response getAllBoardGames() {
|
||||||
@ -33,7 +34,7 @@ public class BoardGameController {
|
|||||||
BoardGameEntity ret = boardGameDatabase.getById(aId);
|
BoardGameEntity ret = boardGameDatabase.getById(aId);
|
||||||
return Response.status(200).entity(ret).build();
|
return Response.status(200).entity(ret).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Consumes("application/json; charset=UTF-8")
|
@Consumes("application/json; charset=UTF-8")
|
||||||
@Produces("application/json; charset=UTF-8")
|
@Produces("application/json; charset=UTF-8")
|
||||||
@ -42,8 +43,24 @@ public class BoardGameController {
|
|||||||
BoardGameDto ret = new BoardGameDto(boardGameDatabase.add(boardGame));
|
BoardGameDto ret = new BoardGameDto(boardGameDatabase.add(boardGame));
|
||||||
return Response.status(201).entity(ret).build();
|
return Response.status(201).entity(ret).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DELETE
|
||||||
|
@Path("{id}")
|
||||||
|
@Produces("application/json; charset=UTF-8")
|
||||||
|
public Response removeBoardGame(@PathParam("id") Long aId) {
|
||||||
|
Boolean ret = boardGameDatabase.remove(aId);
|
||||||
|
return Response.status(201).entity(ret).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PUT
|
||||||
|
@Path("{id}")
|
||||||
|
@Consumes("application/json; charset=UTF-8")
|
||||||
|
@Produces("application/json; charset=UTF-8")
|
||||||
|
public Response updateBoardGame(BoardGameDto aBoardGame, @PathParam("id") Long aId) {
|
||||||
|
BoardGameEntity boardGame = BoardGameMapper.fromDto(aBoardGame);
|
||||||
|
boardGame.setId(aId);
|
||||||
|
BoardGameDto ret = new BoardGameDto(boardGameDatabase.update(aId, boardGame));
|
||||||
|
return Response.status(201).entity(ret).build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package pl.myboardgames.boardgame;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Nao
|
||||||
|
*/
|
||||||
|
public class BoardGameDto {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private Integer minPlayers;
|
||||||
|
private Integer maxPlayers;
|
||||||
|
private Integer playTime;
|
||||||
|
|
||||||
|
public BoardGameDto(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public BoardGameDto(BoardGameEntity aBoardGame) {
|
||||||
|
name = aBoardGame.getName();
|
||||||
|
minPlayers = aBoardGame.getMinPlayers();
|
||||||
|
maxPlayers = aBoardGame.getMaxPlayers();
|
||||||
|
playTime = aBoardGame.getPlayTime();
|
||||||
|
id = aBoardGame.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMinPlayers() {
|
||||||
|
return minPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMaxPlayers() {
|
||||||
|
return maxPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPlayTime() {
|
||||||
|
return playTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinPlayers(Integer minPlayers) {
|
||||||
|
this.minPlayers = minPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxPlayers(Integer maxPlayers) {
|
||||||
|
this.maxPlayers = maxPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlayTime(Integer playTime) {
|
||||||
|
this.playTime = playTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* To change ret template file, choose Tools | Templates
|
* To change ret template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package pl.myboardgames;
|
package pl.myboardgames.boardgame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -25,6 +25,15 @@ class BoardGameMapper {
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BoardGameEntity fromShortDto(BoardGameShortDto aBoardGame) {
|
||||||
|
BoardGameEntity ret = new BoardGameEntity();
|
||||||
|
|
||||||
|
ret.setName(aBoardGame.getName());
|
||||||
|
ret.setId(aBoardGame.getId());
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package pl.myboardgames;
|
package pl.myboardgames.boardgame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -13,10 +13,26 @@ public class BoardGameShortDto {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
public BoardGameShortDto() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public BoardGameShortDto(BoardGameEntity aBoardGame) {
|
public BoardGameShortDto(BoardGameEntity aBoardGame) {
|
||||||
id = aBoardGame.getId();
|
id = aBoardGame.getId();
|
||||||
name = aBoardGame.getName();
|
name = aBoardGame.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package pl.myboardgames;
|
package pl.myboardgames.user;
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.ejb.EJB;
|
import javax.ejb.EJB;
|
@ -3,7 +3,7 @@
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package pl.myboardgames;
|
package pl.myboardgames.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -13,15 +13,19 @@ public class UserDto {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String username;
|
private String username;
|
||||||
private String address;
|
private String description;
|
||||||
|
private String location;
|
||||||
|
|
||||||
|
|
||||||
public UserDto() {
|
public UserDto() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserDto(UserEntity aUser) {
|
public UserDto(UserEntity aUser) {
|
||||||
username = aUser.getUsername();
|
username = aUser.getUsername();
|
||||||
id = aUser.getId();
|
id = aUser.getId();
|
||||||
|
description = aUser.getDescription();
|
||||||
|
location = aUser.getLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
@ -32,8 +36,16 @@ public class UserDto {
|
|||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddress() {
|
public String getDescription() {
|
||||||
return address;
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(String location) {
|
||||||
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
@ -44,8 +56,8 @@ public class UserDto {
|
|||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddress(String address) {
|
public void setDescription(String description) {
|
||||||
this.address = address;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* To change ret template file, choose Tools | Templates
|
* To change ret template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package pl.myboardgames;
|
package pl.myboardgames.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -17,8 +17,10 @@ class UserMapper {
|
|||||||
public static UserEntity fromDto(UserDto aUser) {
|
public static UserEntity fromDto(UserDto aUser) {
|
||||||
UserEntity ret = new UserEntity();
|
UserEntity ret = new UserEntity();
|
||||||
|
|
||||||
ret.setUsername(aUser.getUsername());
|
|
||||||
ret.setId(aUser.getId());
|
ret.setId(aUser.getId());
|
||||||
|
ret.setUsername(aUser.getUsername());
|
||||||
|
ret.setDescription(aUser.getDescription());
|
||||||
|
ret.setLocation(aUser.getLocation());
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
package pl.myboardgames;
|
package pl.myboardgames.user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -13,12 +13,14 @@ public class UserShortDto {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
private String username;
|
private String username;
|
||||||
private String address;
|
|
||||||
|
public UserShortDto() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public UserShortDto(UserEntity aUser) {
|
public UserShortDto(UserEntity aUser) {
|
||||||
id = aUser.getId();
|
id = aUser.getId();
|
||||||
username = aUser.getUsername();
|
username = aUser.getUsername();
|
||||||
address = aUser.getUsername();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
@ -28,10 +30,6 @@ public class UserShortDto {
|
|||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddress() {
|
|
||||||
return address;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user