Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
D doves
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • 嘟嘟露比
  • doves
  • Issues
  • #1

Closed
Open
Created Aug 16, 2018 by 马亦闻@myiwenMaintainer

后端接口文档

Dove API

签到接口

POST /attend
  • Request

form

{
	'address': '0x1d5EbE01F72652Fab2ec9F50195b4eE24d0dA666',
}
  • Response
{
	'code': 0,
	'data': null,
	'msg': 'Success',
}

点赞接口

POST /like/create
  • Request

json

{
	'data': {
		'address_from': '0x1d5EbE01F72652Fab2ec9F50195b4eE24d0dA666',
		'address_to': '0x1d5EbE01F72652Fab2ec9F50195b4eE24d0dA777',
		'reason': '{...}',  // 自定义格式, json string
		'tags': ['tag1', 'tag2'],
	}
}
  • Response
success

点赞记录listing接口

GET /like/
  • Request

query

address_from: '',  // 可选
address_to: '',  // 可选
ts_start: 1534392000,  // 可选
ts_end: 1534392100,  // 可选
offset: 0,  // 默认0
limit: 10,  // 默认10
  • Response
data: [
	{  // like record detail
		address_from: '',
		address_to: '',
		reason: '{...}',
		tags: ['tag1', 'tag2'],
		candy_value_from: '',  // 地址
		candy_value_to: '',  // 地址
	},
	{  // like record detail
	},
	...
]

点赞记录detail接口

GET /like/{record_id}
  • Request
  • Response
data: {
		address_from: '',
		address_to: '',
		reason: '{...}',
		tags: ['tag1', 'tag2'],
		candy_value_from: '',
		candy_value_to: '',
		user_from: {  // user detail
		},
		user_to: {  // user detail
		},
}

点赞记录标签推荐接口

GET /like/tag/rec
  • Request
  • Response
data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5']  // 从使用最多的5个加上随机的5个,10个里随机取5个

今日动态接口

GET /feeds/today
  • Request

query

offset: 0  // 默认0
limit: 10  // 默认10
  • Response
data: {
	pol: [
		{  // PoL Record detail
			address_from: '',
			address_to: '',
			reason: '',
			tags: ['tag1', 'tag2'],
			candy_value_from: '',
			candy_value_to: '',
		},
		{},
		...
	]
	poc: [
		{  // PoC Record detail
			address: '',
			candy_value: 1,
		},
		{},
		...
	]
	...
]

今日点赞动态接口

GET /feeds/pol/today
  • Request

query

offset: 0  // 默认0
limit: 10  // 默认10
  • Response
data: [
	{  // PoL Record detail
		id: 123,
		address_from: '',
		address_to: '',
		reason: '',
		tags: ['tag1', 'tag2'],
		candy_value_from: '',
		candy_value_to: '',
		user_from: {
			// user detail
		},
		user_to: {
			// user detail
		},
		created_at: 12345678901,
		updated_at: 12345678901,
	},
	{},
	...
]

历史点赞接口

GET /feeds/pol/
  • Request

query

offset: 0  // 默认0
limit: 10  // 默认10
  • Response
data: [
	{  // PoL Record detail
		id: 123,
		address_from: '',
		address_to: '',
		reason: '',
		tags: ['tag1', 'tag2'],
		candy_value_from: '',
		candy_value_to: '',
		user_from: {
			// user detail
		},
		user_to: {
			// user detail
		},
		created_at: 12345678901,
		updated_at: 12345678901,
	},
	{},
	...
]

昨日统计接口

GET /stats/yesterday
  • Request

query

address: ''
  • Response
{
	yxt: 100.2,
	candy: 666,
	yxt_candy_ratio: 0.1222,
	total_candy: 8242,
}

个人收益统计接口

GET /stats/settlement/
  • Request

query

address: ''
  • Response
[
	{
		address: '0x00000000000000000...000',
		total_yxt: 1000,
		total_candy: 6000,
		yxt_components: {
			poc: 1.5,
			pol: 998.5,
		},
		candy_components: {
			poc: 1,
			pol: 5999,
		},
		yxt_candy_ratio: 6,
		date: 12345678901,
	},
	{},
	...
]

YXT交易记录接口

GET /transaction/
  • Request

query

address: ''  // address_from == address OR address_to == address
address_from: ''
address_to: ''
offset: 0
limit: 10
  • Response
data: [
	{  // transaction detail
		address_from: '',
		address_to: '',
		value: 1000,
		memo: '',  // 取值:'poc', 'pol', 'gift_id: 123'
	}
]

用户详情接口

GET /user/{user_id}
  • Request

query

  • Response
{
  "created_at": 1534212585,
  "updated_at": 1534216907,
  "id": 15,
  "name": "王䶮卿",
  "position": "后端开发工程师",
  "mobile": "18930587767",
  "avatar": "http://shp.qpic.cn/bizmp/QmOzyjI2DUKdzzrpbgX1wpgOWFr65bwDqgf8hzqXC51zkD7XQb7PpQ/",
  "corp_wx_user_id": "wangyanqing@baixing.com",
  "gender": 1,
  "status": 1,
  "department_id": 159,
  "department_name": "广告技术",
  "enterprise_id": 1,
  "address": "0x1234567890123456789012345678901234567890",
  "balance": 1000.234,
  "bonus_components": {
      "poc": 1000,
      "pol": 0.234,
  },
}

当前用户详情接口

GET /user/current
  • Request

query

  • Response
{
  "created_at": 1534212585,
  "updated_at": 1534216907,
  "id": 15,
  "name": "王䶮卿",
  "position": "后端开发工程师",
  "mobile": "18930587767",
  "avatar": "http://shp.qpic.cn/bizmp/QmOzyjI2DUKdzzrpbgX1wpgOWFr65bwDqgf8hzqXC51zkD7XQb7PpQ/",
  "corp_wx_user_id": "wangyanqing@baixing.com",
  "gender": 1,
  "status": 1,
  "department_id": 159,
  "department_name": "广告技术",
  "enterprise_id": 1,
  "address": "0x1234567890123456789012345678901234567890",
  "balance": 1000.234,
  "bonus_components": {
      "poc": 1000,
      "pol": 0.234,
  },
}

所有用户信息接口

GET /user
  • Request

query

keyword: ''
offset: 0
limit: 10
  • Response
[{
  "created_at": 1534212585,
  "updated_at": 1534216907,
  "id": 15,
  "name": "王䶮卿",
  "position": "后端开发工程师",
  "mobile": "18930587767",
  "avatar": "http://shp.qpic.cn/bizmp/QmOzyjI2DUKdzzrpbgX1wpgOWFr65bwDqgf8hzqXC51zkD7XQb7PpQ/",
  "corp_wx_user_id": "wangyanqing@baixing.com",
  "gender": 1,
  "status": 1,
  "department_id": 159,
  "department_name": "广告技术",
  "enterprise_id": 1
}]

礼物列表接口

POST /gift/

form

  • Request
  • Response
[
	{
		'id': 1,
		'name': '单身薯片',
		'value': 18,
		'image_url': 'http://...',
	},
	{ // gift detail },
	...
]

礼物兑换接口

POST /gift/redeem

form

  • Request
address_from: '0x00000000000..000'
gift_id: 123
  • Response
success

礼物兑换记录接口

GET /gift/redemptions/
  • Request
address_from: '0x00000000000..000'
offset: 0  // 可选
limit: 10  // 可选
  • Response
[
	{
		'id': 12,
		'name': 'iPad Pro',
		'value': 3999,
		'created_at': 12345678901,
	},
	{},
	...
]

配置接口 - 文案

GET /config/text
  • Request
  • Response
{
    'action': {
        'title': '行为',
        'content': '请简单描述一下TA的优秀行为',
    },
    'result': {
        'title': '结果',
        'content': '那么,该优秀行为的结果是',
    }
}
Edited Sep 04, 2018 by 马亦闻
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking