feat: 1.美团团购券相关接口
This commit is contained in:
@@ -49,6 +49,14 @@ public class OrderController {
|
||||
public Result addTemporaryDishes(@Valid @RequestBody AddTemporaryDishesDTO temporaryDishesDTO) {
|
||||
return Result.success(CodeEnum.SUCCESS, orderService.addTemporaryDishes(temporaryDishesDTO));
|
||||
}
|
||||
/**
|
||||
* 美团核销
|
||||
*/
|
||||
@PostMapping("checkCoupon")
|
||||
public Result checkCoupon(@Validated @RequestBody ThirdCouponCheckDTO checkDTO) {
|
||||
return Result.success(CodeEnum.SUCCESS, orderService.checkCoupon(checkDTO));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/updatePrice")
|
||||
public Result updatePrice(@Valid @RequestBody UpdatePriceDTO updatePriceDTO) {
|
||||
|
||||
@@ -196,6 +196,7 @@ public class PayController {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 会员支付
|
||||
*
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.chaozhanggui.system.cashierservice.controller;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.thirdcoupon.CheckCouponDTO;
|
||||
import com.chaozhanggui.system.cashierservice.service.ThirdPartyCouponService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 三方团购券
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/thirdPartyCoupon")
|
||||
public class ThirdPartyCouponController {
|
||||
|
||||
private final ThirdPartyCouponService thirdPartyCouponService;
|
||||
|
||||
public ThirdPartyCouponController(ThirdPartyCouponService thirdPartyCouponService) {
|
||||
this.thirdPartyCouponService = thirdPartyCouponService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绑定状态
|
||||
* @return 绑定状态
|
||||
*/
|
||||
@GetMapping("/state")
|
||||
public Result getState(@RequestParam Integer shopId) {
|
||||
return Result.success(CodeEnum.SUCCESS, thirdPartyCouponService.getState(shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取美团绑定链接
|
||||
* @return 美团绑定链接
|
||||
*/
|
||||
@GetMapping("bindUrl")
|
||||
public Result getBindUrl(@RequestParam Integer shopId) {
|
||||
return Result.success(CodeEnum.SUCCESS, thirdPartyCouponService.getBindUrl(shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑美团商家
|
||||
* @return 美团解绑链接
|
||||
*/
|
||||
@GetMapping("unBindUrl")
|
||||
public Result getUnBindUrl(@RequestParam Integer shopId) {
|
||||
return Result.success(CodeEnum.SUCCESS, thirdPartyCouponService.getUnBindUrl(shopId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取门店客核销券
|
||||
* @return 所有券
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public Result getActivateCoupon(@RequestParam Integer shopId, @RequestParam String code) {
|
||||
return Result.success(CodeEnum.SUCCESS, thirdPartyCouponService.getActivateCoupon(shopId, code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 核销券
|
||||
*/
|
||||
@PostMapping
|
||||
public Result checkCoupon(@RequestBody CheckCouponDTO checkCouponDTO) {
|
||||
return Result.success(CodeEnum.SUCCESS, thirdPartyCouponService.checkCoupon(checkCouponDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销券核销
|
||||
*/
|
||||
@DeleteMapping("revoke")
|
||||
public Result revokeCoupon(@RequestBody CheckCouponDTO checkCouponDTO) {
|
||||
return Result.success(CodeEnum.SUCCESS, thirdPartyCouponService.revokeCoupon(checkCouponDTO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user