Skip to content

Commit

Permalink
[fix] #123 batch및 온보딩 오류 수정
Browse files Browse the repository at this point in the history
[fix] #123 batch및  온보딩 오류 수정
  • Loading branch information
Jeoongu authored Oct 10, 2024
2 parents 678875b + 5f9c0e2 commit cb62c1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private void checkStudentRight(OnBoardingRequest request, StudentCsv studentCsv)
boolean name = request.getName().equals(studentCsv.getStudentName());
boolean studentId = request.getStudentId().equals(studentCsv.getStudentId().toString());
boolean groupName = request.getMemberCode().equals(MemberCode.getEnumMemberCodeFromStringMemberCode(studentCsv.getGroupName()).getStringMemberCode());
boolean major = request.getMajorCode().equals(MajorCode.getEnumMajorCodeFromStringMajorCode(studentCsv.getMajor()).getStringMajorCode());
boolean major = request.getMajorCode().equals(MajorCode.getEnumMajorCodeFromStringMajorCode(studentCsv.getProgram()).getStringMajorCode());

if(!(name && studentId && groupName && major)){
throw new GeneralException(ErrorStatus.INVALID_ONBOARDING_REQUEST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.springframework.batch.core.job.builder.JobBuilder;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.step.builder.StepBuilder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.PlatformTransactionManager;
Expand All @@ -16,13 +17,16 @@

@RequiredArgsConstructor
@Configuration
//@ConditionalOnProperty(name = "spring.batch.job.name", havingValue = "studentDataLoadJob")
public class FileItemReaderJobConfig {
private final CSVReader csvReader;
private final CSVWriter csvWriter;

@Bean
private static final String JOB_NAME = "studentDataLoadJob";

@Bean(JOB_NAME)
public Job studentDataLoadJob(JobRepository jobRepository, Step studentDataLoadStep) {
return new JobBuilder("studetnDataLoadJob", jobRepository)
return new JobBuilder(JOB_NAME, jobRepository)
.flow(studentDataLoadStep)
.end()
.build();
Expand Down

0 comments on commit cb62c1d

Please sign in to comment.