hbyb_controller.go 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. package hb
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "gdyb/controllers"
  6. "gdyb/models"
  7. "gdyb/service"
  8. "gdyb/utils"
  9. "github.com/astaxie/beego"
  10. "io/ioutil"
  11. )
  12. type HBybController struct {
  13. controllers.BaseAuthAPIController
  14. }
  15. func HbybRegistRouters() {
  16. beego.Router("/hbyb/1101", &HBybController{}, "get:PostOne")
  17. beego.Router("/hbyb/2201", &HBybController{}, "get:PostTwo")
  18. beego.Router("/hbyb/2202", &HBybController{}, "get:PostThree")
  19. beego.Router("/hbyb/2203", &HBybController{}, "post:PostFour")
  20. beego.Router("/hbyb/2204", &HBybController{}, "post:PostFive")
  21. beego.Router("/hbyb/2205", &HBybController{}, "get:PostSix")
  22. beego.Router("/hbyb/2206", &HBybController{}, "get:PostSeven")
  23. beego.Router("/hbyb/2207", &HBybController{}, "get:PostEight")
  24. beego.Router("/hbyb/2208", &HBybController{}, "get:PostNine")
  25. beego.Router("/hbyb/5203", &HBybController{}, "get:PostTen")
  26. beego.Router("/hbyb/2001", &HBybController{}, "get:Post2001")
  27. beego.Router("/hbyb/3202", &HBybController{}, "post:Post3202a")
  28. beego.Router("/hbyb/4101", &HBybController{}, "post:Post4101")
  29. }
  30. func (c *HBybController) Post3202a() {
  31. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  32. var respJSON map[string]interface{}
  33. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  34. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  35. return
  36. }
  37. userJSONBytes, _ := json.Marshal(respJSON["bps"])
  38. var bps []*models.BusinessParamsTwo
  39. if err := json.Unmarshal(userJSONBytes, &bps); err != nil {
  40. utils.ErrorLog("解析失败:%v", err)
  41. return
  42. }
  43. var baseParams models.BaseParams
  44. baseParams.InsuplcAdmdvs = respJSON["insuplc_admdvs"].(string)
  45. baseParams.MdtrtareaAdmvs = respJSON["mdtrtarea_admvs"].(string)
  46. baseParams.OrgName = respJSON["org_name"].(string)
  47. baseParams.Doctor = respJSON["doctor"].(string)
  48. baseParams.FixmedinsCode = respJSON["fixmedins_code"].(string)
  49. result := service.Hbyb3202a(baseParams, bps)
  50. var dat map[string]interface{}
  51. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  52. fmt.Println(dat)
  53. } else {
  54. fmt.Println(err)
  55. }
  56. c.ServeSuccessJSON(map[string]interface{}{
  57. "pre": dat,
  58. })
  59. }
  60. func (c *HBybController) Post4101() {
  61. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  62. var respJSON map[string]interface{}
  63. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  64. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  65. return
  66. }
  67. userJSONBytes, _ := json.Marshal(respJSON["struct4101"])
  68. var struct4101 service.Struct4101
  69. if err := json.Unmarshal(userJSONBytes, &struct4101); err != nil {
  70. utils.ErrorLog("解析失败:%v", err)
  71. return
  72. }
  73. result, inputLog := service.Hbyb4101(struct4101, respJSON["secret_key"].(string), respJSON["org_name"].(string), respJSON["opera"].(string), respJSON["code"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string))
  74. var dat map[string]interface{}
  75. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  76. } else {
  77. }
  78. var dat2 map[string]interface{}
  79. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  80. } else {
  81. }
  82. c.ServeSuccessJSON(map[string]interface{}{
  83. "pre": dat,
  84. "log": dat2,
  85. })
  86. }
  87. func (c *HBybController) Post2001() {
  88. org_name := c.GetString("org_name")
  89. doctor := c.GetString("doctor")
  90. fixmedins_code := c.GetString("fixmedins_code")
  91. insuplc_admdvs := c.GetString("insuplc_admdvs")
  92. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  93. secret_key := c.GetString("secret_key")
  94. psn_no := c.GetString("psn_no")
  95. insutype := c.GetString("insutype")
  96. med_type := c.GetString("med_type")
  97. result, inputLog := service.Hbyb2001(secret_key, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, psn_no, insutype, med_type)
  98. fmt.Println(result)
  99. fmt.Println(inputLog)
  100. var dat map[string]interface{}
  101. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  102. } else {
  103. }
  104. var dat2 map[string]interface{}
  105. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  106. } else {
  107. }
  108. c.ServeSuccessJSON(map[string]interface{}{
  109. "pre": dat,
  110. "log": dat2,
  111. })
  112. }
  113. func (c *HBybController) PostOne() {
  114. certNo := c.GetString("cert_no")
  115. org_name := c.GetString("org_name")
  116. doctor := c.GetString("doctor")
  117. fixmedins_code := c.GetString("fixmedins_code")
  118. insuplc_admdvs := c.GetString("insuplc_admdvs")
  119. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  120. secret_key := c.GetString("secret_key")
  121. id_card_type, _ := c.GetInt64("id_card_type")
  122. card_sn := c.GetString("card_sn")
  123. certificates := c.GetString("certificates")
  124. fmt.Println(certNo)
  125. fmt.Println(org_name)
  126. fmt.Println(doctor)
  127. fmt.Println(fixmedins_code)
  128. fmt.Println(insuplc_admdvs)
  129. fmt.Println(mdtrtarea_admvs)
  130. fmt.Println(secret_key)
  131. fmt.Println(id_card_type)
  132. fmt.Println(card_sn)
  133. fmt.Println(certificates)
  134. result, inputLog := service.Hbyb1101(certNo, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, card_sn, certificates)
  135. fmt.Println(result)
  136. fmt.Println(inputLog)
  137. var dat map[string]interface{}
  138. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  139. } else {
  140. }
  141. var dat2 map[string]interface{}
  142. if err := json.Unmarshal([]byte(inputLog), &dat2); err == nil {
  143. } else {
  144. }
  145. c.ServeSuccessJSON(map[string]interface{}{
  146. "pre": dat,
  147. "log": dat2,
  148. })
  149. }
  150. func (c *HBybController) PostTwo() {
  151. psnNo := c.GetString("psn_no")
  152. insutype := c.GetString("insutype")
  153. certNo := c.GetString("cert_no")
  154. org_name := c.GetString("org_name")
  155. doctor := c.GetString("doctor")
  156. ipt_otp_no := c.GetString("ipt_otp_no")
  157. dept := c.GetString("dept")
  158. fixmedins_code := c.GetString("fixmedins_code")
  159. opter := c.GetString("opter")
  160. dept_code := c.GetString("dept_code")
  161. doctor_id := c.GetString("doctor_id")
  162. doctor_name := c.GetString("doctor_name")
  163. insuplc_admdvs := c.GetString("insuplc_admdvs")
  164. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  165. secret_key := c.GetString("secret_key")
  166. id_card_type, _ := c.GetInt64("id_card_type")
  167. result, _ := service.Hbyb2201(psnNo, insutype, certNo, org_name, doctor, ipt_otp_no, dept, fixmedins_code, dept_code, doctor_id, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, opter, doctor_name)
  168. var dat map[string]interface{}
  169. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  170. //fmt.Println(dat["status"])
  171. } else {
  172. }
  173. c.ServeSuccessJSON(map[string]interface{}{
  174. "pre": dat,
  175. })
  176. }
  177. func (c *HBybController) PostThree() {
  178. psnNo := c.GetString("psn_no")
  179. mdtrtId := c.GetString("mdtrt_id")
  180. iptOtpNo := c.GetString("ipt_otp_no")
  181. org_name := c.GetString("org_name")
  182. doctor := c.GetString("doctor")
  183. insuplc_admdvs := c.GetString("insuplc_admdvs")
  184. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  185. secret_key := c.GetString("secret_key")
  186. fixmedins_code := c.GetString("fixmedins_code")
  187. result, requestLog := service.Hbyb2202(psnNo, mdtrtId, iptOtpNo, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  188. var dat map[string]interface{}
  189. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  190. } else {
  191. }
  192. c.ServeSuccessJSON(map[string]interface{}{
  193. "pre": dat,
  194. "request_log": requestLog,
  195. })
  196. }
  197. func (c *HBybController) PostFour() {
  198. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  199. var respJSON map[string]interface{}
  200. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  201. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  202. return
  203. }
  204. userJSONBytes, _ := json.Marshal(respJSON["config"])
  205. var config []*models.HisXtDiagnoseConfig
  206. if err := json.Unmarshal(userJSONBytes, &config); err != nil {
  207. utils.ErrorLog("解析失败:%v", err)
  208. return
  209. }
  210. psnNo := respJSON["psn_no"].(string)
  211. mdtrtId := respJSON["mdtrt_id"].(string)
  212. opter := respJSON["opter"].(string)
  213. org_name := respJSON["org_name"].(string)
  214. med_type := respJSON["med_type"].(string)
  215. doctor_id := respJSON["doctor_id"].(string)
  216. doctor_name := respJSON["doctor_name"].(string)
  217. department := respJSON["department"].(string)
  218. fixmedins_code := respJSON["fixmedins_code"].(string)
  219. insuplc_admdvs := respJSON["insuplc_admdvs"].(string)
  220. mdtrtarea_admvs := respJSON["mdtrtarea_admvs"].(string)
  221. secret_key := respJSON["secret_key"].(string)
  222. sick_code := respJSON["sick_code"].(string)
  223. sick_name := respJSON["sick_name"].(string)
  224. dept := respJSON["dept"].(string)
  225. begin_time := respJSON["begin_time"].(string)
  226. result, request_log := service.Hbyb2203(psnNo, mdtrtId, dept, department, org_name, med_type, doctor_id, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name, dept, config, begin_time, doctor_name, opter)
  227. fmt.Println(request_log)
  228. var dat map[string]interface{}
  229. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  230. } else {
  231. }
  232. c.ServeSuccessJSON(map[string]interface{}{
  233. "pre": dat,
  234. })
  235. }
  236. type All struct {
  237. HisPrescription HisPrescription
  238. mdtrt_id string
  239. psn_no string
  240. }
  241. type HisPrescription struct {
  242. ID int64 `gorm:"column:id" json:"id" form:"id"`
  243. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  244. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  245. PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
  246. HisPatientId int64 `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
  247. Status int64 `gorm:"column:status" json:"status" form:"status"`
  248. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  249. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  250. Number string `gorm:"column:number" json:"number" form:"number"`
  251. Type int64 `gorm:"column:type" json:"type" form:"type"`
  252. Doctor int64 `gorm:"column:doctor" json:"doctor" form:"doctor"`
  253. Creator int64 `gorm:"column:creator" json:"creator" form:"creator"`
  254. Modifier int64 `gorm:"column:modifier" json:"modifier" form:"modifier"`
  255. HisDoctorAdviceInfo []*models.HisDoctorAdviceInfo `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"advices"`
  256. HisPrescriptionProject []*models.HisPrescriptionProject `gorm:"ForeignKey:PatientId,RecordDate,PrescriptionId;AssociationForeignKey:PatientId,RecordDate,ID" json:"project"`
  257. }
  258. func (c *HBybController) PostFive() {
  259. body, _ := ioutil.ReadAll(c.Ctx.Request.Body)
  260. var respJSON map[string]interface{}
  261. if err := json.Unmarshal([]byte(string(body)), &respJSON); err != nil {
  262. utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
  263. return
  264. }
  265. userJSONBytes, _ := json.Marshal(respJSON["pre"])
  266. var hp []*models.HisPrescription
  267. if err := json.Unmarshal(userJSONBytes, &hp); err != nil {
  268. utils.ErrorLog("解析失败:%v", err)
  269. return
  270. }
  271. fmt.Println(respJSON["psn_no"].(string))
  272. fmt.Println(respJSON["mdtrt_id"].(string))
  273. fmt.Println(respJSON["chrg_bchno"].(string))
  274. fmt.Println(respJSON["org_name"].(string))
  275. fmt.Println(respJSON["doctor"].(string))
  276. fmt.Println(respJSON["doctor_id"].(string))
  277. fmt.Println(respJSON["dept"].(string))
  278. fmt.Println(respJSON["fixmedins_code"].(string))
  279. fmt.Println(respJSON["dept_code"].(string))
  280. fmt.Println(respJSON["insuplc_admdvs"].(string))
  281. fmt.Println(respJSON["mdtrtarea_admvs"].(string))
  282. fmt.Println(respJSON["secret_key"].(string))
  283. result, requestLog := service.Hbyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
  284. respJSON["doctor"].(string), respJSON["dept"].(string), respJSON["fixmedins_code"].(string), respJSON["dept_code"].(string), respJSON["doctor_id"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string), respJSON["secret_key"].(string), respJSON["balance_accounts_type"].(string), respJSON["opter"].(string))
  285. var dat map[string]interface{}
  286. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  287. fmt.Println(dat)
  288. } else {
  289. fmt.Println(err)
  290. }
  291. var dat2 map[string]interface{}
  292. if err := json.Unmarshal([]byte(requestLog), &dat2); err == nil {
  293. fmt.Println(dat2)
  294. } else {
  295. fmt.Println(err)
  296. }
  297. c.ServeSuccessJSON(map[string]interface{}{
  298. "pre": dat,
  299. "request_log": requestLog,
  300. })
  301. }
  302. func (c *HBybController) PostSix() {
  303. psnNo := c.GetString("psn_no")
  304. mdtrtId := c.GetString("mdtrt_id")
  305. chrgBchno := c.GetString("chrg_bchno")
  306. org_name := c.GetString("org_name")
  307. doctor := c.GetString("doctor")
  308. insuplc_admdvs := c.GetString("insuplc_admdvs")
  309. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  310. secret_key := c.GetString("secret_key")
  311. fixmedins_code := c.GetString("fixmedins_code")
  312. result, requestlog := service.Hbyb2205(psnNo, mdtrtId, chrgBchno, org_name, doctor, insuplc_admdvs, mdtrtarea_admvs, secret_key, fixmedins_code)
  313. fmt.Println(requestlog)
  314. var dat map[string]interface{}
  315. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  316. fmt.Println(dat)
  317. } else {
  318. fmt.Println(err)
  319. }
  320. c.ServeSuccessJSON(map[string]interface{}{
  321. "pre": dat,
  322. })
  323. }
  324. func (c *HBybController) PostSeven() {
  325. psnNo := c.GetString("psn_no")
  326. mdtrtId := c.GetString("mdtrt_id")
  327. chrgBchno := c.GetString("chrg_bchno")
  328. certNo := c.GetString("cert_no")
  329. insutype := c.GetString("insutype")
  330. total := c.GetString("total")
  331. org_name := c.GetString("org_name")
  332. doctor := c.GetString("doctor")
  333. fixmedins_code := c.GetString("fixmedins_code")
  334. insuplc_admdvs := c.GetString("insuplc_admdvs")
  335. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  336. secret_key := c.GetString("secret_key")
  337. med_type := c.GetString("med_type")
  338. id_card_type, _ := c.GetInt64("id_card_type")
  339. certificates, _ := c.GetInt64("certificates")
  340. result, requestlog := service.Hbyb2206(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, 0, 0, 0, 0, certificates)
  341. fmt.Println(requestlog)
  342. var dat map[string]interface{}
  343. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  344. fmt.Println(dat)
  345. } else {
  346. fmt.Println(err)
  347. }
  348. c.ServeSuccessJSON(map[string]interface{}{
  349. "pre": dat,
  350. })
  351. }
  352. func (c *HBybController) PostEight() {
  353. psnNo := c.GetString("psn_no")
  354. mdtrtId := c.GetString("mdtrt_id")
  355. chrgBchno := c.GetString("chrg_bchno")
  356. certNo := c.GetString("cert_no")
  357. insutype := c.GetString("insutype")
  358. total := c.GetString("total")
  359. org_name := c.GetString("org_name")
  360. doctor := c.GetString("doctor")
  361. fixmedins_code := c.GetString("fixmedins_code")
  362. insuplc_admdvs := c.GetString("insuplc_admdvs")
  363. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  364. secret_key := c.GetString("secret_key")
  365. med_type := c.GetString("med_type")
  366. id_card_type, _ := c.GetInt64("id_card_type")
  367. certificates, _ := c.GetInt64("certificates")
  368. fulamt_ownpay_amt, _ := c.GetFloat("fulamt_ownpay_amt")
  369. overlmt_selfpay, _ := c.GetFloat("overlmt_selfpay")
  370. preselfpay_amt, _ := c.GetFloat("preselfpay_amt")
  371. inscp_scp_amt, _ := c.GetFloat("inscp_scp_amt")
  372. acct_used_flag, _ := c.GetInt64("acct_used_flag")
  373. result, srcRequest := service.Hbyb2207(psnNo, mdtrtId, chrgBchno, certNo, insutype, total, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, med_type, id_card_type, fulamt_ownpay_amt, overlmt_selfpay, preselfpay_amt, inscp_scp_amt, certificates, acct_used_flag)
  374. var dat map[string]interface{}
  375. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  376. fmt.Println(dat)
  377. } else {
  378. fmt.Println(err)
  379. }
  380. var dat2 map[string]interface{}
  381. if err := json.Unmarshal([]byte(srcRequest), &dat2); err == nil {
  382. fmt.Println(dat2)
  383. } else {
  384. fmt.Println(err)
  385. }
  386. c.ServeSuccessJSON(map[string]interface{}{
  387. "pre": dat,
  388. "pre2": dat2,
  389. })
  390. }
  391. func (c *HBybController) PostNine() {
  392. psnNo := c.GetString("psn_no")
  393. mdtrtId := c.GetString("mdtrt_id")
  394. setlId := c.GetString("setl_id")
  395. org_name := c.GetString("org_name")
  396. doctor := c.GetString("doctor")
  397. secret_key := c.GetString("secret_key")
  398. fixmedins_code := c.GetString("fixmedins_code")
  399. insuplc_admdvs := c.GetString("insuplc_admdvs")
  400. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  401. result, src_request := service.Hbyb2208(psnNo, mdtrtId, setlId, org_name, doctor, secret_key, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
  402. fmt.Println(src_request)
  403. var dat map[string]interface{}
  404. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  405. fmt.Println(dat)
  406. } else {
  407. fmt.Println(err)
  408. }
  409. c.ServeSuccessJSON(map[string]interface{}{
  410. "pre": dat,
  411. })
  412. }
  413. func (c *HBybController) PostTen() {
  414. psnNo := c.GetString("psn_no")
  415. mdtrtId := c.GetString("mdtrt_id")
  416. setlId := c.GetString("setl_id")
  417. org_name := c.GetString("org_name")
  418. doctor := c.GetString("doctor")
  419. med_type := c.GetString("med_type")
  420. secret_key := c.GetString("secret_key")
  421. fixmedins_code := c.GetString("fixmedins_code")
  422. insuplc_admdvs := c.GetString("insuplc_admdvs")
  423. mdtrtarea_admvs := c.GetString("mdtrtarea_admvs")
  424. baseParams := models.BaseParams{
  425. SecretKey: secret_key,
  426. FixmedinsCode: fixmedins_code,
  427. InsuplcAdmdvs: insuplc_admdvs,
  428. MdtrtareaAdmvs: mdtrtarea_admvs,
  429. OrgName: org_name,
  430. Doctor: doctor,
  431. }
  432. businessParams := models.BusinessParams{
  433. PsnNo: psnNo,
  434. MdtrtId: mdtrtId,
  435. SetlId: setlId,
  436. }
  437. result := service.Hbyb5203(baseParams, businessParams, med_type)
  438. var dat map[string]interface{}
  439. if err := json.Unmarshal([]byte(result), &dat); err == nil {
  440. fmt.Println(dat)
  441. } else {
  442. fmt.Println(err)
  443. }
  444. c.ServeSuccessJSON(map[string]interface{}{
  445. "pre": dat,
  446. })
  447. }