Ignore:
Timestamp:
01/12/21 02:42:18 (4 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
a70db1a
Parents:
8f1f460
Message:

bugfixes and refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/tinki/bootstrap/DataHolder.java

    r8f1f460 r33d4f5d  
    1111
    1212import javax.annotation.PostConstruct;
     13import java.text.DateFormat;
    1314import java.util.ArrayList;
     15import java.util.Date;
    1416import java.util.List;
    1517
     
    6163        lista = this.skillRepository.findAll();
    6264
    63         List<Skill> l2 = new ArrayList<>();
    64         l2.add(this.skillRepository.findById(3L).get());
    65         l2.add(this.skillRepository.findById(2L).get());
    66         l2.add(this.skillRepository.findById(4L).get());
    67         l2.add(this.skillRepository.findById(7L).get());
    68         l2.add(this.skillRepository.findById(1L).get());
    69         l2.add(this.skillRepository.findById(5L).get());
    70         l2.add(this.skillRepository.findById(9L).get());
    71         l2.add(this.skillRepository.findById(6L).get());
     65        List<Skill> lista2 = new ArrayList<>();
     66        lista2.add(this.skillRepository.findById(3L).get());
     67        lista2.add(this.skillRepository.findById(2L).get());
     68        lista2.add(this.skillRepository.findById(4L).get());
     69        lista2.add(this.skillRepository.findById(7L).get());
     70        lista2.add(this.skillRepository.findById(1L).get());
     71        lista2.add(this.skillRepository.findById(5L).get());
     72        lista2.add(this.skillRepository.findById(9L).get());
     73        lista2.add(this.skillRepository.findById(6L).get());
    7274
    7375
    74         List<Skill> l3 = new ArrayList<>();
    75         l3.add(this.skillRepository.findById(3L).get());
    76         l3.add(this.skillRepository.findById(2L).get());
    77         l3.add(this.skillRepository.findById(4L).get());
    78         l3.add(this.skillRepository.findById(7L).get());
     76        List<Skill> lista3 = new ArrayList<>();
     77        lista3.add(this.skillRepository.findById(3L).get());
     78        lista3.add(this.skillRepository.findById(2L).get());
     79        lista3.add(this.skillRepository.findById(4L).get());
     80        lista3.add(this.skillRepository.findById(7L).get());
    7981
    80         List<Long> ids = new ArrayList<>();
     82        List<Long> allSkills = new ArrayList<>();
    8183        lista.forEach(item -> {
    82             ids.add(item.getId());
     84            allSkills.add(item.getId());
    8385        });
    8486
    85         List<Long> smalls = new ArrayList<>();
    86         l2.forEach(item -> {
    87             smalls.add(item.getId());
     87        List<Long> skills8 = new ArrayList<>();
     88        lista2.forEach(item -> {
     89            skills8.add(item.getId());
    8890        });
    8991
    90         List<Long> sm2 = new ArrayList<>();
    91         l3.forEach(item -> {
    92             sm2.add(item.getId());
     92        List<Long> skills4 = new ArrayList<>();
     93        lista3.forEach(item -> {
     94            skills4.add(item.getId());
    9395        });
    9496
    95         Account c = this.accountService.registerCompany("company@company", "company", "Co.co", "Macedonia", "Skopje", "Pero Nakov");
     97        Account c = this.accountService.registerCompany("company@company", "company", "Co.Co", "Macedonia", "Skopje", "Pero Nakov");
     98        Account ct = this.accountService.registerCompany("company@co", "company", "Co.Co", "Macedonia", "Skopje", "Pero Nakov");
    9699        Account m = this.accountService.registerTeam("team@team", "team", "TeamRocket", 3);
    97100
    98         this.workService.insertJob("asdfq", "asdfqw", m.getId() ,5000, smalls, AccountType.TEAM);
    99         this.workService.insertJob("asdfq", "asdfqw", c.getId() ,5000, sm2, AccountType.COMPANY);
    100         this.workService.insertJob("Asdf", "Asdfa", c.getId() ,5000, ids, AccountType.COMPANY);
    101         this.workService.insertJob("Asdf", "Asdfa", m.getId() ,5000, ids, AccountType.TEAM);
     101        this.workService.insertJob("Team Job 1", "Team job 1 requires 3 members!", m.getId() ,1515, allSkills, AccountType.TEAM);
     102        this.workService.insertJob("Team Job 2", "Team job 2 requires 2 members!", m.getId() ,5511, skills4, AccountType.TEAM);
     103        this.workService.insertJob("Company Job 1", "Company job 1 requires 3 members!", c.getId() ,12345, allSkills, AccountType.COMPANY);
     104        this.workService.insertJob("Company Job 2", "Company job 2 requires 3 members!", ct.getId() ,8901, skills8, AccountType.COMPANY);
     105        this.workService.insertInternship("Internship 1", "Opportunity to learn new things!", c.getId() ,5000, skills4, 6, AccountType.COMPANY);
     106        this.workService.insertInternship("Internship 2", "Opportunity to learn new things!", c.getId() ,5000, allSkills, 3, AccountType.COMPANY);
     107        this.workService.insertProject("Project 1", "Project that lasts few days!", m.getId() ,5000, skills8, new Date(), AccountType.TEAM);
     108        this.workService.insertProject("Project 2", "Project that ends soon!", m.getId() ,5000, skills4, new Date(), AccountType.TEAM);
    102109
    103         this.accountService.registerUser("user@user", "user", "Zoki", "Poki", l3, lista);
     110        this.accountService.registerUser("user@user", "user", "Zoki", "Poki", lista3, lista);
    104111
    105112    }
Note: See TracChangeset for help on using the changeset viewer.