Last change
on this file since 8f1f460 was bd46dbb, checked in by Vzdra <vladko.zdravkovski@…>, 3 years ago |
refactoring and response dto
|
-
Property mode
set to
100644
|
File size:
838 bytes
|
Rev | Line | |
---|
[bd46dbb] | 1 | package it.finki.tinki.model.dto.response.work;
|
---|
[4cec0a3] | 2 |
|
---|
| 3 | import it.finki.tinki.model.Address;
|
---|
[bd46dbb] | 4 | import it.finki.tinki.model.Work.Job;
|
---|
[4cec0a3] | 5 | import it.finki.tinki.model.Users.Company;
|
---|
| 6 | import it.finki.tinki.model.Users.Team;
|
---|
| 7 | import it.finki.tinki.model.enumerator.AccountType;
|
---|
| 8 | import lombok.Data;
|
---|
| 9 |
|
---|
| 10 | @Data
|
---|
[bd46dbb] | 11 | public class JobResponseDTO extends WorkResponseDTO {
|
---|
[4cec0a3] | 12 | Address accountAddress;
|
---|
| 13 | int members;
|
---|
| 14 |
|
---|
| 15 | public JobResponseDTO(Job job){
|
---|
[bd46dbb] | 16 | super(job.getId(), job.getTitle(), job.getDescription(), job.getSalary(), job.getAccount());
|
---|
[4cec0a3] | 17 | if(job.getAccount().getAccountType()==AccountType.COMPANY){
|
---|
| 18 | this.accountAddress = ((Company) job.getAccount()).getAddress();
|
---|
| 19 | this.members = 0;
|
---|
| 20 | }else{
|
---|
| 21 | this.members = ((Team) job.getAccount()).getMembers();
|
---|
| 22 | this.accountAddress = null;
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.