constant.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Copyright silenceper/wechat Author(https://silenceper.com/wechat/). All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. * You can obtain one at https://github.com/silenceper/wechat.
  17. *
  18. */
  19. package minidrama
  20. const (
  21. // Success 错误码 0、成功
  22. Success ErrCode = 0
  23. // SystemError 错误码 -1、系统错误
  24. SystemError ErrCode = -1
  25. // InitError 错误码 -2 初始化未完成,请稍后再试
  26. InitError ErrCode = -2
  27. // FormatError 错误码 47001 输入格式错误
  28. FormatError ErrCode = 47001
  29. // ParamError 错误码 47003 参数不符合要求
  30. ParamError ErrCode = 47003
  31. // PostError 错误码 44002 POST 内容为空
  32. PostError ErrCode = 44002
  33. // MethodError 错误码 43002 HTTP 请求必须使用 POST 方法
  34. MethodError ErrCode = 43002
  35. // VideoTypeError 错误码 10090001 视频类型不支持
  36. VideoTypeError ErrCode = 10090001
  37. // ImageTypeError 错误码 10090002 图片类型不支持
  38. ImageTypeError ErrCode = 10090002
  39. // ImageURLError 错误码 10090003 图片 URL 无效
  40. ImageURLError ErrCode = 10090003
  41. // ResourceType 错误码 10090005 resource_type 无效
  42. ResourceType ErrCode = 10090005
  43. // OperationError 错误码 10093011 操作失败
  44. OperationError ErrCode = 10093011
  45. // ParamError2 错误码 10093014 参数错误(包括参数格式、类型等错误)
  46. ParamError2 ErrCode = 10093014
  47. // OperationFrequentError 错误码 10093023 操作过于频繁
  48. OperationFrequentError ErrCode = 10093023
  49. // ResourceNotExistError 错误码 10093030 资源不存在
  50. ResourceNotExistError ErrCode = 10093030
  51. )
  52. const (
  53. // singleFileUpload 单个文件上传,上传媒体(和封面)文件,上传小文件(小于 10MB)时使用。上传大文件请使用分片上传接口。
  54. singleFileUpload = "https://api.weixin.qq.com/wxa/sec/vod/singlefileupload?access_token="
  55. // pullUpload 拉取上传,该接口用于将一个网络上的视频拉取上传到平台。
  56. pullUpload = "https://api.weixin.qq.com/wxa/sec/vod/pullupload?access_token="
  57. // getTask 查询任务,该接口用于查询拉取上传的任务状态。
  58. getTask = "https://api.weixin.qq.com/wxa/sec/vod/gettask?access_token="
  59. // applyUpload 申请分片上传
  60. applyUpload = "https://api.weixin.qq.com/wxa/sec/vod/applyupload?access_token="
  61. // uploadPart 上传分片
  62. uploadPart = "https://api.weixin.qq.com/wxa/sec/vod/uploadpart?access_token="
  63. // commitUpload 确认上传,该接口用于完成整个分片上传流程,合并所有文件分片,确认媒体文件(和封面图片文件)上传到平台的结果,返回文件的 ID。请求中需要给出每一个分片的 part_number 和 etag,用来校验分片的准确性。
  64. commitUpload = "https://api.weixin.qq.com/wxa/sec/vod/commitupload?access_token="
  65. // listMedia 获取媒体列表
  66. listMedia = "https://api.weixin.qq.com/wxa/sec/vod/listmedia?access_token="
  67. // getMedia 获取媒资详细信息,该接口用于获取已上传到平台的指定媒资信息,用于开发者后台管理使用。用于给用户客户端播放的链接应该使用 getmedialink 接口获取。
  68. getMedia = "https://api.weixin.qq.com/wxa/sec/vod/getmedia?access_token="
  69. // getMediaLink 获取媒资播放链接,该接口用于获取视频临时播放链接,用于给用户的播放使用。只有审核通过的视频才能通过该接口获取播放链接。
  70. getMediaLink = "https://api.weixin.qq.com/wxa/sec/vod/getmedialink?access_token="
  71. // deleteMedia 删除媒体,该接口用于删除指定媒资。
  72. deleteMedia = "https://api.weixin.qq.com/wxa/sec/vod/deletemedia?access_token="
  73. // auditDrama 审核剧本
  74. auditDrama = "https://api.weixin.qq.com/wxa/sec/vod/auditdrama?access_token="
  75. // listDramas 获取剧目列表
  76. listDramas = "https://api.weixin.qq.com/wxa/sec/vod/listdramas?access_token="
  77. // getDrama 获取剧目信息,该接口用于查询已提交的剧目。
  78. getDrama = "https://api.weixin.qq.com/wxa/sec/vod/getdrama?access_token="
  79. // getCdnUsageData 查询 CDN 用量数据,该接口用于查询点播 CDN 的流量数据。
  80. getCdnUsageData = "https://api.weixin.qq.com/wxa/sec/vod/getcdnusagedata?access_token="
  81. // getCdnLogs 查询 CDN 日志,该接口用于查询点播 CDN 的日志。
  82. getCdnLogs = "https://api.weixin.qq.com/wxa/sec/vod/getcdnlogs?access_token="
  83. )