Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kwon #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ public EntireSubject saveCommonSubjectData(int year,String id,String name){
String[] info=id.split("-");
EntireSubject subject= switch (year) {
case 2022-> EntireSubject_2022.builder().
subjectID(id).OPEN_YR(String.valueOf(year)).SHTM(info[1] + "학기").
TRGT_SHYR("1").ORGN_CLSF_CD("학부").COLG("대학").DEGR_NM_SUST("학과공통").
OPEN_SBJT_NO(info[2] + "-" + info[3]).OPEN_DCLSS(info[4]).OPEN_SBJT_NM(name).
CPTN_DIV_NM("일반선택").PNT("0").THEO_TMCNT("0").PRAC_TMCNT("0").build();
subjectID(id).openYr(String.valueOf(year)).shtm(info[1] + "학기").
trgtShyr("1").orgnClsfCd("학부").colg("대학").degrNmSust("학과공통").
openSbjtNo(info[2] + "-" + info[3]).openDclss(info[4]).openSbjtNm(name).
cptnDivNm("일반선택").pnt("0").theoTmcnt("0").pracTmcnt("0").build();
case 2021-> EntireSubject_2021.builder().
subjectID(id).OPEN_YR(String.valueOf(year)).SHTM(info[1] + "학기").
TRGT_SHYR("1").ORGN_CLSF_CD("학부").COLG("대학").DEGR_NM_SUST("학과공통").
OPEN_SBJT_NO(info[2] + "-" + info[3]).OPEN_DCLSS(info[4]).OPEN_SBJT_NM(name).
CPTN_DIV_NM("일반선택").PNT("0").THEO_TMCNT("0").PRAC_TMCNT("0").build();
subjectID(id).openYr(String.valueOf(year)).shtm(info[1] + "학기").
trgtShyr("1").orgnClsfCd("학부").colg("대학").degrNmSust("학과공통").
openSbjtNo(info[2] + "-" + info[3]).openDclss(info[4]).openSbjtNm(name).
cptnDivNm("일반선택").pnt("0").theoTmcnt("0").pracTmcnt("0").build();
case 2020-> EntireSubject_2020.builder().
subjectID(id).OPEN_YR(String.valueOf(year)).SHTM(info[1] + "학기").
TRGT_SHYR("1").ORGN_CLSF_CD("학부").COLG("대학").DEGR_NM_SUST("학과공통").
OPEN_SBJT_NO(info[2] + "-" + info[3]).OPEN_DCLSS(info[4]).OPEN_SBJT_NM(name).
CPTN_DIV_NM("일반선택").PNT("0").THEO_TMCNT("0").PRAC_TMCNT("0").build();
subjectID(id).openYr(String.valueOf(year)).shtm(info[1] + "학기").
trgtShyr("1").orgnClsfCd("학부").colg("대학").degrNmSust("학과공통").
openSbjtNo(info[2] + "-" + info[3]).openDclss(info[4]).openSbjtNm(name).
cptnDivNm("일반선택").pnt("0").theoTmcnt("0").pracTmcnt("0").build();
default -> null;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,48 @@ public class EntireSubject_2020 implements EntireSubject {
@Id
private String subjectID; // 년도+과목코드+분반

@Column
private String OPEN_YR; // 강의 년도
@Column(name="OPEN_YR")
private String openYr; // 강의 년도

@Column
private String SHTM; // 강의 학기
@Column(name="SHTM")
private String shtm; // 강의 학기

@Column
private String TRGT_SHYR; // 대상 학년
@Column(name = "TRGT_SHYR")
private String trgtShyr; // 대상 학년

@Column
private String ORGN_CLSF_CD; // 조직명(대학)
@Column(name = "ORGN_CLSF_CD")
private String orgnClsfCd; // 조직명(대학)

@Column
private String COLG; // 단과대학명
@Column(name = "COLG")
private String colg; // 단과대학명

@Column
private String DEGR_NM_SUST; // 학과명
@Column(name = "DEGR_NM_SUST")
private String degrNmSust; // 학과명

@Column
private String OPEN_SBJT_NO; // 과목 번호
@Column(name = "OPEN_SBJT_NO")
private String openSbjtNo; // 과목 번호

@Column
private String OPEN_DCLSS; // 분반 번호
@Column(name = "OPEN_DCLSS")
private String openDclss; // 분반 번호

@Column
private String OPEN_SBJT_NM; // 과목명
@Column(name = "OPEN_SBJT_NM")
private String openSbjtNm; // 과목명

@Column
private String CPTN_DIV_NM; // 이수구분
@Column(name = "CPTN_DIV_NM")
private String cptnDivNm; // 이수구분

@Column
private String PNT; // 학점
@Column(name = "PNT")
private String pnt; // 학점

@Column
private String THEO_TMCNT; // 이론시수
@Column(name = "THEO_TMCNT")
private String theoTmcnt; // 이론시수

@Column
private String PRAC_TMCNT; // 실습시수
@Column(name = "PRAC_TMCNT")
private String pracTmcnt; // 실습시수

// @Column(length = 5000)
// private String LSN_SMRY; // 수업 개요
//
// @Column(length = 1000)
// private String SBJT_SHT; // 교과목표
//
// @Column(length = 5000)
// private String TEMT_REF_LITRT; // 참고 문헌
//
// @Column(length = 1000)
// private String REF_BOOK; // 참고 도서
//
// @Column(length = 1000)
// private String PRE_LRN_CN; // 선수 학습 내용
@Column(name = "PROF_INFO")
private String profInfo; // 교수명

@Column(name = "TMTBL_INFO", length = 1000)
private String tmtblInfo; // 시간표
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,48 @@ public class EntireSubject_2021 implements EntireSubject {
@Id
private String subjectID; // 년도+과목코드+분반

@Column
private String OPEN_YR; // 강의 년도
@Column(name="OPEN_YR")
private String openYr; // 강의 년도

@Column
private String SHTM; // 강의 학기
@Column(name="SHTM")
private String shtm; // 강의 학기

@Column
private String TRGT_SHYR; // 대상 학년
@Column(name = "TRGT_SHYR")
private String trgtShyr; // 대상 학년

@Column
private String ORGN_CLSF_CD; // 조직명(대학)
@Column(name = "ORGN_CLSF_CD")
private String orgnClsfCd; // 조직명(대학)

@Column
private String COLG; // 단과대학명
@Column(name = "COLG")
private String colg; // 단과대학명

@Column
private String DEGR_NM_SUST; // 학과명
@Column(name = "DEGR_NM_SUST")
private String degrNmSust; // 학과명

@Column
private String OPEN_SBJT_NO; // 과목 번호
@Column(name = "OPEN_SBJT_NO")
private String openSbjtNo; // 과목 번호

@Column
private String OPEN_DCLSS; // 분반 번호
@Column(name = "OPEN_DCLSS")
private String openDclss; // 분반 번호

@Column
private String OPEN_SBJT_NM; // 과목명
@Column(name = "OPEN_SBJT_NM")
private String openSbjtNm; // 과목명

@Column
private String CPTN_DIV_NM; // 이수구분
@Column(name = "CPTN_DIV_NM")
private String cptnDivNm; // 이수구분

@Column
private String PNT; // 학점
@Column(name = "PNT")
private String pnt; // 학점

@Column
private String THEO_TMCNT; // 이론시수
@Column(name = "THEO_TMCNT")
private String theoTmcnt; // 이론시수

@Column
private String PRAC_TMCNT; // 실습시수
@Column(name = "PRAC_TMCNT")
private String pracTmcnt; // 실습시수

// @Column(length = 5000)
// private String LSN_SMRY; // 수업 개요
//
// @Column(length = 1000)
// private String SBJT_SHT; // 교과목표
//
// @Column(length = 5000)
// private String TEMT_REF_LITRT; // 참고 문헌
//
// @Column(length = 1000)
// private String REF_BOOK; // 참고 도서
//
// @Column(length = 1000)
// private String PRE_LRN_CN; // 선수 학습 내용
@Column(name = "PROF_INFO")
private String profInfo; // 교수명

@Column(name = "TMTBL_INFO", length = 1000)
private String tmtblInfo; // 시간표
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,48 @@ public class EntireSubject_2022 implements EntireSubject {
@Id
private String subjectID; // 년도+과목코드+분반

@Column
private String OPEN_YR; // 강의 년도
@Column(name="OPEN_YR")
private String openYr; // 강의 년도

@Column
private String SHTM; // 강의 학기
@Column(name="SHTM")
private String shtm; // 강의 학기

@Column
private String TRGT_SHYR; // 대상 학년
@Column(name = "TRGT_SHYR")
private String trgtShyr; // 대상 학년

@Column
private String ORGN_CLSF_CD; // 조직명(대학)
@Column(name = "ORGN_CLSF_CD")
private String orgnClsfCd; // 조직명(대학)

@Column
private String COLG; // 단과대학명
@Column(name = "COLG")
private String colg; // 단과대학명

@Column
private String DEGR_NM_SUST; // 학과명
@Column(name = "DEGR_NM_SUST")
private String degrNmSust; // 학과명

@Column
private String OPEN_SBJT_NO; // 과목 번호
@Column(name = "OPEN_SBJT_NO")
private String openSbjtNo; // 과목 번호

@Column
private String OPEN_DCLSS; // 분반 번호
@Column(name = "OPEN_DCLSS")
private String openDclss; // 분반 번호

@Column
private String OPEN_SBJT_NM; // 과목명
@Column(name = "OPEN_SBJT_NM")
private String openSbjtNm; // 과목명

@Column
private String CPTN_DIV_NM; // 이수구분
@Column(name = "CPTN_DIV_NM")
private String cptnDivNm; // 이수구분

@Column
private String PNT; // 학점
@Column(name = "PNT")
private String pnt; // 학점

@Column
private String THEO_TMCNT; // 이론시수
@Column(name = "THEO_TMCNT")
private String theoTmcnt; // 이론시수

@Column
private String PRAC_TMCNT; // 실습시수
@Column(name = "PRAC_TMCNT")
private String pracTmcnt; // 실습시수

// @Column(length = 5000)
// private String LSN_SMRY; // 수업 개요
//
// @Column(length = 1000)
// private String SBJT_SHT; // 교과목표
//
// @Column(length = 5000)
// private String TEMT_REF_LITRT; // 참고 문헌
//
// @Column(length = 1000)
// private String REF_BOOK; // 참고 도서
//
// @Column(length = 1000)
// private String PRE_LRN_CN; // 선수 학습 내용
@Column(name = "PROF_INFO")
private String profInfo; // 교수명

@Column(name = "TMTBL_INFO", length = 1000)
private String tmtblInfo; // 시간표
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dciproject.backend.function.Controller;

import dciproject.backend.function.DTO.SbjRequestDTO;
import dciproject.backend.function.DTO.SbjResponseDTO;
import dciproject.backend.function.Repository.SubjectMapping;
import dciproject.backend.function.Service.SearchService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -19,16 +19,17 @@ public class SearchController {
private final SearchService searchService;

@GetMapping("/api/search")
public List<SbjResponseDTO> requestSearchSubject(@ModelAttribute SbjRequestDTO sbjRequestDTO){
log.info("SearchSubject::: Year={}, Shmt={}, Cdn={}, Dn={}, Keyword={}",
public List<SubjectMapping> requestSearchSubject(@ModelAttribute SbjRequestDTO sbjRequestDTO){
log.info("SearchSubjectController::: Year={}, Shmt={}, Cdn={}, Colg={}, Dn={}, Keyword={}",
sbjRequestDTO.getYear(),
sbjRequestDTO.getShmt(),
sbjRequestDTO.getCdn(),
sbjRequestDTO.getColg(),
sbjRequestDTO.getDn(),
sbjRequestDTO.getKeyword()
);

List<SbjResponseDTO> sbjResponse = searchService.getSbjs(sbjRequestDTO);
List<SubjectMapping> sbjResponse = searchService.getSbjs(sbjRequestDTO);

return sbjResponse;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package dciproject.backend.function.DTO;

import dciproject.backend.entireSubjects.entireSubject_2020.EntireSubject_2020;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;

@Getter
@Builder
@AllArgsConstructor
public class SbjRequestDTO {
public class SbjRequestDTO{
public String year; // 년도
public String shmt; // 학기
public String cdn; // 이수구분
public String colg; // 단과대
public String dn ; // 학과
public String keyword ; // 검색
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import dciproject.backend.entireSubjects.entireSubject_2020.EntireSubject_2020;
import dciproject.backend.function.DTO.SbjResponseDTO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.http.converter.json.GsonBuilderUtils;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface EntireSubject_2020Repository extends JpaRepository<EntireSubject_2020, String> {
List<SbjResponseDTO> findAllBySHTMAndCPTN_DIV_NMAndDEGR_NM_SUSTAndOPEN_SBJT_NMContaining (String s, String c, String d, String k);
public interface EntireSubjectRepository_2020 extends JpaRepository<EntireSubject_2020, String> {
List<SubjectMapping> findAllByShtmAndCptnDivNmAndDegrNmSustAndColgAndOpenSbjtNmContaining(String shtm, String cptnDivNm, String degrNmSust, String colg, String openSbjtNm);

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
package dciproject.backend.function.Repository;

public class EntireSubjectRepository_2021 {
import dciproject.backend.entireSubjects.entireSubject_2020.EntireSubject_2020;
import dciproject.backend.entireSubjects.entireSubject_2021.EntireSubject_2021;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EntireSubjectRepository_2021 extends JpaRepository<EntireSubject_2021, String> {
List<SubjectMapping> findAllByShtmAndCptnDivNmAndDegrNmSustAndColgAndOpenSbjtNmContaining(String shtm, String cptnDivNm, String degrNmSust, String colg, String openSbjtNm);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
package dciproject.backend.function.Repository;

public class EntireSubjectRepository_2022 {
import dciproject.backend.entireSubjects.entireSubject_2022.EntireSubject_2022;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EntireSubjectRepository_2022 extends JpaRepository<EntireSubject_2022, String> {
List<SubjectMapping> findAllByShtmAndCptnDivNmAndDegrNmSustAndColgAndOpenSbjtNmContaining(String shtm, String cptnDivNm, String degrNmSust, String colg, String openSbjtNm);
}
Loading