-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Changed db structure * Changed DB structure * Changed data.sql file * fix bug with login (#62) Co-authored-by: Denis Boyko <[email protected]> * bugfix: delete didn`t work * DB tried to conected to AWS RDS DB bugfix * Delete unused files * Delete cors annotation * Add cors to config, add new endpoint to permitAll * Add new table for Proofs * Moved file * Delete unused variables * Create ProofDTO, TalentProofController, TalentProofMapper, TalentProof entity, TalentProofService and TalentProofRepository * Add mapstruct dependencies * Edit dev.pros - change logging level * Edit schema.sql: edit Proof table * Edit ProofDTO: add new fields * Comment mapper impl * Create mappers for Talent and TalentProofs with mapstruct * Create mapper for UserInfo with mapstruct * Comment UserInfo mapper impl * Remove unused method * Move mapping from service to controller for Talent * Change return type for Talent * Edit TalentProof: add new fields to Proof entity * Add pagination for Proofs * Edit pagination for Proofs: add custom method to Proof repository * Edit role: change String to Enum * Edit TalentProofController * Change version in pom.xml --------- Co-authored-by: Maslyna <[email protected]> Co-authored-by: Mykhailo Ordyntsev <[email protected]> Co-authored-by: Denis Boyko <[email protected]>
- Loading branch information
1 parent
0d2a94d
commit 2252c60
Showing
39 changed files
with
670 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/provedcode/talent/controller/TalentProofController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.provedcode.talent.controller; | ||
|
||
import com.provedcode.talent.mapper.TalentProofMapper; | ||
import com.provedcode.talent.model.dto.ProofDTO; | ||
import com.provedcode.talent.service.TalentProofService; | ||
import lombok.AllArgsConstructor; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.Optional; | ||
|
||
@RestController | ||
@AllArgsConstructor | ||
@RequestMapping("/api/talents") | ||
public class TalentProofController { | ||
TalentProofService talentProofService; | ||
TalentProofMapper talentProofMapper; | ||
|
||
@GetMapping("/proofs") | ||
Page<ProofDTO> getAllProofs(@RequestParam(value = "page") Optional<Integer> page, | ||
@RequestParam(value = "size") Optional<Integer> size) { | ||
return talentProofService.getAllProofsPage(page, size).map(talentProofMapper::toProofDTO); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/com/provedcode/talent/mapper/TalentProofMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.provedcode.talent.mapper; | ||
|
||
import com.provedcode.talent.model.dto.ProofDTO; | ||
import com.provedcode.talent.model.entity.TalentProof; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.MappingConstants; | ||
import org.mapstruct.ReportingPolicy; | ||
|
||
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING) | ||
public interface TalentProofMapper { | ||
@Mapping(source = "talentId", target = "id") | ||
@Mapping(source = "created", target = "created", dateFormat = "dd-MM-yyyy HH:mm:ss") | ||
ProofDTO toProofDTO(TalentProof talentProof); | ||
|
||
@Mapping(source = "id", target = "talentId") | ||
@Mapping(target = "id", ignore = true) | ||
@Mapping(source = "created", target = "created", dateFormat = "dd-MM-yyyy HH:mm:ss") | ||
TalentProof toTalentProof(ProofDTO proofDTO); | ||
} |
Oops, something went wrong.