|
@@ -10,8 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.validation.constraints.Email;
|
|
|
import javax.validation.constraints.NotBlank;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
@@ -38,7 +38,7 @@ public class PigController {
|
|
|
//@Limit(key = "pig_getPigInfo",name = "pig/getPigInfo",prefix = "apiservice")
|
|
|
@GetMapping("/getPigInfo")
|
|
|
public R getPigInfo(@RequestParam(value = "accessToken") String accessToken,
|
|
|
- @NotBlank(message = "耳标号不能为空!") @RequestParam("pigEarTagNo") String pigEarTagNo) {
|
|
|
+ @NotBlank(message = "耳标号不能为空!") @RequestParam("pigEarTagNo") String pigEarTagNo) {
|
|
|
Map<String, Object> map = pigService.getPigInfoByEarTagNo(pigEarTagNo);
|
|
|
return Objects.requireNonNull(R.ok().put("code", 1000)).put("data", map);
|
|
|
}
|
|
@@ -53,7 +53,7 @@ public class PigController {
|
|
|
*/
|
|
|
@GetMapping("/getImage")
|
|
|
public R getImage(@RequestParam(value = "accessToken") String accessToken,
|
|
|
- @NotBlank(message = "耳标号111不能为空!") @RequestParam("pigEarTagNo") String pigEarTagNo) {
|
|
|
+ @NotBlank(message = "耳标号111不能为空!") @RequestParam("pigEarTagNo") String pigEarTagNo) {
|
|
|
PigImageVo pigImageVo = pigService.getImageByEarTagNo(pigEarTagNo);
|
|
|
return Objects.requireNonNull(R.ok().put("code", 1000)).put("data", pigImageVo);
|
|
|
}
|
|
@@ -110,8 +110,8 @@ public class PigController {
|
|
|
@GetMapping("/outFence")
|
|
|
public R outFence(@RequestParam(value = "accessToken", required = false) String accessToken,
|
|
|
@RequestParam("pigEarTagNo") @NotBlank(message = "耳标号不能为空!") String pigEarTagNo,
|
|
|
- @ListValue(vals = {1,2,3}) @RequestParam("status") Integer status) {
|
|
|
- pigService.outFence(pigEarTagNo,status);
|
|
|
+ @ListValue(vals = {1, 2, 3}) @NotNull(message = "出栏状态不能为空!") @RequestParam("status") Integer status) {
|
|
|
+ pigService.outFence(pigEarTagNo, status);
|
|
|
return Objects.requireNonNull(R.ok().put("code", 1000)).put("msg", "更新出栏状态成功!");
|
|
|
}
|
|
|
}
|