목록Java (34)
메모장
import java.math.BigDecimal;import java.math.RoundingMode;import org.assertj.core.api.Assertions;import org.junit.jupiter.api.BeforeEach;import org.junit.jupiter.api.DisplayName;import org.junit.jupiter.api.DisplayNameGeneration;import org.junit.jupiter.api.DisplayNameGenerator;import org.junit.jupiter.api.MethodOrderer;import org.junit.jupiter.api.Order;import org.junit.jupiter.api.Tes..
import java.util.ArrayList; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.Displa..
Controller@RestController@RequiredArgsConstructor@RequestMapping("/info")public class InfoController { private final ResponseService responseService; private final NoticeService noticeService; @GetMapping("/notice") @ApiOperation("공지사항 목록 조회") public CommonResult getNoticeList(@PageableDefault Pageable pageable, SearchCondition searchCondition) { return responseService.getSin..
CommonResult@Getter@Setterpublic class CommonResult { @ApiModelProperty(value = "응답 성공여부 : true/false") private boolean success; @ApiModelProperty(value = "응답 코드 번호 : > 0 정상, SingleResult@Getter@Setterpublic class SingleResult extends CommonResult { private T data;}ListResult@Getter@Setterpublic class ListResult extends CommonResult { private List list;} Service@S..
public class CustomException extends RuntimeException { public CustomException(String message, Throwable cause) { super(message, cause); } public CustomException(String message) { super(message); } public CustomException() { super(); } } // 예외 실행 throw new CustomException();
사용자가 리스트의 정렬정보를 저장하여 새로고침 하여도 정렬정보에 의해 리스트 순서가 유지되길 원했다. Table: Lesson Column: sortName, sortType public List selectInfoList(Long lessonSeq) { return queryFactory .select(new QInfoDTO(info.infoSeq, info.name, info.age)) .from(info) .leftJoin(info.lesson, lesson) .where(lesson.lessonSeq.eq(lessonSeq), info.delDate.isNull(), lesson.delDate.isNull()) .orderBy(sortInfoList(lessonSeq)) .fetch(); } pr..