xml.go 494 B

1234567891011121314151617181920
  1. package lic
  2. import (
  3. "encoding/xml"
  4. "net/url"
  5. model "go-common/app/job/main/tv/model/pgc"
  6. )
  7. // PrepareXML combine the xml data to sync
  8. func PrepareXML(v *model.License) (body string) {
  9. xmlRes, _ := xml.MarshalIndent(v.XMLData.Service, " ", " ")
  10. params := url.Values{}
  11. params.Set("tId", v.TId)
  12. params.Set("inputTime", v.InputTime)
  13. params.Set("sign", v.Sign)
  14. body = params.Encode()
  15. body = body + "&xmlData=<?xml version=\"1.0\" encoding=\"UTF-8\"?> " + string(xmlRes)
  16. return body
  17. }