叫号返回叫号状态
This commit is contained in:
@@ -5,6 +5,8 @@ import cn.ysk.cashier.dto.calltable.*;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.service.app.TbCallService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -20,6 +22,7 @@ import java.util.HashMap;
|
||||
@AllArgsConstructor
|
||||
public class TbCallTableController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TbCallTableController.class);
|
||||
private final TbCallService tbCallService;
|
||||
|
||||
@AnonymousAccess
|
||||
@@ -83,9 +86,11 @@ public class TbCallTableController {
|
||||
try {
|
||||
return ResponseEntity.ok(tbCallService.call(callQueueDTO));
|
||||
}catch (BadRequestException e) {
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("message", e.getMessage());
|
||||
return ResponseEntity.badRequest().body(data);
|
||||
log.error("异常", e);
|
||||
return ResponseEntity.ok(new HashMap<String, Object>(){{
|
||||
put("state", "0");
|
||||
put("message", e.getMessage());
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user