|
@@ -7,6 +7,8 @@ import javax.validation.constraints.NotBlank;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -35,6 +37,8 @@ import com.hb.xframework.util.MapUtils;
|
|
|
@RequestMapping("/api/elevator")
|
|
|
@Validated
|
|
|
public class ElevatorAPIController {
|
|
|
+
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(ElevatorAPIController.class);
|
|
|
|
|
|
@Autowired
|
|
|
private QRCodeImageBuilder qrBuilder;
|
|
@@ -153,6 +157,7 @@ public class ElevatorAPIController {
|
|
|
@RequestParam(name="size",defaultValue="160") Integer size
|
|
|
){
|
|
|
|
|
|
+ long st=System.currentTimeMillis();
|
|
|
|
|
|
ElevatorCardPO card=elevatorService.getElevatorCard(userId, elevatorSerial);
|
|
|
if(card==null) {
|
|
@@ -227,6 +232,8 @@ public class ElevatorAPIController {
|
|
|
//记录下次可执行时间,5秒后才可以刷新
|
|
|
APISimpleLimiter.logCall(card.getCardNum().toString(),5);
|
|
|
|
|
|
+ logger.info("梯控码{}生成耗时:{} ms",card.getCardNum(),System.currentTimeMillis()-st);
|
|
|
+
|
|
|
return RespVOBuilder.ok(MapUtils.build("exp",qrConfig.getQrExpireTimestamp(),"floors",floorsJson,"qr","data:image/png;base64,"+imgbase64));
|
|
|
|
|
|
}
|