| | |
| | | @Autowired |
| | | private AppCouponClient appCouponClient; |
| | | |
| | | |
| | | /** |
| | | * 远程调用 根据名称 查询优惠券ids |
| | | * @return |
| | | */ |
| | | @PostMapping("/getCouponIdsByName/{name}") |
| | | public R<List<Integer>> getCouponIdsByName(@PathVariable("name")String name) { |
| | | List<Integer> collect = tCouponService.list(new QueryWrapper<TCoupon>() |
| | | .eq("name", name)).stream().map(TCoupon::getId).collect(Collectors.toList()); |
| | | return R.ok(collect); |
| | | } |
| | | @PostMapping("/saveGoods") |
| | | @ApiOperation(tags = {"管理后台-优惠券管理"},value = "优惠券添加") |
| | | public AjaxResult saveActivity(@RequestBody TCoupon dto) { |
| | |
| | | return R.ok(coupon); |
| | | } |
| | | |
| | | @PostMapping(value = "/getCouponById") |
| | | public R<TCoupon> getCouponById(@RequestParam("id") Integer id){ |
| | | TCoupon coupon = tCouponService.getById(id); |
| | | return R.ok(coupon); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改优惠券 |
| | | * @param coupon |
| | | * @return |
| | | */ |
| | | @PostMapping(value = "/updateCoupon") |
| | | public R updateCoupon(@RequestBody TCoupon coupon){ |
| | | tCouponService.updateById(coupon); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |