Last change
on this file since 2e507a8 was a70db1a, checked in by Vzdra <vladko.zdravkovski@…>, 3 years ago |
constructor change
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | package it.finki.tinki.model.dto.response.work;
|
---|
2 |
|
---|
3 | import it.finki.tinki.model.Address;
|
---|
4 | import it.finki.tinki.model.Skill;
|
---|
5 | import it.finki.tinki.model.Work.Job;
|
---|
6 | import it.finki.tinki.model.Users.Company;
|
---|
7 | import it.finki.tinki.model.Users.Team;
|
---|
8 | import it.finki.tinki.model.enumerator.AccountType;
|
---|
9 | import lombok.Data;
|
---|
10 |
|
---|
11 | import java.util.List;
|
---|
12 |
|
---|
13 | @Data
|
---|
14 | public class JobResponseDTO extends WorkResponseDTO {
|
---|
15 | Address accountAddress;
|
---|
16 | int members;
|
---|
17 | List<Skill> skillsRequired;
|
---|
18 |
|
---|
19 | public JobResponseDTO(){
|
---|
20 | super("Job!");
|
---|
21 | }
|
---|
22 |
|
---|
23 | public JobResponseDTO(Job job){
|
---|
24 | super(job.getId(), job.getTitle(), job.getDescription(), job.getSalary(), job.getAccount());
|
---|
25 | this.skillsRequired = job.getSkillsRequired();
|
---|
26 | if(job.getAccount().getAccountType()==AccountType.COMPANY){
|
---|
27 | this.accountAddress = ((Company) job.getAccount()).getAddress();
|
---|
28 | this.members = 0;
|
---|
29 | }else{
|
---|
30 | this.members = ((Team) job.getAccount()).getMembers();
|
---|
31 | this.accountAddress = null;
|
---|
32 | }
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.