|
@@ -1,5 +1,7 @@
|
|
|
package com.huimv.apiservice.controller;
|
|
|
|
|
|
+import com.huimv.apiservice.entity.vo.PigBaseVo;
|
|
|
+import com.huimv.apiservice.service.PigService;
|
|
|
import com.huimv.common.utils.R;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
@@ -7,10 +9,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
/**
|
|
|
- * @Author yinhao
|
|
|
- * @Date 2021/5/8 16:09
|
|
|
- * @Description
|
|
|
+ * @author yinhao
|
|
|
+ * @date 2021/5/8 16:09
|
|
|
*/
|
|
|
@CrossOrigin
|
|
|
@RestController
|
|
@@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class PigController {
|
|
|
|
|
|
@Autowired
|
|
|
+ private PigService pigService;
|
|
|
|
|
|
|
|
|
@RequestMapping("/getPigInfo")
|
|
@@ -25,8 +29,9 @@ public class PigController {
|
|
|
@RequestParam("pigEarTagNo") Integer pigEarTagNo) {
|
|
|
|
|
|
|
|
|
- pigService
|
|
|
+ PigBaseVo pigBaseVo = pigService.getPigInfoByEarTagNo(pigEarTagNo);
|
|
|
|
|
|
+ return Objects.requireNonNull(R.ok().put("code", 1000)).put("data",pigBaseVo);
|
|
|
}
|
|
|
|
|
|
|