yeguodong 3 bulan lalu
induk
melakukan
875c91e125

+ 38 - 0
src/main/java/cn/hnthyy/thmz/controller/taobao/TaobaoController.java

@@ -0,0 +1,38 @@
+package cn.hnthyy.thmz.controller.taobao;
+
+import cn.hnthyy.thmz.Utils.HttpUtil;
+import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.vo.MzPrescriptionVo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.json.JSONObject;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.Map;
+
+@Slf4j
+@RestController
+@RequestMapping("/Taobao")
+public class TaobaoController {
+
+    private String url = "http://130.150.161.113:7001/pay/ypTaobao/";
+
+    @RequestMapping(value = "/getCodeByParent", method = {RequestMethod.GET})
+    public ResponseEntity<String> getCodeByParent(@RequestParam String parentCode) {
+        try {
+            String result = HttpUtil.sendHttpGet(url + "/getCodeByParent?parentCode=" + parentCode, "utf-8", 40000);
+            if (StringUtils.isBlank(result)) {
+                return ResponseEntity.noContent().build();
+            }
+            return ResponseEntity.ok()
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .body(result);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+}