- Timestamp:
- 01/08/21 00:35:56 (4 years ago)
- Branches:
- master
- Children:
- 4cec0a3
- Parents:
- 509cb95
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/bootstrap/DataHolder.java
r509cb95 ra8e8545 2 2 3 3 import it.finki.tinki.model.Address; 4 import it.finki.tinki.model.EmbeddedMatchId; 5 import it.finki.tinki.model.Jobs.Job; 6 import it.finki.tinki.model.Jobs.Work; 7 import it.finki.tinki.model.Match; 4 8 import it.finki.tinki.model.Skill; 9 import it.finki.tinki.model.Users.Account; 5 10 import it.finki.tinki.model.Users.Company; 6 11 import it.finki.tinki.model.Users.User; 7 12 import it.finki.tinki.model.enumerator.AccountType; 13 import it.finki.tinki.model.enumerator.WorkType; 8 14 import it.finki.tinki.repository.*; 15 import it.finki.tinki.service.AccountService; 16 import it.finki.tinki.service.WorkService; 17 import org.springframework.beans.factory.annotation.Autowired; 9 18 import org.springframework.stereotype.Component; 10 19 … … 17 26 18 27 SkillRepository skillRepository; 19 UserRepository userRepository; 20 CompanyRepository companyRepository; 21 TeamRepository teamRepository; 22 AddressRepository addressRepository; 28 AccountService accountService; 29 WorkService workService; 30 MatchRepository matchRepository; 23 31 24 public DataHolder(SkillRepository skillRepository, UserRepository userRepository, CompanyRepository companyRepository, TeamRepository teamRepository, AddressRepository addressRepository) { 32 public DataHolder(SkillRepository skillRepository, 33 AccountService accountService, 34 WorkService workService, 35 MatchRepository matchRepository) { 25 36 this.skillRepository = skillRepository; 26 this.userRepository = userRepository; 27 this.companyRepository = companyRepository; 28 this.teamRepository = teamRepository; 29 this.addressRepository = addressRepository; 37 this.accountService = accountService; 38 this.workService = workService; 39 this.matchRepository = matchRepository; 30 40 } 31 41 … … 59 69 lista = skillRepository.findAll(); 60 70 61 userRepository.save(new User("asdf", "asdf", "Zoki", AccountType.USER, "Poki", lista, lista)); 71 List<Long> ids = new ArrayList<>(); 72 lista.forEach(item -> { 73 ids.add(item.getId()); 74 }); 62 75 63 addressRepository.save(new Address("asdf", "asdf", "asdf")); 64 companyRepository.save(new Company("asdf@asdf", "pass", "Co.co", AccountType.COMPANY, addressRepository.findAll().get(0))); 76 Account c = this.accountService.registerCompany("asdf@asdf", "pass", "Co.co", "Macedonia", "Skopje", "Pero Nakov"); 77 78 Job j = this.workService.insertJob("Asdf", "Asdfa", c.getId() ,5000, ids, AccountType.COMPANY); 79 80 Account u = this.accountService.registerUser("asdf", "asdf", "Zoki", "Poki", lista, lista); 81 65 82 } 66 83
Note:
See TracChangeset
for help on using the changeset viewer.