gql.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. const serverbyprops = `
  2. query serverbyprops($name: String) {
  3. serverbyprops: server_by_props(name: $name) {
  4. id
  5. name
  6. description
  7. img
  8. createdAt
  9. updatedAt
  10. }
  11. }
  12. `;
  13. const servicebyprops = `
  14. query servicebyprops($server_id: ID) {
  15. servicebyprops: service_by_props(server_id: $server_id) {
  16. id
  17. server_id {
  18. id
  19. name
  20. description
  21. img
  22. createdAt
  23. updatedAt
  24. }
  25. repertory_id {
  26. id
  27. count
  28. createdAt
  29. updatedAt
  30. }
  31. description
  32. price
  33. startTime
  34. lastTime
  35. }
  36. }
  37. `;
  38. const createorderAndupdaterepertory = `
  39. mutation createorderAndupdaterepertory ($order_id: ID!, $contactTelephone: String, $contactName: String, $payStatus: String, $remark: String, $payCount: String, $payTime: String, $createdAt: String, $orderStatus: String, $user_id: ID, $service_id: ID, $customerNumber: Int, $repertory_id: ID, $updatedAt: String, $count: Int) {
  40. updaterepertory: update_repertory(id: $repertory_id count: $count updatedAt: $updatedAt) {
  41. id
  42. count
  43. updatedAt
  44. }
  45. createorder: create_order(id: $order_id contactTelephone: $contactTelephone contactName: $contactName payStatus: $payStatus remark: $remark payCount: $payCount createdAt: $createdAt updatedAt: $updatedAt payTime: $payTime createdAt: $createdAt orderStatus: $orderStatus user_id: $user_id service_id: $service_id customerNumber: $customerNumber) {
  46. payStatus
  47. remark
  48. payCount
  49. updatedAt
  50. payTime
  51. createdAt
  52. updatedAt
  53. orderStatus
  54. id
  55. customerNumber
  56. contactTelephone
  57. contactName
  58. }
  59. }
  60. `;
  61. const userbyid = `
  62. query userbyid($id: ID) {
  63. userbyid: user_by_id(id: $id) {
  64. id
  65. openid
  66. admin
  67. username
  68. nickname
  69. password
  70. telephone
  71. email
  72. createdAt
  73. updatedAt
  74. }
  75. }
  76. `;
  77. const orderbyprops = `
  78. query orderbyprops($orderStatus: String, $user_id: ID) {
  79. orderbyprops: order_by_props(orderStatus: $orderStatus user_id: $user_id) {
  80. payStatus
  81. remark
  82. payCount
  83. updatedAt
  84. payTime
  85. createdAt
  86. orderStatus
  87. id
  88. contactTelephone
  89. contactName
  90. user_id {
  91. id
  92. openid
  93. admin
  94. username
  95. nickname
  96. password
  97. telephone
  98. email
  99. createdAt
  100. updatedAt
  101. }
  102. service_id {
  103. id
  104. description
  105. price
  106. startTime
  107. lastTime
  108. createdAt
  109. updatedAt
  110. repertory_id {
  111. id
  112. count
  113. createdAt
  114. updatedAt
  115. }
  116. server_id {
  117. id
  118. name
  119. description
  120. createdAt
  121. updatedAt
  122. }
  123. }
  124. customerNumber
  125. }
  126. }
  127. `;
  128. const adminorderbyprops = `
  129. query adminorderbyprops($orderStatus: String) {
  130. adminorderbyprops: order_by_props(orderStatus: $orderStatus) {
  131. payStatus
  132. remark
  133. payCount
  134. updatedAt
  135. payTime
  136. createdAt
  137. orderStatus
  138. id
  139. contactTelephone
  140. contactName
  141. user_id {
  142. id
  143. openid
  144. admin
  145. username
  146. nickname
  147. password
  148. telephone
  149. email
  150. createdAt
  151. updatedAt
  152. }
  153. service_id {
  154. id
  155. description
  156. price
  157. startTime
  158. lastTime
  159. createdAt
  160. updatedAt
  161. repertory_id {
  162. id
  163. count
  164. createdAt
  165. updatedAt
  166. }
  167. server_id {
  168. id
  169. name
  170. description
  171. createdAt
  172. updatedAt
  173. }
  174. }
  175. customerNumber
  176. }
  177. }
  178. `;
  179. const updateorderAndupdaterepertory = `
  180. mutation updateorderAndupdaterepertory ($order_id: ID, $repertory_id: ID, $updatedAt: String, $orderStatus: String, $count: Int) {
  181. updateorder: update_order(id: $order_id updatedAt: $updatedAt orderStatus: $orderStatus) {
  182. payStatus
  183. remark
  184. payCount
  185. updatedAt
  186. payTime
  187. createdAt
  188. orderStatus
  189. id
  190. customerNumber
  191. }
  192. updaterepertory: update_repertory(id: $repertory_id count: $count updatedAt: $updatedAt) {
  193. id
  194. count
  195. updatedAt
  196. }
  197. }
  198. `;
  199. const updateorder = `
  200. mutation updateorder($updatedAt: String, $orderStatus: String, $id: ID, $user_id: ID) {
  201. updateorder: update_order(updatedAt: $updatedAt orderStatus: $orderStatus id: $id user_id: $user_id ) {
  202. payStatus
  203. remark
  204. payCount
  205. updatedAt
  206. payTime
  207. createdAt
  208. orderStatus
  209. id
  210. customerNumber
  211. }
  212. }
  213. `;
  214. const updateuser = `
  215. mutation updateuser($id: ID, $nickname: String, $telephone: String, $updatedAt: String) {
  216. updateuser: update_user(id: $id nickname: $nickname telephone: $telephone updatedAt: $updatedAt) {
  217. id
  218. openid
  219. admin
  220. username
  221. nickname
  222. password
  223. telephone
  224. email
  225. createdAt
  226. updatedAt
  227. }
  228. }
  229. `;
  230. const createserver = `
  231. mutation createserver($id: ID!, $name: String, $description: String, $img: String, $createdAt: String, $updatedAt: String) {
  232. createserver: create_server(id: $id name: $name description: $description img: $img createdAt: $createdAt updatedAt: $updatedAt) {
  233. id
  234. name
  235. description
  236. img
  237. createdAt
  238. updatedAt
  239. }
  240. }
  241. `;
  242. const updateserviceAndupdaterepertory = `
  243. mutation createserviceAndcreaterepertory($service_id: ID, $server_id: ID, $repertory_id: ID!, $count: Int, $description: String, $price: Float, $startTime: String, $lastTime: String, $updatedAt: String) {
  244. updateservice: update_service(id: $service_id server_id: $server_id repertory_id: $repertory_id description: $description price: $price startTime: $startTime lastTime: $lastTime updatedAt: $updatedAt) {
  245. id
  246. description
  247. price
  248. startTime
  249. lastTime
  250. createdAt
  251. updatedAt
  252. }
  253. updaterepertory: update_repertory(id: $repertory_id service_id: $service_id count: $count updatedAt: $updatedAt) {
  254. id
  255. count
  256. createdAt
  257. updatedAt
  258. }
  259. }
  260. `;
  261. const createserviceAndcreaterepertory = `
  262. mutation createserviceAndcreaterepertory($service_id: ID!, $server_id: ID, $repertory_id: ID!, $count: Int, $description: String, $price: Float, $startTime: String, $lastTime: String, $createdAt: String, $updatedAt: String) {
  263. createservice: create_service(id: $service_id server_id: $server_id repertory_id: $repertory_id description: $description price: $price startTime: $startTime lastTime: $lastTime createdAt: $createdAt updatedAt: $updatedAt) {
  264. id
  265. description
  266. price
  267. startTime
  268. lastTime
  269. createdAt
  270. updatedAt
  271. }
  272. createrepertory: create_repertory(id: $repertory_id service_id: $service_id count: $count createdAt: $createdAt updatedAt: $updatedAt) {
  273. id
  274. count
  275. createdAt
  276. updatedAt
  277. }
  278. }
  279. `;
  280. module.exports = {
  281. serverbyprops: serverbyprops,
  282. servicebyprops: servicebyprops,
  283. createorderAndupdaterepertory: createorderAndupdaterepertory,
  284. userbyid: userbyid,
  285. orderbyprops: orderbyprops,
  286. adminorderbyprops: adminorderbyprops,
  287. updateorderAndupdaterepertory: updateorderAndupdaterepertory,
  288. updateorder: updateorder,
  289. updateuser: updateuser,
  290. createserver: createserver,
  291. updateserviceAndupdaterepertory: updateserviceAndupdaterepertory,
  292. createserviceAndcreaterepertory: createserviceAndcreaterepertory
  293. };