fixed: response status 변경, list 객체 바인딩 수정
This commit is contained in:
@@ -10,6 +10,7 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ContentDisposition;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -56,6 +57,7 @@ public class AttachmentApiController {
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/api/v1/upload")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public AttachmentFileResponseDto upload(@RequestParam("file") MultipartFile file) {
|
||||
return attachmentService.uploadFile(file);
|
||||
}
|
||||
@@ -69,6 +71,7 @@ public class AttachmentApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/api/v1/upload/multi")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public List<AttachmentFileResponseDto> uploadMulti(@RequestParam("files") List<MultipartFile> files) {
|
||||
return attachmentService.uploadFiles(files);
|
||||
}
|
||||
@@ -81,6 +84,7 @@ public class AttachmentApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/api/v1/upload/editor")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public AttachmentEditorResponseDto uploadEditor(@RequestBody AttachmentBase64RequestDto editorRequestDto) {
|
||||
return attachmentService.uploadEditor(editorRequestDto);
|
||||
}
|
||||
@@ -210,6 +214,7 @@ public class AttachmentApiController {
|
||||
* @return 새로 생성한 첨부파일 code
|
||||
*/
|
||||
@PostMapping(value = "/api/v1/attachments/file")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public String save(@RequestBody List<AttachmentTempSaveRequestDto> saveRequestDtoList) {
|
||||
return attachmentService.save(saveRequestDtoList);
|
||||
}
|
||||
@@ -260,6 +265,7 @@ public class AttachmentApiController {
|
||||
* @param uniqueId
|
||||
*/
|
||||
@DeleteMapping(value = "/api/v1/attachments/{uniqueId}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable String uniqueId) {
|
||||
attachmentService.delete(uniqueId);
|
||||
}
|
||||
@@ -273,6 +279,7 @@ public class AttachmentApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/api/v1/attachments/upload", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, MediaType.APPLICATION_JSON_VALUE})
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public String uploadAndSave(@RequestPart(value = "files", required = true) List<MultipartFile> files,
|
||||
@RequestPart(value = "info", required = false) AttachmentUploadRequestDto uploadRequestDto) {
|
||||
return attachmentService.uploadAndSave(files, uploadRequestDto);
|
||||
@@ -339,6 +346,7 @@ public class AttachmentApiController {
|
||||
* @param attachmentCode
|
||||
*/
|
||||
@DeleteMapping("/api/v1/attachments/{attachmentCode}/children")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void deleteAllEmptyEntity(@PathVariable String attachmentCode) {
|
||||
attachmentService.deleteAllEmptyEntity(attachmentCode);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -94,6 +95,7 @@ public class BannerApiController {
|
||||
* @return BannerResponseDto 배너 상세 응답 DTO
|
||||
*/
|
||||
@PostMapping("/api/v1/banners")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public BannerResponseDto save(@RequestBody @Valid BannerSaveRequestDto requestDto) {
|
||||
return bannerService.save(requestDto);
|
||||
}
|
||||
@@ -128,6 +130,7 @@ public class BannerApiController {
|
||||
* @param bannerNo 배너 번호
|
||||
*/
|
||||
@DeleteMapping("/api/v1/banners/{bannerNo}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable Integer bannerNo) {
|
||||
bannerService.delete(bannerNo);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.egovframe.cloud.portalservice.domain.code.CodeRepository;
|
||||
import org.egovframe.cloud.portalservice.service.code.CodeService;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -79,6 +80,7 @@ public class CodeApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/api/v1/codes")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public String save(@RequestBody @Valid CodeSaveRequestDto requestDto) {
|
||||
return codeService.save(requestDto);
|
||||
}
|
||||
@@ -113,6 +115,7 @@ public class CodeApiController {
|
||||
* @param codeId
|
||||
*/
|
||||
@DeleteMapping("/api/v1/codes/{codeId}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable String codeId) {
|
||||
codeService.delete(codeId);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.egovframe.cloud.portalservice.domain.code.CodeRepository;
|
||||
import org.egovframe.cloud.portalservice.service.code.CodeDetailService;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -100,6 +101,7 @@ public class CodeDetailApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/api/v1/code-details")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public String save(@RequestBody @Valid CodeDetailSaveRequestDto requestDto) {
|
||||
return codeDetailService.save(requestDto);
|
||||
}
|
||||
@@ -134,6 +136,7 @@ public class CodeDetailApiController {
|
||||
* @param codeId
|
||||
*/
|
||||
@DeleteMapping("/api/v1/code-details/{codeId}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable String codeId) {
|
||||
codeDetailService.delete(codeId);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -72,6 +73,7 @@ public class ContentApiController {
|
||||
* @return ContentResponseDto 컨텐츠 상세 응답 DTO
|
||||
*/
|
||||
@PostMapping("/api/v1/contents")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public ContentResponseDto save(@RequestBody @Valid ContentSaveRequestDto requestDto) {
|
||||
return contentService.save(requestDto);
|
||||
}
|
||||
@@ -94,6 +96,7 @@ public class ContentApiController {
|
||||
* @param contentNo 컨텐츠 번호
|
||||
*/
|
||||
@DeleteMapping("/api/v1/contents/{contentNo}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable Integer contentNo) {
|
||||
contentService.delete(contentNo);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.egovframe.cloud.portalservice.api.menu.dto.*;
|
||||
import org.egovframe.cloud.portalservice.domain.menu.SiteRepository;
|
||||
import org.egovframe.cloud.portalservice.service.menu.MenuService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -75,6 +76,7 @@ public class MenuApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/api/v1/menus")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public MenuTreeResponseDto save(@RequestBody @Valid MenuTreeRequestDto menuTreeRequestDto) {
|
||||
return menuService.save(menuTreeRequestDto);
|
||||
}
|
||||
@@ -121,6 +123,7 @@ public class MenuApiController {
|
||||
* @param menuId
|
||||
*/
|
||||
@DeleteMapping(value = "/api/v1/menus/{menuId}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable Long menuId) {
|
||||
menuService.delete(menuId);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.egovframe.cloud.portalservice.api.menu.dto.MenuRoleResponseDto;
|
||||
import org.egovframe.cloud.portalservice.api.menu.dto.MenuSideResponseDto;
|
||||
import org.egovframe.cloud.portalservice.domain.user.User;
|
||||
import org.egovframe.cloud.portalservice.service.menu.MenuRoleService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -54,6 +55,7 @@ public class MenuRoleApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/api/v1/menu-roles")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public String save(@RequestBody List<MenuRoleRequestDto> menuRoleRequestDtoList) {
|
||||
return menuRoleService.save(menuRoleRequestDtoList);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,6 @@ public class MenuDnDRequestDto {
|
||||
this.parentId = parentId;
|
||||
this.level = level;
|
||||
this.icon = icon;
|
||||
this.children = new ArrayList<>(children);
|
||||
this.children = children == null ? null : new ArrayList<>(children);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,6 @@ public class MenuRoleRequestDto {
|
||||
this.sortSeq = sortSeq;
|
||||
this.icon = icon;
|
||||
this.level = level;
|
||||
this.children = new ArrayList<>(children);
|
||||
this.children = children == null ? null : new ArrayList<>(children);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.egovframe.cloud.portalservice.api.policy.dto.PolicyUpdateRequestDto;
|
||||
import org.egovframe.cloud.portalservice.service.policy.PolicyService;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
@@ -76,6 +77,7 @@ public class PolicyApiController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/api/v1/policies")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public Long save(@RequestBody PolicySaveRequestDto saveRequestDto) {
|
||||
return policyService.save(saveRequestDto);
|
||||
}
|
||||
@@ -110,6 +112,7 @@ public class PolicyApiController {
|
||||
* @param id
|
||||
*/
|
||||
@DeleteMapping("/api/v1/policies/{id}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable Long id) {
|
||||
policyService.delete(id);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.web.PageableDefault;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
@@ -83,6 +84,7 @@ public class PrivacyApiController {
|
||||
* @return PrivacyResponseDto 개인정보처리방침 상세 응답 DTO
|
||||
*/
|
||||
@PostMapping("/api/v1/privacies")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public PrivacyResponseDto save(@RequestBody @Valid PrivacySaveRequestDto requestDto) {
|
||||
return privacyService.save(requestDto);
|
||||
}
|
||||
@@ -117,6 +119,7 @@ public class PrivacyApiController {
|
||||
* @param privacyNo 개인정보처리방침 번호
|
||||
*/
|
||||
@DeleteMapping("/api/v1/privacies/{privacyNo}")
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
public void delete(@PathVariable Integer privacyNo) {
|
||||
privacyService.delete(privacyNo);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.egovframe.cloud.portalservice.api.statistics.dto.StatisticsResponseDto;
|
||||
import org.egovframe.cloud.portalservice.api.statistics.dto.StatisticsYMRequestDto;
|
||||
import org.egovframe.cloud.portalservice.service.statistics.StatisticsService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -59,6 +60,7 @@ public class StatisticsApiController {
|
||||
* @param request
|
||||
*/
|
||||
@PostMapping("/api/v1/statistics/{statisticsId}")
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
public void save(@PathVariable String statisticsId, HttpServletRequest request) {
|
||||
statisticsService.save(request, statisticsId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user