-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
878 additions
and
778 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
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
36 changes: 36 additions & 0 deletions
36
src/main/java/dbdr/domain/careworker/dto/CareworkerMapper.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,36 @@ | ||
package dbdr.domain.careworker.dto; | ||
|
||
import dbdr.domain.careworker.dto.request.CareworkerRequest; | ||
import dbdr.domain.careworker.dto.response.CareworkerResponse; | ||
import dbdr.domain.careworker.entity.Careworker; | ||
import dbdr.domain.institution.entity.Institution; | ||
import dbdr.domain.institution.service.InstitutionService; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.Mappings; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.security.crypto.password.PasswordEncoder; | ||
|
||
@Mapper(componentModel = "spring") | ||
public abstract class CareworkerMapper { | ||
@Autowired | ||
PasswordEncoder passwordEncoder; | ||
@Autowired | ||
private InstitutionService institutionService; | ||
|
||
@Mappings({ | ||
@Mapping(target = "institutionId", source = "institution.id"), | ||
@Mapping(target = "id", source = "id")}) | ||
public abstract CareworkerResponse toResponse(Careworker careworker); | ||
|
||
@Mappings({ | ||
@Mapping(target = "loginPassword", expression = "java(passwordEncoder.encode(request.getLoginPassword()))"), | ||
@Mapping(target = "institution", source = "institutionId")}) | ||
public abstract Careworker toEntity(CareworkerRequest request); | ||
|
||
protected Institution mapInstitution(Long institutionId) { | ||
return institutionService.getInstitutionById(institutionId); | ||
} | ||
|
||
|
||
} |
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
9 changes: 3 additions & 6 deletions
9
...response/CareworkerMyPageResponseDTO.java → ...to/response/CareworkerMyPageResponse.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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
package dbdr.domain.careworker.dto.response; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.time.DayOfWeek; | ||
import java.time.LocalTime; | ||
import java.util.Set; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class CareworkerMyPageResponseDTO { | ||
public class CareworkerMyPageResponse { | ||
|
||
private String name; | ||
private String phone; | ||
private String institutionName; | ||
private String loginId; | ||
private Set<DayOfWeek> workingDays; | ||
private LocalTime alertTime; | ||
} |
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
Oops, something went wrong.