Skip to content

Commit

Permalink
πŸ”— :: (#493) μΊμ‹œ 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
alsdl0629 authored Jan 3, 2024
2 parents 4f89030 + 63eaebf commit cd58cf7
Show file tree
Hide file tree
Showing 36 changed files with 342 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class TotalPageCountResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.application.model.ApplicationAttachment;
import team.retum.jobis.domain.application.model.AttachmentType;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class AttachmentResponse {
private String url;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package team.retum.jobis.domain.application.dto.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public class QueryEmploymentCountResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.application.spi.vo.PassedApplicationStudentsVO;
import team.retum.jobis.domain.student.model.SchoolNumber;

import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class QueryPassedApplicationStudentsResponse {

Expand All @@ -29,6 +31,8 @@ public static QueryPassedApplicationStudentResponse of(PassedApplicationStudents
}

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public static class QueryPassedApplicationStudentResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class QueryRejectionReasonResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.application.model.ApplicationStatus;

import java.time.LocalDate;
import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class TeacherQueryApplicationsResponse {

private final List<TeacherQueryApplicationResponse> applications;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public static class TeacherQueryApplicationResponse {
private final Long applicationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.code.model.Code;
import team.retum.jobis.domain.code.model.JobType;

import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class CodesResponse {

Expand All @@ -23,6 +25,8 @@ public static CodeResponse of(Code code) {
}

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public static class CodeResponse {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package team.retum.jobis.domain.company.dto.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public class QueryCompanyDetailsResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.company.spi.vo.StudentCompaniesVO;

import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class StudentQueryCompaniesResponse {
private final List<StudentCompaniesVO> companies;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.company.model.CompanyType;

import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class TeacherQueryCompaniesResponse {

private final List<TeacherQueryCompanyResponse> companies;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public static class TeacherQueryCompanyResponse {
private final Long companyId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.company.spi.vo.TeacherEmployCompaniesVO;

import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class TeacherQueryEmployCompaniesResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class StudentCompaniesVO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class TeacherEmployCompaniesVO {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package team.retum.jobis.domain.recruitment.dto.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.recruitment.model.ProgressType;
import team.retum.jobis.domain.recruitment.spi.vo.RecruitmentDetailVO;

Expand All @@ -10,6 +12,8 @@
import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public class QueryRecruitmentDetailResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public class RecruitAreaResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class StudentQueryRecruitmentsResponse {

private final List<StudentRecruitmentResponse> recruitments;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public static class StudentRecruitmentResponse {
private long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import team.retum.jobis.domain.company.model.CompanyType;
import team.retum.jobis.domain.recruitment.model.RecruitStatus;

import java.time.LocalDate;
import java.util.List;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
public class TeacherQueryRecruitmentsResponse {

private final List<TeacherRecruitmentResponse> recruitments;

@Getter
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Builder
public static class TeacherRecruitmentResponse {
private long id;
Expand Down
3 changes: 3 additions & 0 deletions jobis-infrastructure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ dependencies {
// jaxb
implementation 'javax.xml.bind:jaxb-api:2.3.0'

// cache
implementation 'org.springframework.boot:spring-boot-starter-cache'

}

test.useJUnitPlatform()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -23,6 +27,11 @@
import team.retum.jobis.domain.acceptance.usecase.RegisterFieldTraineeUseCase;
import team.retum.jobis.domain.acceptance.usecase.TeacherQueryFieldTraineesAndContractWorkersUseCase;

import static team.retum.jobis.global.config.cache.CacheName.ACCEPTANCE;
import static team.retum.jobis.global.config.cache.CacheName.APPLICATION;
import static team.retum.jobis.global.config.cache.CacheName.COMPANY;

@CacheConfig(cacheNames = ACCEPTANCE)
@RequiredArgsConstructor
@RequestMapping("/acceptances")
@RestController
Expand All @@ -34,13 +43,20 @@ public class AcceptanceWebAdapter {
private final RegisterEmploymentContractUseCase registerEmploymentContractUseCase;
private final CancelFieldTraineesUseCase cancelFieldTraineesUseCase;

@Cacheable
@GetMapping("/{company-id}")
public TeacherQueryFieldTraineesAndContractWorkersResponse teacherQueryFieldTraineesAndContractWorkers(
@PathVariable(name = "company-id") Long companyId
) {
return teacherQueryFieldTraineesAndContractWorkersUseCase.execute(companyId);
}

@Caching(
evict = {
@CacheEvict(cacheNames = APPLICATION, allEntries = true),
@CacheEvict(cacheNames = COMPANY, allEntries = true)
}
)
@ResponseStatus(HttpStatus.NO_CONTENT)
@PatchMapping("/field-train")
public void registerFieldTrainee(
Expand All @@ -49,18 +65,32 @@ public void registerFieldTrainee(
registerFieldTraineeUseCase.execute(request.toDomainRequest());
}

@CacheEvict(allEntries = true)
@ResponseStatus(HttpStatus.NO_CONTENT)
@PatchMapping("/contract-date")
public void changeWorkContractDate(@RequestBody @Valid ChangeContractDateWebRequest request) {
changeContractDateUseCase.execute(request.toDomainRequest());
}

@Caching(
evict = {
@CacheEvict(cacheNames = ACCEPTANCE, allEntries = true),
@CacheEvict(cacheNames = APPLICATION, allEntries = true),
@CacheEvict(cacheNames = COMPANY, allEntries = true)
}
)
@ResponseStatus(HttpStatus.CREATED)
@PostMapping("/employment")
public void registerEmploymentContract(@RequestBody @Valid RegisterEmploymentContractWebRequest request) {
registerEmploymentContractUseCase.execute(request.toDomainRequest());
}

@Caching(
evict = {
@CacheEvict(cacheNames = APPLICATION, allEntries = true),
@CacheEvict(cacheNames = COMPANY, allEntries = true)
}
)
@ResponseStatus(HttpStatus.NO_CONTENT)
@DeleteMapping
public void cancelFieldTrainees(@RequestBody @Valid CancelFieldTraineesWebRequest request) {
Expand Down
Loading

0 comments on commit cd58cf7

Please sign in to comment.