Changeset b31afbd for src


Ignore:
Timestamp:
01/08/21 03:13:23 (4 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
336d09e
Parents:
b24fe9b
Message:

fixed some bugs and finalized user registration

Location:
src/main
Files:
1 added
6 edited

Legend:

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

    rb24fe9b rb31afbd  
    7171        List<Skill> l2 = new ArrayList<>();
    7272        l2.add(skillRepository.getOne(3L));
    73         l2.add(skillRepository.getOne(0L));
     73        l2.add(skillRepository.getOne(10L));
    7474        l2.add(skillRepository.getOne(1L));
    7575        l2.add(skillRepository.getOne(2L));
     
    8282        List<Skill> l3 = new ArrayList<>();
    8383        l3.add(skillRepository.getOne(3L));
    84         l3.add(skillRepository.getOne(0L));
     84        l3.add(skillRepository.getOne(10L));
    8585        l3.add(skillRepository.getOne(5L));
    8686        l3.add(skillRepository.getOne(6L));
     
    105105        Account m = this.accountService.registerTeam("asdf", "asd", "TeamRocket", 3);
    106106
     107        Job z = this.workService.insertJob("asdfq", "asdfqw", m.getId() ,5000, smalls, AccountType.TEAM);
     108        Job n = this.workService.insertJob("asdfq", "asdfqw", c.getId() ,5000, sm2, AccountType.COMPANY);
    107109        Job j = this.workService.insertJob("Asdf", "Asdfa", c.getId() ,5000, ids, AccountType.COMPANY);
    108110        Job k = this.workService.insertJob("Asdf", "Asdfa", m.getId() ,5000, ids, AccountType.TEAM);
    109         Job z = this.workService.insertJob("asdfq", "asdfqw", m.getId() ,5000, smalls, AccountType.TEAM);
    110         Job n = this.workService.insertJob("asdfq", "asdfqw", c.getId() ,5000, sm2, AccountType.COMPANY);
    111111
    112         Account u = this.accountService.registerUser("asdf", "asdf", "Zoki", "Poki", lista, lista);
     112        Account u = this.accountService.registerUser("asdf", "asdfq", "Zoki", "Poki", lista, lista);
    113113
    114114    }
  • src/main/java/it/finki/tinki/model/Users/Account.java

    rb24fe9b rb31afbd  
    11package it.finki.tinki.model.Users;
    22
     3import com.sun.istack.NotNull;
    34import it.finki.tinki.model.enumerator.AccountType;
    45import lombok.Data;
     
    1617
    1718    @Column(unique = true)
     19    @NotNull
    1820    String email;
    1921
     22    @NotNull
    2023    String password;
    2124
     25    @NotNull
    2226    String name;
    2327
  • src/main/java/it/finki/tinki/model/Users/User.java

    rb24fe9b rb31afbd  
    2929        this.skillsToLearn = skillsToLearn;
    3030    }
     31
     32    public String toString(){
     33        return "";
     34    }
    3135}
  • src/main/java/it/finki/tinki/service/impl/MatchmakerServiceImpl.java

    rb24fe9b rb31afbd  
    6161        if(matches.size()!=0) {
    6262            matches.forEach(match -> {
     63                System.out.println(match.getCoefficient());
    6364                jobs.add((Job) match.getEmbeddedMatchId().getWork());
    6465            });
  • src/main/java/it/finki/tinki/web/controller/RegisterController.java

    rb24fe9b rb31afbd  
    88import it.finki.tinki.model.Users.Account;
    99import it.finki.tinki.model.Users.User;
     10import it.finki.tinki.model.dto.UserRegisterDTO;
    1011import it.finki.tinki.service.AccountService;
    1112import it.finki.tinki.service.MatchmakerService;
     
    3637
    3738    @RequestMapping(path = "/user", method = RequestMethod.POST)
    38     private Map<String, String> registerUser(@RequestParam String email,
    39                                              @RequestParam String password,
    40                                              @RequestParam String name,
    41                                              @RequestParam String surname,
    42                                              @RequestParam List<Long> retainedSkills,
    43                                              @RequestParam List<Long> skillsToLearn){
     39    private Map<String, String> registerUser(@RequestBody UserRegisterDTO body){
    4440
    45         List<Skill> retained = this.skillService.returnSkillsBasedOnId(retainedSkills);
    46         List<Skill> toLearn = this.skillService.returnSkillsBasedOnId(skillsToLearn);
     41        List<Skill> retained = this.skillService.returnSkillsBasedOnId(body.getRetainedSkills());
     42        List<Skill> toLearn = this.skillService.returnSkillsBasedOnId(body.getSkillsToLearn());
    4743
    48         Account k = this.accountService.registerUser(email, password, name, surname, retained, toLearn);
     44        Account k = this.accountService.registerUser(body.getEmail(), body.getPassword(), body.getName(), body.getSurname(), retained, toLearn);
    4945
    5046        Map<String, String> response = new HashMap<>();
     
    6056
    6157    @RequestMapping(path = "/team", method = RequestMethod.POST)
    62     private Map<String, String> registerTeam(@RequestParam String email,
    63                                              @RequestParam String password,
    64                                              @RequestParam String name,
    65                                              @RequestParam int members){
     58    private Map<String, String> registerTeam(@RequestBody String email,
     59                                             @RequestBody String password,
     60                                             @RequestBody String name,
     61                                             @RequestBody int members){
    6662
    6763        Account k = this.accountService.registerTeam(email, password, name, members);
     
    7975
    8076    @RequestMapping(path = "/company", method = RequestMethod.POST)
    81     private Map<String, String> registeCompany(@RequestParam String email,
    82                                                @RequestParam String password,
    83                                                @RequestParam String name,
    84                                                @RequestParam String country,
    85                                                @RequestParam String city,
    86                                                @RequestParam String street){
     77    private Map<String, String> registeCompany(@RequestBody String email,
     78                                               @RequestBody String password,
     79                                               @RequestBody String name,
     80                                               @RequestBody String country,
     81                                               @RequestBody String city,
     82                                               @RequestBody String street){
    8783
    8884        Account k = this.accountService.registerCompany(email, password, name, country, city, street);
  • src/main/resources/application.properties

    rb24fe9b rb31afbd  
    1717
    1818logging.level.org.hibernate.type=trace
    19 spring.jpa.hibernate.ddl-auto=update
     19spring.jpa.hibernate.ddl-auto=create
Note: See TracChangeset for help on using the changeset viewer.