优惠券+异常全局处理

This commit is contained in:
19991905653
2024-04-10 18:16:28 +08:00
parent 342d0d82e1
commit 3a90299b64
43 changed files with 1374 additions and 579 deletions

View File

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
import java.text.ParseException;
@CrossOrigin(origins = "*")
@RestController
@@ -51,7 +52,7 @@ public class OrderController {
orderService.testMessage(tableId,message);
}
@GetMapping("/tradeIntegral")
private Result tradeIntegral(@RequestParam("userId") String userId, @RequestParam("id") String id) throws IOException {
private Result tradeIntegral(@RequestParam("userId") String userId, @RequestParam("id") String id) throws IOException, ParseException {
return orderService.tradeIntegral(userId,id);
}
// @GetMapping("/我的积分")
@@ -65,13 +66,21 @@ public class OrderController {
return orderService.mineCoupons(userId,status,page,size);
}
@GetMapping("/findCoupons")
private Result findCoupons(@RequestHeader String token,
private Result findCoupons(@RequestHeader String token,@RequestParam String type,
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size) throws IOException {
return orderService.findCoupons(page,size);
return orderService.findCoupons(type,page,size);
}
@GetMapping("/findWiningUser")
private Result findWiningUser(){
return orderService.findWiningUser();
}
@GetMapping("/getYhqPara")
private Result getYhqPara(){
return orderService.getYhqPara();
}
@GetMapping("/testPay")
private Result testPay(@RequestParam Integer orderId){
return orderService.testPay(orderId);
}
}

View File

@@ -11,6 +11,7 @@ import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
import com.chaozhanggui.system.cashierservice.entity.dto.AuthUserDto;
import com.chaozhanggui.system.cashierservice.entity.dto.OnlineUserDto;
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralFlowVo;
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralVo;
import com.chaozhanggui.system.cashierservice.entity.vo.OrderVo;
import com.chaozhanggui.system.cashierservice.service.LoginService;
@@ -76,4 +77,10 @@ public class UserContoller {
String userSign = jsonObject.getString("userSign");
return userService.modityIntegral(integralVo,userSign);
}
@GetMapping("/userIntegral")
public JSONObject userIntegral(@RequestHeader String token,@RequestBody IntegralFlowVo integralFlowVo ) throws Exception {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userSign = jsonObject.getString("userSign");
return userService.userIntegral(integralFlowVo,userSign);
}
}