package zs.payment.controller; import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; 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; import zs.payment.req.yunmall.goods.GoodsSaveReq; import zs.payment.service.yunmall.goods.GoodsService; import javax.validation.Valid; @Slf4j @RestController @RequestMapping("/yunmall/goods") public class YunMallGoodsController { @Autowired private GoodsService goodsService; /** * 根据op,进行创建或删除生态商品 */ @PostMapping("/save") public Boolean saveGoods(@Valid @RequestBody GoodsSaveReq req){ log.info("---/yunmall/goods/save传入的参数为{}---", JSONObject.toJSONString(req)); return goodsService.saveGoods(req.getGdId(),req.getOp()); } }