Example #1
0
 public function run()
 {
     $sitesParse = new SitesParse('/En');
     $domain = $sitesParse->getDomain();
     /*type list*/
     $typeListAPI = $domain . "/en/type/list.php";
     $httpForType = new HttpWorker($typeListAPI);
     $typeResult = $httpForType->post(array());
     $typeObj = json_decode($typeResult, true);
     $type = $typeObj["data"];
     /*word list*/
     $wordListAPI = $domain . "/en/word/list.php";
     $httpForWord = new HttpWorker($wordListAPI);
     $post = array();
     if (!empty($this->query['enTypeID'])) {
         $postData = array("enTypeID" => $this->query['enTypeID']);
         $post["data"] = json_encode($postData, true);
     }
     $wordResult = $httpForWord->post($post);
     $wordObj = json_decode($wordResult, true);
     $word = $wordObj["data"];
     $wordList = $word["wordList"];
     $type["wordList"] = $wordList;
     $data = array();
     $data["value"] = $type;
     $data["message"] = 'Ok';
     $data["code"] = 0;
     return $data;
 }
Example #2
0
 public function run()
 {
     $orderID = $this->query["orderID"];
     $sitesParse = new SitesParse('/En');
     $domain = $sitesParse->getDomain();
     $wordListAPI = $domain . "/en/word/list.php";
     $httpWorkerForWord = new HttpWorker($wordListAPI);
     $post = array();
     $wordResult = $httpWorkerForWord->post($post);
     $wordObj = json_decode($wordResult, true);
     $orderData = array("orderID" => $orderID, "showTranslate" => true);
     $orderViewAPI = $domain . "/order/view.php";
     $orderPost["data"] = json_encode($orderData, true);
     $httpForOrderView = new HttpWorker($orderViewAPI);
     $orderViewResult = $httpForOrderView->post($orderPost);
     $orderObj = json_decode($orderViewResult, true)["data"];
     $list = $orderObj["list"];
     $value = $orderObj["value"];
     $wordObj["order"]["list"] = $list;
     $wordObj["order"]["value"] = $value;
     $data["value"] = $wordObj;
     $data["message"] = 'Ok';
     $data["code"] = 0;
     return $data;
 }
Example #3
0
 public function run()
 {
     $orderID = $this->query["orderID"];
     $sitesParse = new SitesParse('/En');
     $domain = $sitesParse->getDomain();
     $orderPost = array("orderID" => $orderID, "showTranslate" => true);
     $post["data"] = json_encode($orderPost, true);
     // $orderViewAPI = "http://localhost:8888/www/En/api/module/order/view.php";
     $orderViewAPI = $domain . "/order/view.php";
     $httpForOrderView = new HttpWorker($orderViewAPI);
     $orderViewResult = $httpForOrderView->post($post);
     $orderObj = json_decode($orderViewResult, true)["data"];
     $data = array();
     $data["value"] = $orderObj;
     $data["message"] = 'Ok';
     $data["code"] = 0;
     return $data;
 }
Example #4
0
 public function run()
 {
     $sitesParse = new SitesParse('/En');
     $domain = $sitesParse->getDomain();
     /*type list*/
     $wordView = $domain . "/en/word/view.php";
     $httpWorkerForWord = new HttpWorker($wordView);
     $post = array();
     $data = array("enWordID" => $this->query['enWordID']);
     $post["data"] = json_encode($data, true);
     $wordResult = $httpWorkerForWord->post($post);
     $wordObj = json_decode($wordResult, true);
     $word = $wordObj["data"];
     $data = array();
     $data["value"] = $word;
     $data["message"] = 'Ok';
     $data["code"] = 0;
     return $data;
 }