package com.lcry.springcloudalibaba.controller; import com.lcry.springcloudalibaba.domain.CommonResult; import com.lcry.springcloudalibaba.service.StorageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * StorageController * * @author lcry * @date 2020/03/18 15:47 */ @RestController public class StorageController { @Resource private StorageService storageService; /** * 扣减库存 */ @PostMapping("/storage/decrease") public CommonResult decrease(Long productId, Integer count) { storageService.decrease(productId, count); return new CommonResult(200,"扣减库存成功!"); } }