rcvr.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. // package impl implement all interfaces of micro service in gd_access_log
  4. package impl
  5. import (
  6. "context"
  7. "gd_statistics/apis"
  8. "gd_statistics/impl/access_log"
  9. "gd_statistics/common.in/task"
  10. "github.com/astaxie/beego/orm"
  11. )
  12. // 具体实现
  13. type Rcvr struct {
  14. }
  15. func (c *Rcvr) LogQueryAccessLog(ctx context.Context, req *apis.LogQueryAccessLogReq, reply *apis.LogQueryAccessLogReply) error {
  16. t1 := func() error {
  17. return access_log.LogQueryAccessLog(ctx, req, reply)
  18. }
  19. return task.Do(ctx, t1)
  20. }
  21. func (c *Rcvr) LogExport(ctx context.Context, req *apis.LogQueryAccessLogReq, reply *apis.LogQueryAccessLogReply) error {
  22. t1 := func() error {
  23. return access_log.LogExport(ctx, req, reply)
  24. }
  25. return task.Do(ctx, t1)
  26. }
  27. func (c *Rcvr) LogQueryThirdpartAccessLog(ctx context.Context, req *apis.LogQueryThirdpartAccessLogReq, reply *apis.LogQueryThirdpartAccessLogReply) error {
  28. t1 := func() error {
  29. return access_log.LogQueryThirdpartAccessLog(ctx, req, reply)
  30. }
  31. return task.Do(ctx, t1)
  32. }
  33. func (c *Rcvr) LogQueryAccessLogCount(ctx context.Context, req *apis.LogQueryAccessLogCountReq, reply *apis.LogQueryAccessLogCountReply) error {
  34. t1 := func() error {
  35. return access_log.LogQueryAccessLogCount(ctx, req, reply)
  36. }
  37. return task.Do(ctx, t1)
  38. }
  39. func (c *Rcvr) LogQueryThirdpartAccessLogCount(ctx context.Context, req *apis.LogQueryThirdpartAccessLogCountReq, reply *apis.LogQueryThirdpartAccessLogCountReply) error {
  40. t1 := func() error {
  41. return access_log.LogQueryThirdpartAccessLogCount(ctx, req, reply)
  42. }
  43. return task.Do(ctx, t1)
  44. }
  45. func (c *Rcvr) LogQueryAccessLogThirdpartLog(ctx context.Context, req *apis.LogQueryAccessLogThirdpartLogReq, reply *apis.LogQueryAccessLogThirdpartLogReply) error {
  46. t1 := func() error {
  47. return access_log.LogQueryAccessLogThirdpartLog(ctx, req, reply)
  48. }
  49. return task.Do(ctx, t1)
  50. }
  51. // 访问日志用户统计报表
  52. func (c *Rcvr) LogQueryUserAccessCount(ctx context.Context, req *apis.LogQueryUserAccessCountReq, reply *apis.LogQueryUserAccessCountReply) error {
  53. t1 := func() error {
  54. return access_log.LogQueryUserAccessCount(ctx, req, reply)
  55. }
  56. return task.Do(ctx, t1)
  57. }
  58. // 导出访问日志用户统计报表
  59. func (c *Rcvr) LogQueryUserAccessCountExport(ctx context.Context, req *apis.LogQueryUserAccessCountExportReq, reply *apis.LogQueryUserAccessCountExportReply) error {
  60. t1 := func() error {
  61. return access_log.LogQueryUserAccessCountExport(ctx, req, reply)
  62. }
  63. return task.Do(ctx, t1)
  64. }
  65. // 导出数据源日志用户统计报表
  66. func (c *Rcvr) LogQueryProviderCountExport(ctx context.Context, req *apis.LogQueryProviderCountExportReq, reply *apis.LogQueryProviderCountExportReply) error {
  67. t1 := func() error {
  68. return access_log.LogQueryProviderCountExport(ctx, req, reply)
  69. }
  70. return task.Do(ctx, t1)
  71. }
  72. // 访问日志接口统计详情
  73. func (c *Rcvr) LogQueryInterfaceCount(ctx context.Context, req *apis.LogQueryInterfaceCountReq, reply *apis.LogQueryInterfaceCountReply) error {
  74. t1 := func() error {
  75. return access_log.LogQueryInterfaceCount(ctx, req, reply)
  76. }
  77. return task.Do(ctx, t1)
  78. }
  79. func (c *Rcvr) LogQueryThirdpartAccessCount(ctx context.Context, req *apis.LogQueryThirdpartAccessCountReq, reply *apis.LogQueryThirdpartAccessCountReply) error {
  80. t1 := func() error {
  81. return access_log.LogQueryThirdpartAccessCount(ctx, req, reply)
  82. }
  83. return task.Do(ctx, t1)
  84. }
  85. func (c *Rcvr) LogQueryThirdpartInterfaceCount(ctx context.Context, req *apis.LogQueryThirdpartInterfaceCountReq, reply *apis.LogQueryThirdpartInterfaceCountReply) error {
  86. t1 := func() error {
  87. return access_log.LogQueryThirdpartInterfaceCount(ctx, req, reply)
  88. }
  89. return task.Do(ctx, t1)
  90. }
  91. func (c *Rcvr) LogExportCreate(ctx context.Context, req *apis.LogExportCreateReq, reply *apis.LogExportCreateReply) error {
  92. t1 := func() error {
  93. return access_log.LogExportCreate(ctx, req, reply)
  94. }
  95. return task.Do(ctx, t1)
  96. }
  97. func (c *Rcvr) LogExportList(ctx context.Context, req *apis.LogExportListReq, reply *apis.LogExportListReply) error {
  98. t1 := func() error {
  99. return access_log.LogExportList(ctx, req, reply)
  100. }
  101. return task.Do(ctx, t1)
  102. }
  103. func (c *Rcvr) LogExportDelete(ctx context.Context, req *apis.LogExportDeleteReq, reply *apis.LogExportDeleteReply) error {
  104. t1 := func() error {
  105. return access_log.LogExportDelete(ctx, req, reply)
  106. }
  107. return task.Do(ctx, t1)
  108. }
  109. func (c *Rcvr) LogQueryInterfaceAnalyzeError(ctx context.Context, req *apis.LogQueryInterfaceCountReq, reply *apis.LogQueryInterfaceAnalyzeErrorReply) error {
  110. t1 := func() error {
  111. return access_log.LogQueryInterfaceAnalyzeError(ctx, req, reply)
  112. }
  113. return task.Do(ctx, t1)
  114. }
  115. func (c *Rcvr) LogQueryInterfaceThirdPartyCount(ctx context.Context, req *apis.LogQueryInterfaceCountReq, reply *apis.LogQueryInterfaceThirdPartyCountReply) error {
  116. t1 := func() error {
  117. return access_log.LogQueryInterfaceThirdPartyCount(ctx, req, reply)
  118. }
  119. return task.Do(ctx, t1)
  120. }
  121. func (c *Rcvr) ThirdPartyInterfaceErrorAnalyze(ctx context.Context, req *apis.ThirdPartyInterfaceErrorAnalyzeReq, reply *apis.ThirdPartyInterfaceErrorAnalyzeReply) error {
  122. t1 := func() error {
  123. return access_log.ThirdPartyInterfaceErrorAnalyze(ctx, req, reply)
  124. }
  125. return task.Do(ctx, t1)
  126. }
  127. func (c *Rcvr) TryApiAccessLogAdd(ctx context.Context, req *apis.TryApiAccessLogReq, reply *apis.TryApiAccessLogReply) error {
  128. t1 := func() error {
  129. return access_log.TryApiAccessLogAdd(ctx, req, reply)
  130. }
  131. return task.Do(ctx, t1)
  132. }
  133. func (c *Rcvr) BiGetServiceStatus(ctx context.Context, req *apis.BiGetServiceStatusReq, reply *apis.BiGetServiceStatusReply) error {
  134. t1 := func() error {
  135. return access_log.BiGetServiceStatus(ctx, req, reply)
  136. }
  137. return task.Do(ctx, t1)
  138. }
  139. func (c *Rcvr) BiGetProviderServiceStatus(ctx context.Context, req *apis.BiGetProviderServiceStatusReq, reply *apis.BiGetProviderServiceStatusReply) error {
  140. t1 := func() error {
  141. return access_log.BiGetProviderServiceStatus(ctx, req, reply)
  142. }
  143. return task.Do(ctx, t1)
  144. }
  145. func (c *Rcvr) BiGetTrend(ctx context.Context, req *apis.BiGetTrendReq, reply *apis.BiGetTrendReply) error {
  146. t1 := func() error {
  147. return access_log.BiGetTrend(ctx, req, reply)
  148. }
  149. return task.Do(ctx, t1)
  150. }
  151. func (c *Rcvr) BiGetProviderTrend(ctx context.Context, req *apis.BiGetProviderTrendReq, reply *apis.BiGetProviderTrendReply) error {
  152. t1 := func() error {
  153. return access_log.BiGetProviderTrend(ctx, req, reply)
  154. }
  155. return task.Do(ctx, t1)
  156. }
  157. func (c *Rcvr) BiGetApiServiceConsumeInfo(ctx context.Context, req *apis.BiGetApiServiceConsumeInfoReq, reply *apis.BiGetApiServiceConsumeInfoReply) error {
  158. t1 := func() error {
  159. return access_log.BiGetApiServiceConsumeInfo(ctx, req, reply)
  160. }
  161. return task.Do(ctx, t1)
  162. }
  163. func (c *Rcvr) BiGetApiServiceFailInfo(ctx context.Context, req *apis.BiGetApiServiceFailInfoReq, reply *apis.BiGetApiServiceFailInfoReply) error {
  164. t1 := func() error {
  165. return access_log.BiGetApiServiceFailInfo(ctx, req, reply)
  166. }
  167. return task.Do(ctx, t1)
  168. }
  169. func (c *Rcvr) BiGetApiServiceDataInfo(ctx context.Context, req *apis.BiGetApiServiceDataInfoReq, reply *apis.BiGetApiServiceDataInfoReply) error {
  170. t1 := func() error {
  171. return access_log.BiGetApiServiceDataInfo(ctx, req, reply)
  172. }
  173. return task.Do(ctx, t1)
  174. }
  175. func (c *Rcvr) BiGetApiServiceIncomeInfo(ctx context.Context, req *apis.BiGetApiServiceIncomeInfoReq, reply *apis.BiGetApiServiceIncomeInfoReply) error {
  176. t1 := func() error {
  177. return access_log.BiGetApiServiceIncomeInfo(ctx, req, reply)
  178. }
  179. return task.Do(ctx, t1)
  180. }
  181. func (c *Rcvr) BiGetProviderServiceDataInfo(ctx context.Context, req *apis.BiGetProviderServiceDataInfoReq, reply *apis.BiGetProviderServiceDataInfoReply) error {
  182. t1 := func() error {
  183. return access_log.BiGetProviderServiceDataInfo(ctx, req, reply)
  184. }
  185. return task.Do(ctx, t1)
  186. }
  187. func (c *Rcvr) BiGetProviderServicePayInfo(ctx context.Context, req *apis.BiGetProviderServicePayInfoReq, reply *apis.BiGetProviderServicePayInfoReply) error {
  188. t1 := func() error {
  189. return access_log.BiGetProviderServicePayInfo(ctx, req, reply)
  190. }
  191. return task.Do(ctx, t1)
  192. }
  193. func (c *Rcvr) BiGetProviderServiceFailInfo(ctx context.Context, req *apis.BiGetProviderServiceFailInfoReq, reply *apis.BiGetProviderServiceFailInfoReply) error {
  194. t1 := func() error {
  195. return access_log.BiGetProviderServiceFailInfo(ctx, req, reply)
  196. }
  197. return task.Do(ctx, t1)
  198. }
  199. func (c *Rcvr) BiGetReport(ctx context.Context, req *apis.BiGetReportReq, reply *apis.BiGetReportReply) error {
  200. t1 := func() error {
  201. return access_log.BiGetReport(ctx, req, reply)
  202. }
  203. return task.Do(ctx, t1)
  204. }
  205. func (c *Rcvr) BiGetProviderReport(ctx context.Context, req *apis.BiGetProviderReportReq, reply *apis.BiGetProviderReportReply) error {
  206. t1 := func() error {
  207. return access_log.BiGetProviderReport(ctx, req, reply)
  208. }
  209. return task.Do(ctx, t1)
  210. }
  211. func (c *Rcvr) BiGetDistribution(ctx context.Context, req *apis.BiGetDistributionReq, reply *apis.BiGetDistributionReply) error {
  212. t1 := func() error {
  213. return access_log.BiGetDistribution(ctx, req, reply)
  214. }
  215. return task.Do(ctx, t1)
  216. }
  217. func (c *Rcvr) BiGetProviderDistribution(ctx context.Context, req *apis.BiGetProviderDistributionReq, reply *apis.BiGetProviderDistributionReply) error {
  218. t1 := func() error {
  219. return access_log.BiGetProviderDistribution(ctx, req, reply)
  220. }
  221. return task.Do(ctx, t1)
  222. }
  223. func (c *Rcvr) BiGetPayDistribution(ctx context.Context, req *apis.BiGetPayDistributionReq, reply *apis.BiGetPayDistributionReply) error {
  224. t1 := func() error {
  225. return access_log.BiGetPayDistribution(ctx, req, reply)
  226. }
  227. return task.Do(ctx, t1)
  228. }
  229. func RegisterOrmModel() {
  230. //orm.RegisterModel(new(apis.AccessLog))
  231. //orm.RegisterModel(new(apis.TGdAccessLogHistory))
  232. //orm.RegisterModel(new(apis.ThirdpartLog))
  233. //orm.RegisterModel(new(apis.TGdThirdpartAccessLogHistory))
  234. orm.RegisterModel(new(apis.TGdAccessLogCountExport))
  235. orm.RegisterModel(new(apis.InvalidAccessLog))
  236. orm.RegisterModel(new(apis.H5AccessLog))
  237. orm.RegisterModel(new(apis.H5ThirdpartLog))
  238. orm.RegisterModel(new(apis.TryApiAccessLog))
  239. orm.RegisterModel(new(access_log.TGdReport))
  240. orm.RegisterModel(new(access_log.TGdProviderReport))
  241. orm.RegisterModel(new(access_log.TGdApiCodeHour))
  242. orm.RegisterModel(new(access_log.TGdProviderCodeHour))
  243. orm.RegisterModel(new(access_log.TGdReportHour))
  244. orm.RegisterModel(new(access_log.TGdProviderReportHour))
  245. orm.RegisterModel(new(apis.AccessLogDay))
  246. orm.RegisterModel(new(apis.ThirdpartLogDay))
  247. orm.RegisterModel(new(apis.TGdAccessLogMonth1))
  248. orm.RegisterModel(new(apis.TGdAccessLogMonth2))
  249. orm.RegisterModel(new(apis.TGdAccessLogMonth3))
  250. orm.RegisterModel(new(apis.TGdAccessLogMonth4))
  251. orm.RegisterModel(new(apis.TGdAccessLogMonth5))
  252. orm.RegisterModel(new(apis.TGdAccessLogMonth6))
  253. orm.RegisterModel(new(apis.TGdAccessLogMonth7))
  254. orm.RegisterModel(new(apis.TGdAccessLogMonth8))
  255. orm.RegisterModel(new(apis.TGdAccessLogMonth9))
  256. orm.RegisterModel(new(apis.TGdAccessLogMonth10))
  257. orm.RegisterModel(new(apis.TGdAccessLogMonth11))
  258. orm.RegisterModel(new(apis.TGdAccessLogMonth12))
  259. orm.RegisterModel(new(apis.TGdThirdpartLogMonth1))
  260. orm.RegisterModel(new(apis.TGdThirdpartLogMonth2))
  261. orm.RegisterModel(new(apis.TGdThirdpartLogMonth3))
  262. orm.RegisterModel(new(apis.TGdThirdpartLogMonth4))
  263. orm.RegisterModel(new(apis.TGdThirdpartLogMonth5))
  264. orm.RegisterModel(new(apis.TGdThirdpartLogMonth6))
  265. orm.RegisterModel(new(apis.TGdThirdpartLogMonth7))
  266. orm.RegisterModel(new(apis.TGdThirdpartLogMonth8))
  267. orm.RegisterModel(new(apis.TGdThirdpartLogMonth9))
  268. orm.RegisterModel(new(apis.TGdThirdpartLogMonth10))
  269. orm.RegisterModel(new(apis.TGdThirdpartLogMonth11))
  270. orm.RegisterModel(new(apis.TGdThirdpartLogMonth12))
  271. }