| package io.seata.sample.controller; |
| |
| import io.seata.sample.service.StockService; |
| import org.springframework.beans.factory.annotation.Autowired; |
| import org.springframework.web.bind.annotation.GetMapping; |
| import org.springframework.web.bind.annotation.RestController; |
| |
| /** |
| * Description: |
| * |
| * @author fangliangsheng |
| * @date 2019/3/28 |
| */ |
| @RestController |
| public class StockController { |
| |
| @Autowired |
| private StockService stockService; |
| |
| @GetMapping(path = "/deduct") |
| public Boolean deduct(String commodityCode, Integer count) { |
| stockService.deduct(commodityCode, count); |
| return true; |
| } |
| } |