|
@@ -1,20 +1,40 @@
|
|
|
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;
|
|
|
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;
|
|
|
+
|
|
|
/**
|
|
|
- * @Project : huimv.shiwan
|
|
|
- * @Package : com.huimv.apiservice.controller
|
|
|
- * @Description : TODO
|
|
|
- * @Author : yuxuexuan
|
|
|
- * @Create : 2021/5/8 0008 17:13
|
|
|
- **/
|
|
|
+ * @Author yinhao
|
|
|
+ * @Date 2021/5/8 16:09
|
|
|
+ * @Description
|
|
|
+ */
|
|
|
+@CrossOrigin
|
|
|
@RestController
|
|
|
@RequestMapping("/pig")
|
|
|
-@CrossOrigin
|
|
|
-public class pigController {
|
|
|
+public class PigController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private PigService pigService;
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping("/getPigInfo")
|
|
|
+ public R getPigInfo(@RequestParam("accessToken") String accessToken,
|
|
|
+ @RequestParam("pigEarTagNo") Integer pigEarTagNo) {
|
|
|
+
|
|
|
+
|
|
|
+ PigBaseVo pigBaseVo = pigService.getPigInfoByEarTagNo(pigEarTagNo);
|
|
|
+
|
|
|
+ return Objects.requireNonNull(R.ok().put("code", 1000)).put("data",pigBaseVo);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|