资源简介

本资源为bilibili(B站)后端源代码,主体为Go语言,仅供学习使用,请勿用于商业。欢迎有需要的朋友下载。

资源截图

代码片段和文件信息

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2017-12-25 下午2:43
# @Author  : Hedan (hedan@bilibili.com)
# @file    : databusTest



import json
import redis


# [databus]
#     key = “4ba46ba31f9a44ef“
#     secret = “99985eb4451cfb1b899ca0fbe3c4bdc8“
#     group = “AccountLog-MainAccount-P“
#     topic = “AccountLog-T“
#     action = “pub“
#     name = “member-service/databus“
#     proto = “tcp“
#     addr = “172.16.33.158:6205“
#     idle = 100
#     active = 100
#     dialTimeout = “1s“
#     readTimeout = “60s“
#     writeTimeout = “1s“
#     idleTimeout = “10s“



“““参考文档  http://info.bilibili.co/pages/viewpage.action?pageId=3670491
key          服务配置中databus的key
value        服务配置中databus的value
host和port   配置服务中databus的host和port
group-topic  一个group对应一个topic(开发申请)
“““

#每日登录 passport 获得5经验值
# data_passport ={
#   ‘mid‘:4780461
#      ‘loginip‘:1726481463
#      “timestamp“:1516517576
#       }
# auth_passport = ‘4ba46ba31f9a44ef:99985eb4451cfb1b899ca0fbe3c4bdc8@PassportLog-MainAccount-P/topic=PassportLog-T&role=pub&offset=new‘
# rc = redis.Redis(host=‘172.16.33.158‘ port=6205 socket_keepalive=True)
# print rc.execute_command(‘auth‘auth_passport)

# msg = json.dumps(data_passport ensure_ascii=False)
# rc.set(“1023“ msg)


# 每日登录 account 获得5经验值
# data_passport ={
#   ‘mid‘:110000092
#      ‘loginip‘:1726481463
#      “timestamp“:1516517576
#       }
# auth_passport = ‘4ba46ba31f9a44ef:99985eb4451cfb1b899ca0fbe3c4bdc8@AccountLoginAward-MainAccount-P/topic=AccountLoginAward-T&role=pub&offset=new‘
# rc = redis.Redis(host=‘172.16.33.158‘ port=6205 socket_keepalive=True)
# print rc.execute_command(‘auth‘auth_passport)

# msg = json.dumps(data_passport ensure_ascii=False)
# rc.set(“1023“ msg)




# 每日首次分享视频 archive 获得5经验值
# data_archive ={
#      ‘event‘:“share“
#     ‘mid‘:110000092
#      ‘ip‘:“127.0.0.1“
#      “ts“:111
#       }
# auth_archive = ‘4ba46ba31f9a44ef:99985eb4451cfb1b899ca0fbe3c4bdc8@AccountExp-MainAccount-P/topic=AccountExp-T&role=pub&offset=new‘
# rc = redis.Redis(host=‘172.16.33.158‘ port=6205 socket_keepalive=True)
# print rc.execute_command(‘auth‘auth_archive)
# msg = json.dumps(data_archive ensure_ascii=False)
# rc.set(“1023“ msg)
#
#

# 每日首次分享视频 archive 获得5经验值
data_archive ={
     ‘event‘:“view“
#  ‘mid‘:110000092
      ‘mid‘:4780461
     ‘ip‘:“127.0.0.1“
     “ts“:1521745000
      }
auth_archive = ‘4ba46ba31f9a44ef:99985eb4451cfb1b899ca0fbe3c4bdc8@AccountExp-MainAccount-P/topic=AccountExp-T&role=pub&offset=new‘
rc = redis.Redis(host=‘172.16.33.158‘ port=6205 socket_keepalive=True)
print rc.execute_command(‘auth‘auth_archive)
msg = json.dumps(data_archive ensure_ascii=False)
rc.set(“1023“ msg)

# 每日首次观看 history 获得5经验值
# data_history ={
#     “action“:“insert“
#  “table“:“aso_account“
#  “data“:{“mid“:110000193
#  “userid“:“test_dan06“
#  “uname“:“test_dan08“
#  “pwd“:“6cfbf96b8f0eb2e0a82b46a4236e8883“
#  “salt“:“D8fd30Kj“
#  “email“:“169d9106a74d5e95de71be6cf373af04“

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-04-22 08:48  bilibili_fork-master\
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\
     文件         332  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\BUILD
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\
     文件         578  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\BUILD
     文件          30  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\CHANGELOG.md
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\cmd\
     文件        1018  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\cmd\BUILD
     文件        1036  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\cmd\main.go
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\configs\
     文件          33  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\configs\application.toml
     文件           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\configs\grpc.toml
     文件          55  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\configs\http.toml
     文件         202  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\configs\memcache.toml
     文件         583  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\configs\mysql.toml
     文件         192  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\configs\redis.toml
     文件          37  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\CONTRIBUTORS.md
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\dao\
     文件         921  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\dao\BUILD
     文件        1961  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\dao\dao.go
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\model\
     文件         603  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\model\BUILD
     文件          14  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\model\model.go
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\server\
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\server\http\
     文件         936  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\server\http\BUILD
     文件        1198  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\server\http\http.go
     目录           0  2019-04-22 08:48  bilibili_fork-master\app\admin\bbq\comment\internal\service\
............此处省略30600个文件信息

评论

共有 条评论