Explorar el Código

小小训练营活动
直播间商品

zouxuan hace 3 años
padre
commit
5038ad3973

+ 5 - 3
mec-web/src/main/java/com/ym/mec/web/controller/LiveGoodsController.java

@@ -7,8 +7,10 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -23,15 +25,15 @@ public class LiveGoodsController extends BaseController {
     @ApiOperation("新增直播间商品")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('liveGoods/add')")
-    public HttpResponseResult add(LiveGoods liveGoods) {
+    public HttpResponseResult add(@RequestBody LiveGoods liveGoods) {
         liveGoodsService.insert(liveGoods);
         return succeed();
     }
 
     @ApiOperation("修改直播间商品")
-    @PostMapping("/update")
+    @PostMapping(value = "/update")
     @PreAuthorize("@pcs.hasPermissions('liveGoods/update')")
-    public HttpResponseResult update(LiveGoods liveGoods) {
+    public HttpResponseResult update(@RequestBody LiveGoods liveGoods) {
         liveGoodsService.updateLiveGoods(liveGoods);
         return succeed();
     }

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/controller/LiveGoodsMapperController.java

@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -23,7 +24,7 @@ public class LiveGoodsMapperController extends BaseController {
     @ApiOperation("新增直播间商品关联")
     @PostMapping("/add")
     @PreAuthorize("@pcs.hasPermissions('liveGoodsMapper/add')")
-    public HttpResponseResult add(LiveGoodsMapper liveGoodsMapper) {
+    public HttpResponseResult add(@RequestBody LiveGoodsMapper liveGoodsMapper) {
         liveGoodsMapperService.add(liveGoodsMapper);
         return succeed();
     }