Forráskód Böngészése

安康码的接口 3

shiqian 3 éve
szülő
commit
47882ec77e

+ 5 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/AnkangMaController.java

@@ -3,6 +3,7 @@ package com.boman.web.core.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -29,6 +30,10 @@ public class AnkangMaController {
      */
     @GetMapping("/info/{idCard}")
     public AjaxResult getByIdCard(@PathVariable("idCard") String idCard) {
+        if (StringUtils.isBlank(idCard) || "null".equals(idCard)) {
+            return AjaxResult.error("身份证不能为空");
+        }
+
         final JSONObject info = vaccineInfoService.getByIdCard(idCard);
         if (info == null) {
             return AjaxResult.error("档案库中无此人,身份证:" + idCard);