baiwang.go 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. package bwfapiao
  2. // 定义响应结构体
  3. type UnifiedLoginResponse struct {
  4. Success bool `json:"success"` // 接口调用成功或失败的标志
  5. Method string `json:"method"` // 接口的唯一标识
  6. RequestId string `json:"requestId"` // 请求唯一标识
  7. Response *LoginResponseData `json:"response,omitempty"` // 业务响应信息
  8. ErrorResponse *ErrorResponse `json:"errorResponse,omitempty"` // 错误响应信息
  9. }
  10. type LoginResponseData struct {
  11. DigitAccount string `json:"digitAccount"` // 数电账号
  12. LoginType string `json:"loginType"` // 登录方式
  13. BatchNo string `json:"batchNo"` // 批次号 (操作类型为2时返回)
  14. Status string `json:"status"` // 状态: 1-成功, 2-进行中, 3-失败
  15. StatusMessage string `json:"statusMessage"` // 状态描述
  16. QRCode string `json:"qrCode"` // 二维码 (操作类型为2,状态为1时返回)
  17. QRCodeId string `json:"qrCodeId"` // 二维码字符串
  18. EndTime string `json:"endTime"` // 二维码/短信有效期截止时间
  19. }
  20. type ErrorResponse struct {
  21. Code int `json:"code"` // 错误码 (开放平台错误码)
  22. Message string `json:"message"` // 错误信息 (开放平台错误信息)
  23. SubCode string `json:"subCode"` // 业务端返回错误码
  24. SubMessage string `json:"subMessage"` // 业务端返回错误信息
  25. }
  26. type SEinvoicebasicGetLoginResultResponse struct {
  27. Success bool `json:"success"` // 接口调用是否成功
  28. Method string `json:"method"` // 接口的唯一标识
  29. RequestID string `json:"requestId"` // 请求唯一标识
  30. Response LoginResponse `json:"response"` // 业务响应数据
  31. ErrorResponse ErrorResponse `json:"errorResponse"` // 错误响应信息
  32. }
  33. // 登录状态的业务数据
  34. type LoginResponse struct {
  35. DigitAccount string `json:"digitAccount"` // 数电账号(电子税局实名手机号)
  36. LoginStatus string `json:"loginStatus"` // 登录状态 (0-未登录, 1-已登录, 2-登录中)
  37. LoginType string `json:"loginType"` // 登录方式 (0-账号密码, 1-短信验证码, 2-税务APP扫码, 3-个税APP扫码)
  38. }
  39. type GetCertifyQrcodeResponse struct {
  40. Success bool `json:"success"`
  41. Response GetCertifyQrcodeData `json:"response"`
  42. ErrorResponse GetCertifyQrcodeError `json:"error_response"`
  43. }
  44. type GetCertifyQrcodeData struct {
  45. QRCode string `json:"qrCode"` // 二维码链接
  46. ExpireTime string `json:"expireTime"` // 有效期截止时间
  47. }
  48. type GetCertifyQrcodeError struct {
  49. Code int `json:"code"`
  50. Message string `json:"message"`
  51. }
  52. type GetQrcodeCertifyResultResponse struct {
  53. Success bool `json:"success"`
  54. Response QrcodeCertifyResultData `json:"response"`
  55. ErrorResponse QrcodeCertifyResultError `json:"error_response"`
  56. }
  57. type QrcodeCertifyResultData struct {
  58. TaxNo string `json:"taxNo"` // 税号
  59. DigitAccount string `json:"digitAccount"` // 数电账号
  60. AuthId string `json:"authId"` // 认证编号
  61. CertificationStatus string `json:"certificationStatus"` // 认证状态
  62. CertStatusMessage string `json:"certStatusMessage"` // 状态描述
  63. }
  64. type QrcodeCertifyResultError struct {
  65. Code int `json:"code"` // 错误码
  66. Message string `json:"message"` // 错误信息
  67. SubCode string `json:"subCode"` // 子错误码
  68. SubMessage string `json:"subMessage"` // 子错误信息
  69. }
  70. // 公共响应参数
  71. type CommonResponse struct {
  72. Success bool `json:"success"` // 接口调用成功或失败的标志
  73. Method string `json:"method"` // 接口的唯一标识
  74. RequestID string `json:"requestId"` // 请求唯一标识
  75. Response interface{} `json:"response"` // 业务接口调用成功后的具体响应信息
  76. ErrorResponse ErrorResponse `json:"errorResponse"` // 错误响应信息
  77. }
  78. // 定义响应结构体
  79. type RedAddResponse struct {
  80. Success bool `json:"success"` // 接口调用成功或失败的标志
  81. Method string `json:"method"` // 接口的唯一标识
  82. RequestId string `json:"requestId"` // 请求唯一标识
  83. Response []RedAddInvoiceData `json:"response,omitempty"` // 业务响应信息
  84. ErrorResponse ErrorResponse `json:"errorResponse,omitempty"` // 错误响应信息
  85. }
  86. type RedAddInvoiceData struct {
  87. RedConfirmUUID string `json:"redConfirmUuid"`
  88. RedInvoiceNo string `json:"redInvoiceNo"`
  89. ConfirmState string `json:"confirmState"`
  90. RedConfirmNo string `json:"redConfirmNo"`
  91. ConfirmBillingMark string `json:"confirmBillingMark"`
  92. RedConfirmSerialNo string `json:"redConfirmSerialNo"`
  93. }
  94. // 定义响应结构体
  95. type RedOperaResponse struct {
  96. Success bool `json:"success"` // 接口调用成功或失败的标志
  97. Method string `json:"method"` // 接口的唯一标识
  98. RequestId string `json:"requestId"` // 请求唯一标识
  99. Response []RedOperaInvoiceData `json:"response,omitempty"` // 业务响应信息
  100. ErrorResponse ErrorResponse `json:"errorResponse,omitempty"` // 错误响应信息
  101. }
  102. type RedOperaInvoiceData struct {
  103. RedConfirmUUID string `json:"redConfirmUuid"`
  104. RedInvoiceNo string `json:"redInvoiceNo"`
  105. ConfirmState string `json:"confirmState"`
  106. RedConfirmNo string `json:"redConfirmNo"`
  107. ConfirmBillingMark string `json:"confirmBillingMark"`
  108. RedConfirmSerialNo string `json:"redConfirmSerialNo"`
  109. }
  110. type InvoiceIssueResponse struct {
  111. Method string `json:"method"`
  112. Success bool `json:"success"`
  113. RequestID string `json:"requestId"`
  114. Response InvoiceIssueResponseData `json:"response"`
  115. ErrorResponse ErrorResponse `json:"errorResponse,omitempty"` // 错误响应信息
  116. }
  117. type InvoiceIssueResponseData struct {
  118. Fail []InvoiceIssueFailData `json:"fail"`
  119. Success []InvoiceIssueSuccessData `json:"success"`
  120. }
  121. type InvoiceIssueFailData struct {
  122. InvoiceTotalPrice float64 `json:"invoiceTotalPrice"`
  123. InvoiceTotalTax float64 `json:"invoiceTotalTax"`
  124. InvoiceTotalPriceTax float64 `json:"invoiceTotalPriceTax"`
  125. SerialNo string `json:"serialNo"`
  126. InvoiceDetailsList []InvoiceDetailsFailItemData `json:"invoiceDetailsList"`
  127. }
  128. type InvoiceDetailsFailItemData struct {
  129. PriceTaxMark string `json:"priceTaxMark"`
  130. GoodsTaxRate float64 `json:"goodsTaxRate"`
  131. InvoiceLineNature string `json:"invoiceLineNature"`
  132. GoodsTotalPrice float64 `json:"goodsTotalPrice"`
  133. GoodsSpecification string `json:"goodsSpecification"`
  134. GoodsPrice float64 `json:"goodsPrice"`
  135. FreeTaxMark string `json:"freeTaxMark"`
  136. GoodsQuantity string `json:"goodsQuantity"`
  137. GoodsUnit string `json:"goodsUnit"`
  138. GoodsTotalTax float64 `json:"goodsTotalTax"`
  139. GoodsCode string `json:"goodsCode"`
  140. PreferentialMark string `json:"preferentialMark"`
  141. GoodsName string `json:"goodsName"`
  142. GoodsLineNo string `json:"goodsLineNo"`
  143. VatSpecialManagement string `json:"vatSpecialManagement"`
  144. }
  145. type InvoiceIssueSuccessData struct {
  146. PaperInvoiceCode string `json:"paperInvoiceCode"`
  147. EInvoiceUrl string `json:"eInvoiceUrl"`
  148. InvoiceTotalTax float64 `json:"invoiceTotalTax"`
  149. InvoiceDate string `json:"invoiceDate"`
  150. InvoiceCode string `json:"invoiceCode"`
  151. InvoiceTotalPriceTax float64 `json:"invoiceTotalPriceTax"`
  152. SerialNo string `json:"serialNo"`
  153. MulPurchaserList []MulPurchaserItemData `json:"mulPurchaserList"`
  154. TaxControlCode string `json:"taxControlCode"`
  155. InvoiceCheckCode string `json:"invoiceCheckCode"`
  156. InvoiceQrCode string `json:"invoiceQrCode"`
  157. InvoiceTotalPrice float64 `json:"invoiceTotalPrice"`
  158. InvoiceDetailsList []InvoiceDetailsSuccessItemData `json:"invoiceDetailsList"`
  159. InvoiceTypeCode string `json:"invoiceTypeCode"`
  160. PaperInvoiceNo string `json:"paperInvoiceNo"`
  161. InvoiceNo string `json:"invoiceNo"`
  162. MulPurchaserMark string `json:"mulPurchaserMark"`
  163. }
  164. type MulPurchaserItemData struct {
  165. Purchaser string `json:"purchaser"`
  166. CertificateNo string `json:"certificateNo"`
  167. CertificateType string `json:"certificateType"`
  168. }
  169. type InvoiceDetailsSuccessItemData struct {
  170. PriceTaxMark string `json:"priceTaxMark"`
  171. GoodsTaxRate float64 `json:"goodsTaxRate"`
  172. GoodsSpecification string `json:"goodsSpecification"`
  173. GoodsPrice float64 `json:"goodsPrice"`
  174. GoodsQuantity float64 `json:"goodsQuantity"`
  175. GoodsUnit string `json:"goodsUnit"`
  176. GoodsTotalTax float64 `json:"goodsTotalTax"`
  177. GoodsCode string `json:"goodsCode"`
  178. GoodsName string `json:"goodsName"`
  179. GoodsLineNo int `json:"goodsLineNo"`
  180. GoodsTotalPrice float64 `json:"goodsTotalPrice"`
  181. }
  182. // 定义响应结构体
  183. type BanShiResponse struct {
  184. Success bool `json:"success"` // 接口调用成功或失败的标志
  185. Method string `json:"method"` // 接口的唯一标识
  186. RequestId string `json:"requestId"` // 请求唯一标识
  187. Response BanShiInvoiceData `json:"response,omitempty"` // 业务响应信息
  188. ErrorResponse ErrorResponse `json:"errorResponse,omitempty"` // 错误响应信息
  189. }
  190. type BanShiInvoiceData struct {
  191. EInvoiceUrl string `json:"eInvoiceUrl"`
  192. FileType string `json:"fileType"`
  193. ConfirmState string `json:"confirmState"`
  194. UrlMap Urls `json:"urlMap"`
  195. }
  196. type Urls struct {
  197. PdfUrl string `json:"pdfUrl"`
  198. OfdUrl string `json:"ofdUrl"`
  199. XmlUrl string `json:"xmlUrl"`
  200. }