table_article_collect.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. //header('Content-type: application/json; charset=utf8');
  3. require_once "../path.php";
  4. require_once "../sync/function.php";
  5. $input = (object) [
  6. "database" => _FILE_DB_USER_ARTICLE_,
  7. "table" => "collect",
  8. "uuid" => "id",
  9. "modify_time" => "modify_time",
  10. "receive_time" => "modify_time",
  11. "insert" => [
  12. 'id',
  13. 'title',
  14. 'subtitle',
  15. 'summary',
  16. 'article_list',
  17. 'status',
  18. 'owner',
  19. 'lang',
  20. 'create_time',
  21. 'modify_time',
  22. 'tag'
  23. ],
  24. "update" => [
  25. 'title',
  26. 'subtitle',
  27. 'summary',
  28. 'article_list',
  29. 'status',
  30. 'owner',
  31. 'lang',
  32. 'create_time',
  33. 'modify_time',
  34. 'tag'
  35. ]
  36. ];
  37. if (isset($_GET["op"])) {
  38. $op = $_GET["op"];
  39. } else if (isset($_POST["op"])) {
  40. $op = $_POST["op"];
  41. } else {
  42. $output["error"]=1;
  43. $output["message"]="无操作码";
  44. echo json_encode($output, JSON_UNESCAPED_UNICODE);
  45. exit;
  46. }
  47. switch ($op) {
  48. case "sync":
  49. $result = do_sync($input);
  50. echo json_encode($result, JSON_UNESCAPED_UNICODE);
  51. break;
  52. case "get":
  53. $result = do_sync($input);
  54. echo json_encode($result, JSON_UNESCAPED_UNICODE);
  55. break;
  56. case "insert":
  57. echo json_encode($result, JSON_UNESCAPED_UNICODE);
  58. break;
  59. }
  60. ?>