|
@@ -1,14 +1,12 @@
|
|
package com.its.api.its.controller.database;
|
|
package com.its.api.its.controller.database;
|
|
|
|
|
|
-import com.its.api.its.model.entity.link.TbLinkParaStup;
|
|
|
|
import com.its.api.its.model.dto.link.LinkParaStupDto;
|
|
import com.its.api.its.model.dto.link.LinkParaStupDto;
|
|
|
|
+import com.its.api.its.model.entity.link.TbLinkParaStup;
|
|
import com.its.api.its.service.link.LinkParaStupService;
|
|
import com.its.api.its.service.link.LinkParaStupService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.http.HttpStatus;
|
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -23,44 +21,43 @@ public class LinkParaStupController {
|
|
/*
|
|
/*
|
|
@ApiOperation(value = "전체조회(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupInfo.class)
|
|
@ApiOperation(value = "전체조회(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupInfo.class)
|
|
@GetMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
@GetMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
- public ResponseEntity<List<LinkParaStupDto.LinkParaStupInfo>> findAll() {
|
|
|
|
|
|
+ public List<LinkParaStupDto.LinkParaStupInfo>> findAll() {
|
|
List<LinkParaStup> data = this.service.findAll();
|
|
List<LinkParaStup> data = this.service.findAll();
|
|
List<LinkParaStupDto.LinkParaStupInfo> result = new ArrayList<>();
|
|
List<LinkParaStupDto.LinkParaStupInfo> result = new ArrayList<>();
|
|
for (LinkParaStup obj: data) {
|
|
for (LinkParaStup obj: data) {
|
|
result.add(new LinkParaStupDto.LinkParaStupInfo(obj));
|
|
result.add(new LinkParaStupDto.LinkParaStupInfo(obj));
|
|
}
|
|
}
|
|
- return new ResponseEntity<>(result, HttpStatus.OK);
|
|
|
|
|
|
+ return new >(result, HttpStatus.OK);
|
|
}
|
|
}
|
|
*/
|
|
*/
|
|
|
|
|
|
@ApiOperation(value = "개별조회(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupInfo.class)
|
|
@ApiOperation(value = "개별조회(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupInfo.class)
|
|
@GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
@GetMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
- public ResponseEntity<LinkParaStupDto.LinkParaStupInfo> findById(@PathVariable final Long id) {
|
|
|
|
|
|
+ public LinkParaStupDto.LinkParaStupInfo findById(@PathVariable final Long id) {
|
|
TbLinkParaStup obj = this.service.findById(id);
|
|
TbLinkParaStup obj = this.service.findById(id);
|
|
if (obj != null) {
|
|
if (obj != null) {
|
|
- return new ResponseEntity<>(new LinkParaStupDto.LinkParaStupInfo(obj), HttpStatus.OK);
|
|
|
|
|
|
+ return new LinkParaStupDto.LinkParaStupInfo(obj);
|
|
}
|
|
}
|
|
- return new ResponseEntity<>(null, HttpStatus.NOT_FOUND);//NO_CONTENT);
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "개별정보변경/생성(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupInfo.class)
|
|
@ApiOperation(value = "개별정보변경/생성(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupInfo.class)
|
|
@PostMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
@PostMapping(value = "/{id}", produces = {"application/json; charset=utf8"})
|
|
- public ResponseEntity<LinkParaStupDto.LinkParaStupInfo> updateById(
|
|
|
|
|
|
+ public LinkParaStupDto.LinkParaStupInfo updateById(
|
|
@PathVariable final Long id,
|
|
@PathVariable final Long id,
|
|
@RequestBody final LinkParaStupDto.LinkParaStupUpdateReq req) {
|
|
@RequestBody final LinkParaStupDto.LinkParaStupUpdateReq req) {
|
|
-
|
|
|
|
TbLinkParaStup obj = this.service.mergeById(id, req);
|
|
TbLinkParaStup obj = this.service.mergeById(id, req);
|
|
if (obj != null) {
|
|
if (obj != null) {
|
|
- return new ResponseEntity<>(new LinkParaStupDto.LinkParaStupInfo(obj), HttpStatus.OK);
|
|
|
|
|
|
+ return new LinkParaStupDto.LinkParaStupInfo(obj);
|
|
}
|
|
}
|
|
- return new ResponseEntity<>(null, HttpStatus.NOT_FOUND);//NO_CONTENT);
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "전체정보변경/생성(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupUpdateReq.class)
|
|
@ApiOperation(value = "전체정보변경/생성(TB_LINK_PARA_STUP)", response = LinkParaStupDto.LinkParaStupUpdateReq.class)
|
|
@PostMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
@PostMapping(value = "", produces = {"application/json; charset=utf8"})
|
|
- public ResponseEntity<LinkParaStupDto.LinkParaStupUpdateReq> updateById(@RequestBody final LinkParaStupDto.LinkParaStupUpdateReq req) {
|
|
|
|
|
|
+ public LinkParaStupDto.LinkParaStupUpdateReq updateById(@RequestBody final LinkParaStupDto.LinkParaStupUpdateReq req) {
|
|
LinkParaStupDto.LinkParaStupUpdateReq obj = this.service.mergeAll(req);
|
|
LinkParaStupDto.LinkParaStupUpdateReq obj = this.service.mergeAll(req);
|
|
- return new ResponseEntity<>(req, HttpStatus.OK);
|
|
|
|
|
|
+ return obj;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|