Skip to content

Commit

Permalink
refactor : code convention, access specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Diger committed Jan 3, 2024
1 parent 6388d52 commit 02baf42
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
package usw.suwiki.domain.evaluatepost.controller.dto;

import usw.suwiki.domain.evaluatepost.domain.EvaluatePost;
import lombok.Getter;
import usw.suwiki.domain.evaluatepost.domain.EvaluatePost;

@Getter
public class EvaluatePostResponseByLectureIdDto {

private Long id;
private String selectedSemester;
private float totalAvg; // 평균지수
private float satisfaction; //수업 만족도
private float learning; //배움지수
private float honey; //꿀강지수
private final Long id;
private final String selectedSemester;
private final float totalAvg; // 평균지수
private final float satisfaction; //수업 만족도
private final float learning; //배움지수
private final float honey; //꿀강지수

private int team; //조모임 횟수
private int difficulty; //학점비율
private int homework;
private final int team; //조모임 횟수
private final int difficulty; //학점비율
private final int homework;

private String content; //주관적인 강의평가 입력내용
private final String content; //주관적인 강의평가 입력내용

public EvaluatePostResponseByLectureIdDto(EvaluatePost entity) {
this.id = entity.getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
@Getter
public class EvaluatePostResponseByUserIdxDto {

private Long id;
private String lectureName;
private String professor;
private String majorType;
private String selectedSemester;
private final Long id;
private final String lectureName;
private final String professor;
private final String majorType;
private final String selectedSemester;
private String semesterList;
private float totalAvg; // 평균지수
private float satisfaction; //수업 만족도
private float learning; //배움지수
private float honey; //꿀강지수
private final float totalAvg; // 평균지수
private final float satisfaction; //수업 만족도
private final float learning; //배움지수
private final float honey; //꿀강지수

private int team; //조모임 횟수
private int difficulty; //학점비율
private int homework;
private final int team; //조모임 횟수
private final int difficulty; //학점비율
private final int homework;

private String content; //주관적인 강의평가 입력내용
private final String content; //주관적인 강의평가 입력내용

public void setSemesterList(String semesterList) {
this.semesterList = semesterList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
@Getter
public class ExamResponseByLectureIdDto {

private Long id;
private String selectedSemester;
private final Long id;
private final String selectedSemester;

private String examType;
private String examInfo; //시험방식
private String examDifficulty; //난이도
private final String examType;
private final String examInfo; //시험방식
private final String examDifficulty; //난이도

private String content; //주관적인 강의평가 입력내용
private final String content; //주관적인 강의평가 입력내용

public ExamResponseByLectureIdDto(ExamPost entity) {
this.id = entity.getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
@Getter
public class ExamResponseByUserIdxDto {

private Long id;
private String lectureName;
private String professor;
private String majorType;
private String selectedSemester;
private final Long id;
private final String lectureName;
private final String professor;
private final String majorType;
private final String selectedSemester;
private String semesterList;
private String examType;
private String examInfo;
private String examDifficulty; //난이도
private final String examType;
private final String examInfo;
private final String examDifficulty; //난이도

private String content; //주관적인 강의평가 입력내용
private final String content; //주관적인 강의평가 입력내용

public void setSemesterList(String semesterList) {
this.semesterList = semesterList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
package usw.suwiki.domain.lecture.domain.repository;

import static usw.suwiki.domain.lecture.domain.QLecture.lecture;

import com.querydsl.core.QueryResults;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.CaseBuilder;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import usw.suwiki.domain.lecture.domain.Lecture;
import usw.suwiki.domain.lecture.controller.dto.LectureFindOption;
import usw.suwiki.domain.lecture.domain.QLecture;
import usw.suwiki.domain.lecture.domain.Lecture;
import usw.suwiki.domain.lecture.domain.repository.dao.LecturesAndCountDao;

import javax.persistence.EntityManager;

import java.util.List;

import static usw.suwiki.domain.lecture.domain.QLecture.lecture;

@RequiredArgsConstructor
public class LectureQueryRepositoryImpl implements LectureQueryRepository {

Expand Down Expand Up @@ -100,7 +96,7 @@ public LecturesAndCountDao findLectureByMajorType(String searchValue, LectureFin
createPostCountOption(),
orderSpecifier
)
.offset((page - 1) * DEFAULT_LIMIT)
.offset((long) (page - 1) * DEFAULT_LIMIT)
.limit(DEFAULT_LIMIT)
.fetchResults();

Expand Down Expand Up @@ -129,7 +125,7 @@ public LecturesAndCountDao findAllLectureByFindOption(LectureFindOption option)
createPostCountOption(),
orderSpecifier
)
.offset((page - 1) * DEFAULT_LIMIT)
.offset((long) (page - 1) * DEFAULT_LIMIT)
.limit(DEFAULT_LIMIT)
.fetchResults();

Expand Down Expand Up @@ -159,7 +155,7 @@ public LecturesAndCountDao findAllLectureByMajorType(LectureFindOption option) {
createPostCountOption(),
orderSpecifier
)
.offset((page - 1) * DEFAULT_LIMIT)
.offset((long) (page - 1) * DEFAULT_LIMIT)
.limit(DEFAULT_LIMIT)
.fetchResults();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class BaseException extends RuntimeException {

@Getter
private ExceptionType exceptionType;
private final ExceptionType exceptionType;

public BaseException(ExceptionType exceptionType) {
super(exceptionType.getMessage());
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/usw/suwiki/global/util/JsonToDataTable.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package usw.suwiki.global.util;

import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import javax.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
Expand All @@ -10,11 +14,6 @@
import usw.suwiki.domain.lecture.domain.Lecture;
import usw.suwiki.domain.lecture.domain.repository.LectureRepository;

import javax.transaction.Transactional;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

@Service
@Transactional
@RequiredArgsConstructor
Expand Down Expand Up @@ -76,7 +75,7 @@ public void toEntity(String path) throws IOException, ParseException, Interrupte
.evaluateType((String) jsonObject.get("cretEvalNm"))
.lectureCode((String) jsonObject.get("subjtCd"))
.selectedSemester(jsonObject.get("subjtEstbYear") + "-" + String.valueOf(
jsonObject.get("subjtEstbSmrCd")).substring(0, 1))
jsonObject.get("subjtEstbSmrCd")).charAt(0))
.grade(Integer.parseInt(jsonObject.get("trgtGrdeCd").toString()))
.lectureType((String) jsonObject.get("facDvnm"))
.placeSchedule(String.valueOf(jsonObject.get("timtSmryCn")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
@Getter
public class VersionResponseDto {

private float version;
private final float version;

public VersionResponseDto(float version) {
this.version = version;
Expand Down

0 comments on commit 02baf42

Please sign in to comment.