File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
code/backend/src/main/java/edu/bu/cs673/secondhand Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public ResultVo addFavorite(@CookieValue("shUserId")
36
36
return ResultVo .fail (ErrorMsg .FAVORITE_EXIT );
37
37
}
38
38
39
- @ GetMapping ("/delete" )
39
+ @ DeleteMapping ("/delete" )
40
40
public ResultVo deleteFavorite (@ CookieValue ("shUserId" )
41
41
@ NotNull (message = "Login Fail, try again" )
42
42
@ NotEmpty (message = "Login Fail, try again" ) String shUserId ,
Original file line number Diff line number Diff line change @@ -145,10 +145,11 @@ public ResultVo removeItem(@CookieValue("shUserId")
145
145
public ResultVo updateItem (@ CookieValue ("shUserId" )
146
146
@ NotNull (message = "Login fail, try again!" )
147
147
@ NotEmpty (message = "Login fail, try again!" )
148
- String userId ,
148
+ String shUserId ,
149
149
@ RequestBody (required = true ) IdleItem item ) {
150
150
// TODO: allow admin to update item
151
- if (item .getUserId ().toString ().equals (userId )) {
151
+ item .setUserId (Long .valueOf (shUserId ));
152
+ if (item .getUserId ().toString ().equals (shUserId )) {
152
153
if (itemService .updateItem (item )) {
153
154
return ResultVo .success (item );
154
155
}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ public class Order {
12
12
13
13
private Long idleId ;
14
14
15
+ private IdleItem idleItem ;
16
+
15
17
private BigDecimal orderPrice ;
16
18
17
19
private Byte paymentStatus ;
@@ -62,6 +64,14 @@ public BigDecimal getOrderPrice() {
62
64
return orderPrice ;
63
65
}
64
66
67
+ public IdleItem getIdleItem () {
68
+ return idleItem ;
69
+ }
70
+
71
+ public void setIdleItem (IdleItem idleItem ) {
72
+ this .idleItem = idleItem ;
73
+ }
74
+
65
75
public void setOrderPrice (BigDecimal orderPrice ) {
66
76
this .orderPrice = orderPrice ;
67
77
}
@@ -113,10 +123,4 @@ public Byte getIsDeleted() {
113
123
public void setIsDeleted (Byte isDeleted ) {
114
124
this .isDeleted = isDeleted ;
115
125
}
116
-
117
- public Order getIdleItem () {
118
- return null ;
119
- }
120
-
121
- public void setIdleItem (IdleItem idleItem ) {}
122
126
}
You can’t perform that action at this time.
0 commit comments