Skip to content
Closed
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 @@ -25,6 +25,7 @@
* @ 수정일 수정자 수정내용
* @ --------- --------- -------------------------------
* @ 2009.03.16 최초생성
* @ 2026.06.23 이백행 [2026년 컨트리뷰션] 불필요한 예외(throws Exception) 제거
*
* @author 개발프레임웍크 실행환경 개발팀
* @since 2009. 03.16
Expand All @@ -39,47 +40,41 @@ public interface EgovSampleService {
* 글을 등록한다.
* @param vo - 등록할 정보가 담긴 SampleVO
* @return 등록 결과
* @exception Exception
*/
void insertSample(SampleVO vo) throws Exception;
void insertSample(SampleVO vo);

/**
* 글을 수정한다.
* @param vo - 수정할 정보가 담긴 SampleVO
* @return void형
* @exception Exception
*/
void updateSample(SampleVO vo) throws Exception;
void updateSample(SampleVO vo);

/**
* 글을 삭제한다.
* @param vo - 삭제할 정보가 담긴 SampleVO
* @return void형
* @exception Exception
*/
void deleteSample(SampleVO vo) throws Exception;
void deleteSample(SampleVO vo);

/**
* 글을 조회한다.
* @param vo - 조회할 정보가 담긴 SampleVO
* @return 조회한 글
* @exception Exception
*/
SampleVO selectSample(SampleVO vo) throws Exception;
SampleVO selectSample(SampleVO vo);

/**
* 글 목록을 조회한다.
* @param searchVO - 조회할 정보가 담긴 VO
* @return 글 목록
* @exception Exception
*/
List<?> selectSampleList(SampleVO vo) throws Exception;
List<?> selectSampleList(SampleVO vo);

/**
* 글 총 갯수를 조회한다.
* @param searchVO - 조회할 정보가 담긴 VO
* @return 글 총 갯수
* @exception
*/
int selectSampleListTotCnt(SampleVO vo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@
import java.util.List;

import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.egovframe.rte.fdl.cmmn.exception.BaseRuntimeException;
import org.egovframe.rte.fdl.cmmn.exception.EgovBizException;
import org.egovframe.rte.fdl.cmmn.exception.FdlException;
import org.egovframe.rte.fdl.idgnr.EgovIdGnrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Service;

import egovframework.example.sample.service.EgovSampleService;
import egovframework.example.sample.service.SampleVO;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;

/**
* @Class Name : EgovSampleServiceImpl.java
Expand All @@ -35,6 +41,7 @@
* @ 수정일 수정자 수정내용
* @ --------- --------- -------------------------------
* @ 2009.03.16 최초생성
* @ 2026.06.23 이백행 [2026년 컨트리뷰션] 불필요한 예외(throws Exception) 제거
*
* @author 개발프레임웍크 실행환경 개발팀
* @since 2009. 03.16
Expand All @@ -45,6 +52,7 @@
*/

@Service("sampleService")
@RequiredArgsConstructor
public class EgovSampleServiceImpl extends EgovAbstractServiceImpl implements EgovSampleService {

private static final Logger LOGGER = LoggerFactory.getLogger(EgovSampleServiceImpl.class);
Expand All @@ -57,18 +65,24 @@ public class EgovSampleServiceImpl extends EgovAbstractServiceImpl implements Eg
@Resource(name = "egovIdGnrService")
private EgovIdGnrService egovIdGnrService;

private final MessageSource messageSource;

/**
* 글을 등록한다.
* @param vo - 등록할 정보가 담긴 SampleVO
* @return 등록 결과
* @exception Exception
*/
@Override
public void insertSample(SampleVO vo) throws Exception {
public void insertSample(SampleVO vo) {
LOGGER.debug(vo.toString());

/** ID Generation Service */
String id = egovIdGnrService.getNextStringId();
String id;
try {
id = egovIdGnrService.getNextStringId();
} catch (FdlException e) {
throw new BaseRuntimeException(e);
}
vo.setId(id);
LOGGER.debug(vo.toString());

Expand All @@ -79,54 +93,51 @@ public void insertSample(SampleVO vo) throws Exception {
* 글을 수정한다.
* @param vo - 수정할 정보가 담긴 SampleVO
* @return void형
* @exception Exception
*/
@Override
public void updateSample(SampleVO vo) throws Exception {
public void updateSample(SampleVO vo) {
sampleMapper.updateSample(vo);
}

/**
* 글을 삭제한다.
* @param vo - 삭제할 정보가 담긴 SampleVO
* @return void형
* @exception Exception
*/
@Override
public void deleteSample(SampleVO vo) throws Exception {
public void deleteSample(SampleVO vo) {
sampleMapper.deleteSample(vo);
}

/**
* 글을 조회한다.
* @param vo - 조회할 정보가 담긴 SampleVO
* @return 조회한 글
* @exception Exception
* @throws Exception
*/
@Override
public SampleVO selectSample(SampleVO vo) throws Exception {
public SampleVO selectSample(SampleVO vo) {
SampleVO resultVO = sampleMapper.selectSample(vo);
if (resultVO == null)
throw processException("info.nodata.msg");
if (resultVO == null) {
throw new BaseRuntimeException(messageSource.getMessage("info.nodata.msg", null, null, LocaleContextHolder.getLocale()));
}
return resultVO;
}

/**
* 글 목록을 조회한다.
* @param vo - 조회할 정보가 담긴 VO
* @return 글 목록
* @exception Exception
*/
@Override
public List<?> selectSampleList(SampleVO vo) throws Exception {
public List<?> selectSampleList(SampleVO vo) {
return sampleMapper.selectSampleList(vo);
}

/**
* 글 총 갯수를 조회한다.
* @param vo - 조회할 정보가 담긴 VO
* @return 글 총 갯수
* @exception
*/
@Override
public int selectSampleListTotCnt(SampleVO vo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* 수정일 수정자 수정내용
* ---------------- ------------ ---------------------------
* 2014.01.24 표준프레임워크센터 최초 생성
* 2026.06.23 이백행 [2026년 컨트리뷰션] 불필요한 예외(throws Exception) 제거
*
* </pre>
*/
Expand All @@ -43,47 +44,41 @@ public interface SampleMapper {
* 글을 등록한다.
* @param vo - 등록할 정보가 담긴 SampleVO
* @return 등록 결과
* @exception Exception
*/
void insertSample(SampleVO vo) throws Exception;
void insertSample(SampleVO vo);

/**
* 글을 수정한다.
* @param vo - 수정할 정보가 담긴 SampleVO
* @return void형
* @exception Exception
*/
void updateSample(SampleVO vo) throws Exception;
void updateSample(SampleVO vo);

/**
* 글을 삭제한다.
* @param vo - 삭제할 정보가 담긴 SampleVO
* @return void형
* @exception Exception
*/
void deleteSample(SampleVO vo) throws Exception;
void deleteSample(SampleVO vo);

/**
* 글을 조회한다.
* @param vo - 조회할 정보가 담긴 SampleVO
* @return 조회한 글
* @exception Exception
*/
SampleVO selectSample(SampleVO vo) throws Exception;
SampleVO selectSample(SampleVO vo);

/**
* 글 목록을 조회한다.
* @param vo - 조회할 정보가 담긴 VO
* @return 글 목록
* @exception Exception
*/
List<?> selectSampleList(SampleVO vo) throws Exception;
List<?> selectSampleList(SampleVO vo);

/**
* 글 총 갯수를 조회한다.
* @param vo - 조회할 정보가 담긴 VO
* @return 글 총 갯수
* @exception
*/
int selectSampleListTotCnt(SampleVO vo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* @ 수정일 수정자 수정내용
* @ --------- --------- -------------------------------
* @ 2009.03.16 최초생성
* @ 2026.06.23 이백행 [2026년 컨트리뷰션] 불필요한 예외(throws Exception) 제거
*
* @author 개발프레임웍크 실행환경 개발팀
* @since 2009. 03.16
Expand All @@ -69,10 +70,9 @@ public class EgovSampleController {
* @param sampleVO - 조회할 정보가 담긴 SampleDefaultVO
* @param model
* @return "egovSampleList"
* @exception Exception
*/
@GetMapping("/egovSampleList.do")
public String selectSampleList(@ModelAttribute("sampleVO") SampleVO sampleVO, ModelMap model) throws Exception {
public String selectSampleList(@ModelAttribute("sampleVO") SampleVO sampleVO, ModelMap model) {

/** EgovPropertyService.sample */
sampleVO.setPageUnit(propertiesService.getInt("pageUnit"));
Expand Down Expand Up @@ -107,10 +107,9 @@ public String selectSampleList(@ModelAttribute("sampleVO") SampleVO sampleVO, Mo
* @param sampleVO - 목록 조회조건 정보가 담긴 VO
* @param model
* @return "egovSampleRegister"
* @exception Exception
*/
@PostMapping("/addSampleView.do")
public String addSampleView( @ModelAttribute("sampleVO") SampleVO sampleVO, Model model) throws Exception {
public String addSampleView( @ModelAttribute("sampleVO") SampleVO sampleVO, Model model) {

model.addAttribute("sampleVO", sampleVO);

Expand All @@ -122,10 +121,9 @@ public String addSampleView( @ModelAttribute("sampleVO") SampleVO sampleVO, Mode
* @param sampleVO - 등록할 정보가 담긴 VO
* @param status
* @return "forward:/egovSampleList.do"
* @exception Exception
*/
@PostMapping("/addSample.do")
public String addSample(@Valid @ModelAttribute("sampleVO") SampleVO sampleVO, BindingResult bindingResult, Model model, SessionStatus status) throws Exception {
public String addSample(@Valid @ModelAttribute("sampleVO") SampleVO sampleVO, BindingResult bindingResult, Model model, SessionStatus status) {

if (bindingResult.hasErrors()) {
model.addAttribute("sampleVO", sampleVO);
Expand All @@ -143,10 +141,9 @@ public String addSample(@Valid @ModelAttribute("sampleVO") SampleVO sampleVO, Bi
* @param id - 수정할 글 id
* @param model
* @return "egovSampleRegister"
* @exception Exception
*/
@PostMapping("/updateSampleView.do")
public String updateSampleView(@ModelAttribute("sampleVO") SampleVO sampleVO, Model model) throws Exception {
public String updateSampleView(@ModelAttribute("sampleVO") SampleVO sampleVO, Model model) {

SampleVO detail = sampleService.selectSample(sampleVO);
detail.setSearchCondition(sampleVO.getSearchCondition());
Expand All @@ -163,11 +160,10 @@ public String updateSampleView(@ModelAttribute("sampleVO") SampleVO sampleVO, Mo
* @param sampleVO - 수정할 정보가 담긴 VO
* @param status
* @return "forward:/egovSampleList.do"
* @exception Exception
*/
@PostMapping("/updateSample.do")
public String updateSample(@Valid @ModelAttribute("sampleVO") SampleVO sampleVO, BindingResult bindingResult,
Model model, RedirectAttributes redirectAttributes, SessionStatus status) throws Exception {
Model model, RedirectAttributes redirectAttributes, SessionStatus status) {

if (bindingResult.hasErrors()) {
model.addAttribute("sampleVO", sampleVO);
Expand All @@ -189,10 +185,9 @@ public String updateSample(@Valid @ModelAttribute("sampleVO") SampleVO sampleVO,
* @param sampleVO - 삭제할 정보가 담긴 VO
* @param status
* @return "forward:/egovSampleList.do"
* @exception Exception
*/
@PostMapping("/deleteSample.do")
public String deleteSample(@ModelAttribute("sampleVO") SampleVO sampleVO, RedirectAttributes redirectAttributes, SessionStatus status) throws Exception {
public String deleteSample(@ModelAttribute("sampleVO") SampleVO sampleVO, RedirectAttributes redirectAttributes, SessionStatus status) {

sampleService.deleteSample(sampleVO);
status.setComplete();
Expand Down