/************************************************************ * * @packageName : io.company.localhost.commoncodService * @fileName : commoncodService.java * @author : 공현지 * @date : 25.01.07 * @description : * * =========================================================== * DATE AUTHOR NOTE * ----------------------------------------------------------- * 24.12.06 공현지 최초 생성 * *************************************************************/ package io.company.localhost.service; import java.util.ArrayList; import java.util.List; import org.springframework.stereotype.Service; import io.company.localhost.common.dto.MapDto; import io.company.localhost.common.exception.NotFoundHandler; import io.company.localhost.mapper.commoncodMapper; import lombok.RequiredArgsConstructor; @Service @RequiredArgsConstructor public class commoncodService { private final commoncodMapper commoncodmapper; public List selectWordCategory() { return commoncodmapper.selectWordCategory(); } public Long insertCategory(MapDto map) { Long count = commoncodmapper.selectcheckCategoryExists(map); if(count > 0) { return -1L; } return commoncodmapper.insertCategory(map); } public List selectColorList(String type) { return commoncodmapper.selectColorList(type); } public List selectMbtiList() { return commoncodmapper.selectMbtiList(); } public List selectYearCategories() { return commoncodmapper.selectYearCategories(); } public List selectPwhintList() { return commoncodmapper.selectPwhintList(); } public List selectCategoryList() { return commoncodmapper.selectCategories(); } public List selectVacationType() { List codeList = commoncodmapper.selectVacationType(); // 데이터가 비어있으면 빈 리스트 반환 (null 방지) return (codeList != null) ? codeList : new ArrayList<>(); } }