Added info about commiter to comision entity
This commit is contained in:
@ -82,7 +82,7 @@ public class CommisionController extends TokenBasedController {
|
||||
Assert.isTrue(!notExistingGroup.isPresent(), "Group "
|
||||
+ notExistingGroup.orElse(Long.MIN_VALUE).toString() + "doesn't exist");
|
||||
|
||||
final Commision com = new Commision(user);
|
||||
final Commision com = new Commision(user, asker);
|
||||
this.commisionService.save(com);
|
||||
|
||||
groups.stream().forEach((groupId) -> {
|
||||
|
@ -10,12 +10,29 @@ public class CommisionResponse {
|
||||
@ApiModelProperty(value = "ID created by database")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "ID of user that commision belongs to")
|
||||
private UserResponse owner;
|
||||
|
||||
@ApiModelProperty(value = "ID of user that created commision")
|
||||
private UserResponse commiter;
|
||||
|
||||
@ApiModelProperty(value = "Timestamp where the user commit the commision")
|
||||
private String commisionDate;
|
||||
|
||||
public CommisionResponse(Commision commision) {
|
||||
this.id = commision.getId();
|
||||
this.commisionDate = commision.getCommisionDate().toString();
|
||||
this.owner = commision.getCommisionOwner() != null ? new UserResponse(commision.getCommisionOwner()) : null;
|
||||
this.commiter = commision.getCommisionCommiter() != null ? new UserResponse(commision.getCommisionCommiter())
|
||||
: null;
|
||||
}
|
||||
|
||||
public UserResponse getCommiter() {
|
||||
return commiter;
|
||||
}
|
||||
|
||||
public UserResponse getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public String getCommisionDate() {
|
||||
|
Reference in New Issue
Block a user