From 4c8406cffe845e5233a51a7955925dadbf704a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EA=B8=B0?= Date: Thu, 16 May 2024 00:40:27 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EB=8F=99=ED=97=8C=EA=B3=BC=20=EB=AF=BC?= =?UTF-8?q?=EA=B8=B0=EC=9D=98=20=EB=A7=8C=EB=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AuctionController.class | Bin 4621 -> 5430 bytes .../project/one/auction/domain/Auction.class | Bin 3210 -> 3519 bytes .../auction/domain/AuctionModifyRequest.class | Bin 3312 -> 1672 bytes .../one/auction/service/AuctionService.class | Bin 3901 -> 3871 bytes .../auction/controller/AuctionController.java | 44 +++++++++++------- .../project/one/auction/domain/Auction.java | 14 ++++-- .../auction/domain/AuctionModifyRequest.java | 11 +---- .../one/auction/service/AuctionService.java | 12 ++--- 8 files changed, 45 insertions(+), 36 deletions(-) diff --git a/backend/ready/out/production/classes/project/one/auction/controller/AuctionController.class b/backend/ready/out/production/classes/project/one/auction/controller/AuctionController.class index 2bc3e7b43de1c9d7b64c6413704f6f389e696722..45076a50d6bc16c0538928e70596b19a0e967162 100644 GIT binary patch literal 5430 zcmc&&YjYD-7=BJ$NSdZVFScAYT7N^1*M0hMjCqzg$l>~2~s7YpS9npcAqRikI2dGdPNBseQ^Ka1j7aZTSyV-0mWwwmybkf~DIp;mk`@GNlz9;*~ z-@p70pbOLGC_$+QWqvHdQig3wRXHn#bwNo;f|v^HvXT(ON2FJ;Jce znl>z{<8oMHXbBZFqM2W3ELgLHK6p{?fzOW$_!*kqFJ-6tF(wR2T2e`9lF%=nlQIts)lo^$JoQVOCPpbzdV?!G z4pxVC?q<+2GBC>ZLc}fTS!UY<30>AFjfk)HV;x>+s1hTQzBpkyrr1$DTo}b{RIUA8 zg~^KmLtFapllh0w(hsJdKbi`pXTC~byON%{lD_ln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|5M}(}AB@vhYC@#5`i57h1 zi0|=4Jo;lk`XfHlgkd)k4>M+AhfstpJgUbfWZ?oH9~PJME#q>D*uMO?aS;j$<6@d)Jxo8O^UrnoL^7GW+-N8C}Jp#gcGBvHlPUf z8uGG$C-hP1VkYvR$^D8CbK}2&{YbrGstByh9dLv3Uf_0^X8P2w Y#jf}8l-i>I7~RIc?oK05&;9Q7Um#0F`~Uy| diff --git a/backend/ready/out/production/classes/project/one/auction/domain/Auction.class b/backend/ready/out/production/classes/project/one/auction/domain/Auction.class index e52a0439ee13069df4b56d5cc3ccda67112e448c..04ac93bfa9e944ad411165b44bbe3c0609edec03 100644 GIT binary patch literal 3519 zcma)8YggMw5S=x~#zq7R2?-=k0wE2L2IbMDZAj7*AgNmyXfSTm7ZuXhhzQ9?mfOR> zYR^eed-|b2pg*doceFA#(kAg2NwatE-JRK)vH$(=?|+Es5qV|G(Lj;%1`Sd{(Ac5% zi)DJ2-!QlK52YOmDm-+3H+n2+V1A)qrXea7scg_N8G_Eo?vZ;W&1zs<-ntdZ8Z0>b z!LNcY&M#D7=4HBwG)Ul~biVk5s6IPe~=y1v|OAMMMqW+6v>-(1LbD|FdT z7W2`8i=@p}-(I9ReYqLRZIx9)SGAFDpLoE3uq7idwTXH7cG@ql$b~v880c1u0UjtKaz{Rsmo*WdRcaCR7%<0|4Vb3p@dUft>}`0AR9Zfpw${y+Z{&H;^j@Q`C0so9q2Qvz!LO1&|FO3!kh17^e-w_7nlB^5q?Z`WyUEF z_#U43sf0^9gG*w`NkvN}^Y~dDJ~=FJ{YAV{mA=F`pYlPnQGxX*yZY*wr5?>fqRAns z5)rgXTRNTTesxp{3EI}5=W@R~s^SEFr9aP1zdEWw1wGg6%=N3I>RHf^Ugt)?I;#8y z)o53j=f!??RJRDK>(6tuUmew4g1*-4-0D|H^`f9}^l^>!tD{<1&iv{ z`c|)Vx8L)q!64{6`aZd@?i6@MlfR+idZ)mcb_)DJKWfO+Y4U`Yyr;q{&NKazjg=NRyYfPJ=3Rs!kIYRjH=v>B&sbSF+S&FXp;)t{CDAcx-x``i!wik6B zKeV?@sHoz55N-{XTTytl$x3G|nxV6JMcUW#F0y7vvi6eL&+}$2I?s6x*GcqI6u;c{ zm_BdO1zxW90>{<7vS86AUOC-6j*{pg4tR0VqNOY?@sl7+yK2!Z^r|AO?;dL}4fGCl z6c$b#8QrzsJ;|m02{I^{bP{fuiX_Q#!m;Zn`O? z7!eE%lMx19wO+mVOtnU){wCu#Rk$NLWU&)<|=*>+-|<9u-yRtr^tgIecKB;>`S zRHU3J74e`{ejJvHXizF1PnNnk5Ep7irN|#vis0W$85pS);b^4@M=EXXMQQBn$3A!4 z%IC!`o)iD&=SMgi$;(Yz#@VZ2fLXX=5RszWh-MJIf%}_?@ALswc)aA`6z)0j768nX zao}wLm?-1G1ppW<i{rJ#(^6EFjB^W_W)q3j05ij zz+f2%?xG4DC#vDPiB8$LE8MHi-%0&~hYH=pm0_YY_&;!qvjn!zf(Z{qa_4!I!9b;lepUC@JE~{faujo@*XQix;IUM? zc~2ytE0PyP^1eu(E0PyQ@_|UcSR`K+$!(E*xkz3X$zRZyLc^{U$txoHEAh?CMe?dh z{#qoj6v<7I{EfKn)gpOAB!4TCn?>?%k^G%V-YAmq2;>TVpP9Im{jB*P^8?X8AR^S5 diff --git a/backend/ready/out/production/classes/project/one/auction/domain/AuctionModifyRequest.class b/backend/ready/out/production/classes/project/one/auction/domain/AuctionModifyRequest.class index fd6f18639944d469b258ca3d406f9d9954833b5c..17256e217b39a54ca8e37dc57e673086c606c9a0 100644 GIT binary patch literal 1672 zcmb7E+iuf95Ivj3N#nY=v?&cO5blY4F}zZ!1VucBi%8XX$5~QWj$M)s5)vN;5)l#) zd;lMXm|3SSNw!jW+1Xj`IWv3a*uVe$`~~0{9u<*6wt$=i3wZ(Wte2e1KzT_lJ%13W zFp0f(()GjGd!DARlXm#w^LzPmAp1(dI*a^33X~eB{wLpy{J7&aRWFP?`^-J(pvc6Q z3RNWeWZr>;1p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ciG>JqE+NcgrlZYYJH;(EG@ErvRXy_s;GdX750?s-d#=R*q`j&;(v4Hv$g z$;`PGub|FZ(uG@M2k}?sh+Gw9_~nWt^j@%hi_JOdIBsCbJuc$vyfpdv5J=vYe{B z!t>#SCc0YB8HMP>cB?V`STQns-f&D?`TO&(yHY8SwbH&p(sXd1VB4ra)1Y6wOdCY8 ziD|>O=d3`DrSYkT-EkHNn5Tgyx8j%sH~3K)m^m{#pz$p*<2cHjwhiA`ehRlW9B7HU zT`(#9L&Ki`t;)w{6gl?tEm7nbioGwd3C>cSTe!~O6|TNV0!fbZUqf5GgLSjRL#s%w zVuOsESJ5Zq_EqeZ@xfIL$oTLo4$63F6^FmVv5UipS8+;yel_?d#)t1>DuM5yeNMXx z*!(@hS1!=UH}6*T@EN%S+cCi3EFX_Yv6GLZT^Q$^aS{*m(Xj_5Y7a)Z;K1dI2vNqf zM4d(+9(-CJr-hRUu#VCSs&Pd3xPE~8BZ6h+B+QEv?8JvnZ5nQc#x>FA-WUX+r@{qAd&oy)NzjB2A(4pk=?}e z#MzC*cmaPTu0K(#b1#y-NXbi-q@n$Y!4#h*8eWFM6H=KIT#1#8fW3>~X;{nW`f%rP zh(zpBEB5~i=Lx(@*`M(j{)(j!>1Q3s>{>=!7FTeZ`Ag7KcbuVX z34Fn2)LfZx>jEi|58-T!RO=wRV-OmX{6=hWf;wU_Gk6C}gG2wu_?o?lTpJr~)yO3@ plS_mTIJ_D9e+zGOloRi8e3ySDGv4FhC-{sj`RC^r{*Hg5|3AOy`@;YL diff --git a/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java b/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java index 838321a..99c7adb 100644 --- a/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java +++ b/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java @@ -1,5 +1,6 @@ package project.one.auction.controller; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -7,9 +8,13 @@ import project.one.auction.domain.Auction; import project.one.auction.domain.AuctionModifyRequest; import project.one.auction.service.AuctionService; +import project.one.global.Response.MakeResponse; +import project.one.global.Response.ResponseMessage; import java.util.List; +import static project.one.global.Response.MakeResponse.getResponseMessage; + @RestController @RequestMapping("/auctions") @RequiredArgsConstructor @@ -17,44 +22,51 @@ public class AuctionController { private final AuctionService auctionService; - @PostMapping - public ResponseEntity createAuction(@RequestBody AuctionModifyRequest request) { - Auction createdAuction = auctionService.createAuction(request); - return ResponseEntity.status(HttpStatus.CREATED).body(createdAuction); + @Operation(summary = "견적 의뢰서 생성", description = "견적 의뢰서 생성 API") + @PostMapping("/{categoryId}") + public ResponseEntity> createAuction(@PathVariable(value = "categoryId") Long categoryId, @RequestBody AuctionModifyRequest request) { + Auction createdAuction = auctionService.createAuction(categoryId, request); + return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 생성 성공",createdAuction); } + @Operation(summary = "견적 의뢰서 이미지 추가", description = "견적 의뢰서 이미지 추가 API") @PostMapping("/{auctionId}/images") - public ResponseEntity addImageToAuction( + public ResponseEntity> addImageToAuction( @PathVariable Long auctionId, @RequestParam String imageUrl) { - Auction updatedAuction = auctionService.addImageToAuction(auctionId, imageUrl); - return ResponseEntity.ok(updatedAuction); + Auction addImageToAuction = auctionService.addImageToAuction(auctionId, imageUrl); + return MakeResponse.getResponseMessage(HttpStatus.OK,"이미지가 정상적으로 첨부 되었습니다",addImageToAuction); } + @Operation(summary = "경매 전체 조회", description = "경매 전체 조회 API") @GetMapping - public ResponseEntity> getAllAuctions() { + public ResponseEntity>> getAllAuctions() { List auctions = auctionService.getAllAuctions(); - return ResponseEntity.ok(auctions); + return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 전체 조회 성공",auctions); } + @Operation(summary = "경매 ID로 조회", description = "경매 ID로 조회 API") @GetMapping("/{auctionId}") - public ResponseEntity getAuctionById(@PathVariable Long auctionId) { + public ResponseEntity> getAuctionById(@PathVariable Long auctionId) { Auction auction = auctionService.getAuctionById(auctionId); - return ResponseEntity.ok(auction); + return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 ID로 조회 성공",auction); } + @Operation(summary = "경매 수정", description = "경매 수정 API") @PutMapping("/{auctionId}") - public ResponseEntity modifyAuction( + public ResponseEntity> modifyAuction( @PathVariable Long auctionId, + @RequestParam Long categoryId, @RequestBody AuctionModifyRequest request) { - Auction modifiedAuction = auctionService.modifyAuction(auctionId, request); - return ResponseEntity.ok(modifiedAuction); + Auction modifiedAuction = auctionService.modifyAuction(auctionId, categoryId, request); + return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 수정 완료",modifiedAuction); } + @Operation(summary = "경매 삭제", description = "경매 삭제 API") @DeleteMapping("/{auctionId}") - public ResponseEntity deleteAuction(@PathVariable Long auctionId) { + public ResponseEntity> deleteAuction(@PathVariable Long auctionId) { auctionService.deleteAuction(auctionId); - return ResponseEntity.noContent().build(); + return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 삭제 완료"); } } diff --git a/backend/ready/src/main/java/project/one/auction/domain/Auction.java b/backend/ready/src/main/java/project/one/auction/domain/Auction.java index 1b708d1..61afbb9 100644 --- a/backend/ready/src/main/java/project/one/auction/domain/Auction.java +++ b/backend/ready/src/main/java/project/one/auction/domain/Auction.java @@ -1,8 +1,6 @@ package project.one.auction.domain; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.Id; +import jakarta.persistence.*; import lombok.Getter; import lombok.Setter; @@ -13,7 +11,7 @@ @Entity public class Auction { - @Id + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Long id; @@ -21,7 +19,7 @@ public class Auction { private String userId; @Column(name = "category_id") - private String categoryId; + private Long categoryId; @Column(name = "place") private String place; @@ -50,4 +48,10 @@ public class Auction { @Column(name = "deleted_at") private LocalDateTime deletedAt; + @PrePersist // 생성 시간 자동 저장 + public void prePersist() { + LocalDateTime now = LocalDateTime.now(); + createdAt = now; + updatedAt = now; + } } diff --git a/backend/ready/src/main/java/project/one/auction/domain/AuctionModifyRequest.java b/backend/ready/src/main/java/project/one/auction/domain/AuctionModifyRequest.java index b41fd2d..51a6276 100644 --- a/backend/ready/src/main/java/project/one/auction/domain/AuctionModifyRequest.java +++ b/backend/ready/src/main/java/project/one/auction/domain/AuctionModifyRequest.java @@ -12,18 +12,11 @@ @NoArgsConstructor @AllArgsConstructor public class AuctionModifyRequest { - private Long id; - private String userId; - private String categoryId; + //private String categoryId; private String place; - private String photoUrl; + //private String photoUrl; private String title; private LocalDateTime scheduleDate; private String content; private String budget; - private LocalDateTime createdAt; - private LocalDateTime updatedAt; - private LocalDateTime deletedAt; - - } diff --git a/backend/ready/src/main/java/project/one/auction/service/AuctionService.java b/backend/ready/src/main/java/project/one/auction/service/AuctionService.java index 52d3e58..10b3b00 100644 --- a/backend/ready/src/main/java/project/one/auction/service/AuctionService.java +++ b/backend/ready/src/main/java/project/one/auction/service/AuctionService.java @@ -17,10 +17,10 @@ public class AuctionService { private final AuctionRepository auctionRepository; // 사용자 견적 의뢰서 생성 - public Auction createAuction(AuctionModifyRequest request) { + public Auction createAuction(Long categoryId, AuctionModifyRequest request) { Auction auction = new Auction(); - auction.setCategoryId(request.getCategoryId()); - auction.setUserId(request.getUserId()); + auction.setCategoryId(categoryId); + //auction.setUserId(request.getUserId()); auction.setTitle(request.getTitle()); auction.setContent(request.getContent()); auction.setBudget(request.getBudget()); @@ -59,12 +59,12 @@ public Auction getAuctionById(Long auctionId) { } // 사용자 견적 의뢰서 수정 - public Auction modifyAuction(Long auctionId, AuctionModifyRequest request) { + public Auction modifyAuction(Long auctionId, Long categoryId, AuctionModifyRequest request) { Optional optionalAuction = auctionRepository.findById(auctionId); if (optionalAuction.isPresent()) { Auction auction = optionalAuction.get(); - auction.setCategoryId(request.getCategoryId()); - auction.setUserId(request.getUserId()); + auction.setCategoryId(categoryId); + //auction.setUserId(request.getUserId()); auction.setTitle(request.getTitle()); auction.setContent(request.getContent()); auction.setBudget(request.getBudget()); From 4b2659d30540e1f9581a6e658fd84812ef696cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EA=B8=B0?= Date: Thu, 16 May 2024 01:19:38 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EB=AF=BC=EA=B8=B0=EC=99=80=20=EB=8F=99?= =?UTF-8?q?=ED=97=8C=EC=9D=B4=EC=9D=98=20=EC=97=AD=EC=82=AC=EC=A0=81?= =?UTF-8?q?=EC=9D=B8=20=EB=A7=8C=EB=82=A8=EC=9C=BC=EB=A1=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=95=9C=20=EB=AF=BC=EA=B8=B0=EC=9D=98=20API=201=EC=B0=A8=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AuctionController.class | Bin 5430 -> 4436 bytes .../one/auction/service/AuctionService.class | Bin 3871 -> 3726 bytes .../global/config/MultipartConverter.class | Bin 0 -> 1568 bytes .../auction/controller/AuctionController.java | 25 ++++++--------- .../one/auction/service/AuctionService.java | 5 +-- .../one/global/config/MultipartConverter.java | 30 ++++++++++++++++++ 6 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 backend/ready/out/production/classes/project/one/global/config/MultipartConverter.class create mode 100644 backend/ready/src/main/java/project/one/global/config/MultipartConverter.java diff --git a/backend/ready/out/production/classes/project/one/auction/controller/AuctionController.class b/backend/ready/out/production/classes/project/one/auction/controller/AuctionController.class index 45076a50d6bc16c0538928e70596b19a0e967162..391228066b9666016388e2050a62be2957137c3a 100644 GIT binary patch delta 1170 zcmZvb%TE(g7{$+>VM-YWNFPEF4O0{>QxNchpdjG83Mh)Ag7PY8MW|X_VAMv#(uK+0 zXvBnwi5oOfv=S3d+_-S<-{69F=id0;nW5HVn)W;M&3*iO&b zK9sm2S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rtC`jnJC zJD#?M|8=d4lS@P1g3^$nDWZRgb#Rj9BHN4C;J_gN&EHnqK|T!%{cfal6LyjnrKdnW zcHwn8g|!<=iWAll-k{qWeNq^Piaq32uookAZY1kX`o2}fKI|`I6mL`1fibWm4&oiU z5md-=NH~j>lVPkxPDW)93m~$OQc77odLJy-Sw`cYMfiiyb}eK5U3#uy6}XKc+MfXY zt_^$y?@^Qh-c$vA)B-Nq#JV6pRz-YV68lYJL7A4UEf^<8!FrfZAzVQ`t!gT2En?vL6V}DdZ$f2lAG1 zqXeUpuTBbA#&g4hCf2!zZr$*pN795*k}-Ct>tG7!A&LUYrC1avYWw@4pqM6#mHrl` zS}sP8LlP~H84E2(=Q{F*%$|0Y(Y3`P=w4`Wl-A%&kP!Wnug8qD@j@0J<&q;Q)DOv# zR4K-blZ5QBkWbYjpBBg;;ml*mG=Fuf&1`mfO!D{I(k4j;Q7K?a+b!5%UdF4n1G$5` zx3j9v0UJDEftx-3conTgnQ2|l3bu1N{}>xB>#CgFae*F+vFo>RwCMNP8jU>wyGLGg oF`RTqY^m5{bJR4OL6dI)MmNRMDVP-$_4Hy;Fh`DycI`|51Fm34`2YX_ diff --git a/backend/ready/out/production/classes/project/one/auction/service/AuctionService.class b/backend/ready/out/production/classes/project/one/auction/service/AuctionService.class index 4f06fba6e681030a15a6d8301054b80dbbae3d2f..93b59a1a991603e88d593a7846973630e037a0e0 100644 GIT binary patch delta 471 zcmXAjPfJvB7=@qTcByJ9mVi;4u zeM%^m-p+odt?4`6F$P;Au58jL>EFS0I!UKF!jGsdLRG}cBBUbHMW~Mmlg>9X5jp$G zZ=B2G>14N_Ue?nd6}rk9uBmn(?Of*)H$?pmF~A)q+f*UN1@1G2Qz*k-#-#;%z&%wh z&;*mjbaRA<%&7Jwxe4tKoyT&X$cbaT1BP6^G|bt2&|I2Vom+N3s5j5-#~@=W>|Rit fd#-Sd7tBkKDEm^naCm@4%`2>F@bn#Xt(O)lsP(PhwO*p; zDAFf?gCK+TK~#KEeDv3-h--q#VYAm+YoEQ>=5z*L$NslJ?>_*0c=^Wv>6t})G~aK( zJEyEu_*{PAv&=(}MW}5;4F! z5*m!s&sN=b5z}VSe)V5fh6tpsWrOrhG-=v}VA+h>U%_l?yR;qBcIy3ZdpVq*Tf%S# zOocV%Wp=*#mTj9?naI&{A}3{Pg=1Mh@)6T=BX=ali`>zaAf?g+)s%Vw^Fp~Ey2vH16LOj>T*cv<*icns>Y^4!T^Cir{AR|}V8adj zsWh_j1ipSF8(HhM3jPlY{tYrRaMSjchfUeG%Y);$RGZ^Aca-z$b65GELcO`Kc*0ZN Le4%G_c|r6SChu8K diff --git a/backend/ready/out/production/classes/project/one/global/config/MultipartConverter.class b/backend/ready/out/production/classes/project/one/global/config/MultipartConverter.class new file mode 100644 index 0000000000000000000000000000000000000000..394565c90a7825a6143aa08eb309b9e32b243018 GIT binary patch literal 1568 zcmb7EZBJ7%6h6Hh8=F%Ekpbchh%%;9;|F6hBv}@Wm<9t{I6 zq}S4{!#^l}OplBSXoWWgt9=SMf%)S8etD-ZyRpDXCJYM>V@@s60Q+=9B5^cR7p-f zUp1IdG1ivwXr=2L5io5AB6>PrAnSDk@ses{rKie5^4)Hy!F7!_eDutemCO7()56+) zXWSf#kibTHoVW@EGHRdz1fGmlF9MS;lW(;!7}kqixy?=(^_lc&$!B3WT0P$pm~ee| zdP-n=h=D+=^SA5f&S#FD*w23UB5*Umg~_F=!jsH&HHKFh3eWBt>BKR@{Xw+mE#Dr! zy$Xek$|F<8O>~n62+k1`sE#Z;PAY4;QIk$rRad+Gm9Slx9d7Fld)@>V4!Y8a4zG() zU_%zARE8O$B=%$epIY`da%J5X&lqN1q-_dGic968{r1bqJumFp_bq8)i0$G-DSElb-fZON2>!m z%dm3Bx`-^6(<;V>6rH}}edNf(Dxz#=&vEXddWunnqRf^Cs^bhOT6T+h(9?PdYdBj^ G4&XPc(47JR literal 0 HcmV?d00001 diff --git a/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java b/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java index 99c7adb..5e15760 100644 --- a/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java +++ b/backend/ready/src/main/java/project/one/auction/controller/AuctionController.java @@ -5,12 +5,14 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import project.one.auction.domain.Auction; import project.one.auction.domain.AuctionModifyRequest; import project.one.auction.service.AuctionService; import project.one.global.Response.MakeResponse; import project.one.global.Response.ResponseMessage; +import java.io.IOException; import java.util.List; import static project.one.global.Response.MakeResponse.getResponseMessage; @@ -23,20 +25,14 @@ public class AuctionController { private final AuctionService auctionService; @Operation(summary = "견적 의뢰서 생성", description = "견적 의뢰서 생성 API") - @PostMapping("/{categoryId}") - public ResponseEntity> createAuction(@PathVariable(value = "categoryId") Long categoryId, @RequestBody AuctionModifyRequest request) { + @PostMapping(value = "/{categoryId}") + public ResponseEntity> createAuction(@PathVariable(value = "categoryId") Long categoryId, + @RequestBody AuctionModifyRequest request) + { Auction createdAuction = auctionService.createAuction(categoryId, request); return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 생성 성공",createdAuction); } - @Operation(summary = "견적 의뢰서 이미지 추가", description = "견적 의뢰서 이미지 추가 API") - @PostMapping("/{auctionId}/images") - public ResponseEntity> addImageToAuction( - @PathVariable Long auctionId, - @RequestParam String imageUrl) { - Auction addImageToAuction = auctionService.addImageToAuction(auctionId, imageUrl); - return MakeResponse.getResponseMessage(HttpStatus.OK,"이미지가 정상적으로 첨부 되었습니다",addImageToAuction); - } @Operation(summary = "경매 전체 조회", description = "경매 전체 조회 API") @GetMapping @@ -47,7 +43,7 @@ public ResponseEntity>> getAllAuctions() { @Operation(summary = "경매 ID로 조회", description = "경매 ID로 조회 API") @GetMapping("/{auctionId}") - public ResponseEntity> getAuctionById(@PathVariable Long auctionId) { + public ResponseEntity> getAuctionById(@PathVariable(value = "auctionId") Long auctionId) { Auction auction = auctionService.getAuctionById(auctionId); return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 ID로 조회 성공",auction); } @@ -55,16 +51,15 @@ public ResponseEntity> getAuctionById(@PathVariable Lon @Operation(summary = "경매 수정", description = "경매 수정 API") @PutMapping("/{auctionId}") public ResponseEntity> modifyAuction( - @PathVariable Long auctionId, - @RequestParam Long categoryId, + @PathVariable(value = "auctionId") Long auctionId, @RequestBody AuctionModifyRequest request) { - Auction modifiedAuction = auctionService.modifyAuction(auctionId, categoryId, request); + Auction modifiedAuction = auctionService.modifyAuction(auctionId, request); return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 수정 완료",modifiedAuction); } @Operation(summary = "경매 삭제", description = "경매 삭제 API") @DeleteMapping("/{auctionId}") - public ResponseEntity> deleteAuction(@PathVariable Long auctionId) { + public ResponseEntity> deleteAuction(@PathVariable(value = "auctionId") Long auctionId) { auctionService.deleteAuction(auctionId); return MakeResponse.getResponseMessage(HttpStatus.OK,"경매 삭제 완료"); } diff --git a/backend/ready/src/main/java/project/one/auction/service/AuctionService.java b/backend/ready/src/main/java/project/one/auction/service/AuctionService.java index 10b3b00..543bc0e 100644 --- a/backend/ready/src/main/java/project/one/auction/service/AuctionService.java +++ b/backend/ready/src/main/java/project/one/auction/service/AuctionService.java @@ -2,6 +2,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; import project.one.auction.domain.Auction; import project.one.auction.domain.AuctionModifyRequest; import project.one.auction.domain.AuctionRepository; @@ -59,11 +60,11 @@ public Auction getAuctionById(Long auctionId) { } // 사용자 견적 의뢰서 수정 - public Auction modifyAuction(Long auctionId, Long categoryId, AuctionModifyRequest request) { + public Auction modifyAuction(Long auctionId, AuctionModifyRequest request) { Optional optionalAuction = auctionRepository.findById(auctionId); if (optionalAuction.isPresent()) { Auction auction = optionalAuction.get(); - auction.setCategoryId(categoryId); + //auction.setCategoryId(categoryId); //auction.setUserId(request.getUserId()); auction.setTitle(request.getTitle()); auction.setContent(request.getContent()); diff --git a/backend/ready/src/main/java/project/one/global/config/MultipartConverter.java b/backend/ready/src/main/java/project/one/global/config/MultipartConverter.java new file mode 100644 index 0000000..bb6b775 --- /dev/null +++ b/backend/ready/src/main/java/project/one/global/config/MultipartConverter.java @@ -0,0 +1,30 @@ +package project.one.global.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; +import org.springframework.stereotype.Component; + +import java.lang.reflect.Type; + +@Component +public class MultipartConverter extends AbstractJackson2HttpMessageConverter { + public MultipartConverter(ObjectMapper objectMapper) { + super(objectMapper, MediaType.APPLICATION_OCTET_STREAM); + } + + @Override + public boolean canWrite(Class clazz, MediaType mediaType) { + return false; + } + + @Override + public boolean canWrite(Type type, Class clazz, MediaType mediaType) { + return false; + } + + @Override + protected boolean canWrite(MediaType mediaType) { + return false; + } +} \ No newline at end of file