- Timestamp:
- 01/08/21 03:34:14 (4 years ago)
- Branches:
- master
- Children:
- 4b1c93d
- Parents:
- b31afbd
- Location:
- src/main/java/it/finki/tinki
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/bootstrap/DataHolder.java
rb31afbd r336d09e 1 1 package it.finki.tinki.bootstrap; 2 2 3 import it.finki.tinki.model.Address;4 import it.finki.tinki.model.EmbeddedMatchId;5 3 import it.finki.tinki.model.Jobs.Job; 6 import it.finki.tinki.model.Jobs.Work;7 import it.finki.tinki.model.Match;8 4 import it.finki.tinki.model.Skill; 9 5 import it.finki.tinki.model.Users.Account; 10 import it.finki.tinki.model.Users.Company;11 import it.finki.tinki.model.Users.User;12 6 import it.finki.tinki.model.enumerator.AccountType; 13 import it.finki.tinki.model.enumerator.WorkType;14 7 import it.finki.tinki.repository.*; 15 8 import it.finki.tinki.service.AccountService; 16 9 import it.finki.tinki.service.WorkService; 17 import org.springframework.beans.factory.annotation.Autowired;18 10 import org.springframework.stereotype.Component; 19 11 -
src/main/java/it/finki/tinki/helper/Matchmaker.java
rb31afbd r336d09e 22 22 } 23 23 24 System.out.println(k/coef); 25 24 26 return k/coef; 25 27 } -
src/main/java/it/finki/tinki/model/EmbeddedMatchId.java
rb31afbd r336d09e 6 6 7 7 import javax.persistence.Embeddable; 8 import javax.persistence.FetchType;9 8 import javax.persistence.OneToOne; 10 9 import java.io.Serializable; 11 import java.util.Objects;12 10 13 11 @Embeddable -
src/main/java/it/finki/tinki/model/Match.java
rb31afbd r336d09e 1 1 package it.finki.tinki.model; 2 2 3 import com.sun.istack.NotNull;4 import it.finki.tinki.model.Jobs.Work;5 import it.finki.tinki.model.Users.User;6 3 import it.finki.tinki.model.enumerator.WorkType; 7 4 import lombok.Data; … … 12 9 @Data 13 10 public class Match { 14 15 // @Id16 // @GeneratedValue(strategy = GenerationType.AUTO)17 // Long id;18 //19 // @NotNull20 // Long workId;21 //22 // @NotNull23 // Long userId;24 11 25 12 @Id … … 32 19 public Match(){} 33 20 34 // public Match(Long workId, Long userId, float coefficient, WorkType type) {35 // this.workId = workId;36 // this.userId = userId;37 // this.coefficient = coefficient;38 // this.type = type;39 // }40 41 21 public Match(EmbeddedMatchId embeddedMatchId, float coefficient, WorkType type) { 42 22 this.embeddedMatchId = embeddedMatchId; -
src/main/java/it/finki/tinki/model/dto/InternshipResponseDTO.java
rb31afbd r336d09e 3 3 import it.finki.tinki.model.Address; 4 4 import it.finki.tinki.model.Jobs.Internship; 5 import it.finki.tinki.model.Jobs.Project;6 5 import it.finki.tinki.model.Users.Company; 7 import it.finki.tinki.model.Users.Team;8 6 import it.finki.tinki.model.enumerator.AccountType; 9 7 import lombok.Data; -
src/main/java/it/finki/tinki/model/dto/ProjectResponseDTO.java
rb31afbd r336d09e 1 1 package it.finki.tinki.model.dto; 2 2 3 import it.finki.tinki.model.Address;4 import it.finki.tinki.model.Jobs.Job;5 3 import it.finki.tinki.model.Jobs.Project; 6 import it.finki.tinki.model.Users.Company;7 4 import it.finki.tinki.model.Users.Team; 8 5 import it.finki.tinki.model.enumerator.AccountType; -
src/main/java/it/finki/tinki/model/dto/UserResponseDTO.java
rb31afbd r336d09e 1 1 package it.finki.tinki.model.dto; 2 2 3 import it.finki.tinki.model.Jobs.Internship;4 import it.finki.tinki.model.Jobs.Job;5 import it.finki.tinki.model.Jobs.Project;6 3 import it.finki.tinki.model.Skill; 7 4 import lombok.Data; -
src/main/java/it/finki/tinki/repository/AddressRepository.java
rb31afbd r336d09e 5 5 import org.springframework.stereotype.Repository; 6 6 7 import java.util.List;8 9 7 @Repository 10 8 public interface AddressRepository extends JpaRepository<Address, Long> { -
src/main/java/it/finki/tinki/repository/InternshipRepository.java
rb31afbd r336d09e 2 2 3 3 import it.finki.tinki.model.Jobs.Internship; 4 import it.finki.tinki.model.Jobs.Work;5 4 import org.springframework.data.jpa.repository.JpaRepository; 6 5 import org.springframework.stereotype.Repository; -
src/main/java/it/finki/tinki/repository/MatchRepository.java
rb31afbd r336d09e 13 13 public interface MatchRepository extends JpaRepository<Match, EmbeddedMatchId> { 14 14 List<Match> findAllByEmbeddedMatchIdUserAndTypeOrderByCoefficientDesc(User user, WorkType type); 15 // List<Match> getAllByUserIdAndTypeOrderByCoefficientDesc(Long uId, WorkType type);16 15 } -
src/main/java/it/finki/tinki/service/impl/AccountServiceImpl.java
rb31afbd r336d09e 16 16 import it.finki.tinki.service.AccountService; 17 17 import it.finki.tinki.service.MatchmakerService; 18 import it.finki.tinki.service.WorkService;19 18 import org.springframework.stereotype.Service; 20 19 21 import java.util.HashMap;22 20 import java.util.List; 23 import java.util.Map;24 21 25 22 @Service -
src/main/java/it/finki/tinki/service/impl/MatchmakerServiceImpl.java
rb31afbd r336d09e 6 6 import it.finki.tinki.model.Jobs.Job; 7 7 import it.finki.tinki.model.Jobs.Project; 8 import it.finki.tinki.model.Jobs.Work;9 8 import it.finki.tinki.model.Match; 10 9 import it.finki.tinki.model.Skill; … … 61 60 if(matches.size()!=0) { 62 61 matches.forEach(match -> { 63 System.out.println(match.getCoefficient());64 62 jobs.add((Job) match.getEmbeddedMatchId().getWork()); 65 63 }); -
src/main/java/it/finki/tinki/service/impl/SkillServiceImpl.java
rb31afbd r336d09e 2 2 3 3 import it.finki.tinki.model.Skill; 4 import it.finki.tinki.model.exception.SkillNotFoundException;5 4 import it.finki.tinki.repository.SkillRepository; 6 5 import it.finki.tinki.service.SkillService; -
src/main/java/it/finki/tinki/service/impl/WorkServiceImpl.java
rb31afbd r336d09e 4 4 import it.finki.tinki.model.Jobs.Job; 5 5 import it.finki.tinki.model.Jobs.Project; 6 import it.finki.tinki.model.Match;7 6 import it.finki.tinki.model.Skill; 8 7 import it.finki.tinki.model.Users.Account; 9 8 import it.finki.tinki.model.enumerator.AccountType; 10 import it.finki.tinki.model.enumerator.WorkType;11 9 import it.finki.tinki.repository.InternshipRepository; 12 10 import it.finki.tinki.repository.JobRepository; … … 14 12 import it.finki.tinki.repository.ProjectRepository; 15 13 import it.finki.tinki.service.AccountService; 16 import it.finki.tinki.service.MatchmakerService;17 14 import it.finki.tinki.service.SkillService; 18 15 import it.finki.tinki.service.WorkService; -
src/main/java/it/finki/tinki/web/controller/LoginController.java
rb31afbd r336d09e 13 13 import it.finki.tinki.service.MatchmakerService; 14 14 import it.finki.tinki.service.WorkService; 15 import org.apache.coyote.Response;16 15 import org.springframework.web.bind.annotation.*; 17 16 import org.springframework.web.server.ResponseStatusException; 18 17 19 18 import java.util.List; 20 import java.util.Map;21 19 22 20 @RestController … … 35 33 } 36 34 35 //TODO: ADD JOB/INTERNSHIP RESPONSE TYPE TO COMPANY AND TEAM ---------------------v 36 37 37 @PostMapping(path = "/login") 38 38 public LoginResponseDTO testPage(@RequestBody AccountLoginDTO body) throws ResponseStatusException { 39 40 System.out.println(body);41 39 42 40 Account a1 = accountService.findUser(body.getEmail(), body.getPassword(), body.getType()); … … 89 87 tDto.setEmail(a1.getEmail()); 90 88 tDto.setName(a1.getName()); 91 tDto.setType(AccountType. USER);89 tDto.setType(AccountType.TEAM); 92 90 tDto.setMembers(((Team) a1).getMembers()); 93 91 … … 106 104 cDto.setEmail(a1.getEmail()); 107 105 cDto.setName(a1.getName()); 108 cDto.setType(AccountType. USER);106 cDto.setType(AccountType.COMPANY); 109 107 cDto.setAddress(((Company) a1).getAddress()); 110 108 -
src/main/java/it/finki/tinki/web/controller/RegisterController.java
rb31afbd r336d09e 1 1 package it.finki.tinki.web.controller; 2 2 3 import it.finki.tinki.helper.Matchmaker;4 import it.finki.tinki.model.Jobs.Internship;5 import it.finki.tinki.model.Jobs.Job;6 import it.finki.tinki.model.Jobs.Project;7 3 import it.finki.tinki.model.Skill; 8 4 import it.finki.tinki.model.Users.Account; 9 import it.finki.tinki.model.Users.User;10 5 import it.finki.tinki.model.dto.UserRegisterDTO; 11 6 import it.finki.tinki.service.AccountService; … … 55 50 } 56 51 52 //TODO: ADD TEAM AND COMPANY REGISTER TDO --------------------------------------v 53 57 54 @RequestMapping(path = "/team", method = RequestMethod.POST) 58 55 private Map<String, String> registerTeam(@RequestBody String email,
Note:
See TracChangeset
for help on using the changeset viewer.