Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"app.go",
"base.go",
"comment.go",
"feed.go",
"invite.go",
"location.go",
"notice.go",
"push.go",
"report.go",
"search.go",
"share.go",
"sv.go",
"topic.go",
"upload.go",
"user.go",
],
importpath = "go-common/app/interface/bbq/app-bbq/api/http/v1",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/interface/bbq/app-bbq/model:go_default_library",
"//app/service/bbq/notice-service/api/v1:go_default_library",
"//app/service/bbq/topic/api:go_default_library",
"//app/service/bbq/user/api:go_default_library",
"//app/service/bbq/video/api/grpc/v1:go_default_library",
"//library/net/http/blademaster:go_default_library",
"//library/time:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,454 @@
# HTTP API文档
导航
---
* [版本](#版本)
* [说明](#说明)
* [接口说明](#接口说明)
+ [[首页视频列表]](#首页视频列表)
+ [[批量视频地址]](#批量视频地址接口)
版本
---
| 版本 | 时间 | 修订者 | 备注 |
| :--- | :--------- | :----- | :------------- |
| v0.1 | 2018.10.12 | Cheney | 初始化接口列表 |
说明
---
BBQ视频相关接口
域名
---
* **线上:** bbq.bilibili.com
* **自动化文档路径:** http://172.16.38.91/swagger
接口说明
-------
### 首页视频列表
***接口说明***
提供视频列表相关基础信息和播放信息
***请求URL***
http://DOMAIN/bbq/app-bbq/sv/list
***请求方式***
HTTP/GET
***请求参数***
| 参数名 | 必选 | 类型 | 说明 |
| :------- | :--- | :--- | :---------------------- |
| qn | 是 | int | 首选清晰度 |
| pagesize | 是 | int | 返回数据量range:0-20) |
***qn参数枚举***
目前PlayUrl支持UGC、PGC和Mobile H5的业务, 对各个业务的支持情况如下:
***<span style="color:red">Note: 对于分组为同一个的清晰度, PlayUrl服务端只会给出其中一个清晰度作为结果返回.***
##### UGC
| 分组 | 清晰度qn | 类型 | 名称 | 描述 | 访问权限 |
| :--- | :------- | :--- | :--------- | :----------- | :------------------- |
| 1# | 116 | FLV | flv_p60 | 高清 1080P60 | 大会员或此视频的UP主 |
| 1# | 112 | FLV | hdflv2 | 高清 1080P+ | 大会员或此视频的UP主 |
| 2# | 74 | FLV | flv720_p60 | 高清 720P60 | 大会员或此视频的UP主 |
| 3# | 80 | FLV | flv | 高清 1080 | 都可访问 |
| 4# | 64 | FLV | flv720 | 高清 720P | 都可访问 |
| 4# | 48 | MP4 | hdmp4 | 高清 720P | 都可访问 |
| 5# | 32 | FLV | flv480 | 清晰 480P | 都可访问 |
| 6# | 15 | FLV | flv360 | 流畅 360P | 都可访问 |
| 6# | 16 | MP4 | mp4 | 流畅 360P | 都可访问 |
| 7# | 6 | MP4 | mp4 | 极速 240P | 当且仅当type=mp4访问 |
##### PGC
| 分组 | 清晰度qn | 类型 | 名称 | 描述 | 访问权限 |
| :--- | :------- | :--- | :----- | :---------- | :------------------- |
| 1# | 112 | FLV | hdflv2 | 高清 1080P+ | 都可访问 |
| 2# | 80 | FLV | flv | 高清 1080 | 都可访问 |
| 3# | 64 | FLV | flv720 | 高清 720P | 都可访问 |
| 3# | 48 | MP4 | hdmp4 | 高清 720P | 都可访问 |
| 4# | 32 | FLV | flv480 | 清晰 480P | 都可访问 |
| 5# | 15 | FLV | flv360 | 流畅 360P | 都可访问 |
| 5# | 16 | MP4 | mp4 | 流畅 360P | 都可访问 |
| 6# | 6 | MP4 | mp4 | 极速 240P | 当且仅当type=mp4访问 |
##### Mobile H5
| 分组 | 清晰度qn | 类型 | 名称 | 描述 | 访问权限 |
| :--- | :------- | :--- | :----- | :-------- | :------------------- |
| 1# | 15 | FLV | flv360 | 流畅 360P | 都可访问 |
| 1# | 16 | MP4 | mp4 | 流畅 360P | 都可访问 |
| 2# | 6 | MP4 | mp4 | 极速 240P | 当且仅当type=mp4访问 |
*** 返回字段说明 ***
| 字段名 | 字段类型 | 字段说明 |
| :-------: | :----------------------: | :--------------: |
| svid | int | bbq视频id |
| title | string | 视频标题 |
| mid | int | 发布用户uid |
| duration | int | 时长 |
| pubtime | string | 发布时间 |
| ctime | int | 创建时间 |
| avid | int | avid |
| cid | int | cid |
| from | int | 来源渠道 |
| tag | string | 后端首选tag |
| tags | [][VideoTag](#VideoTag) | 全部tag |
| pic | string | 图片预留字段 |
| like | int | 点赞数 |
| reply | int | 评论数 |
| share | int | 分享数 |
| user_info | *UserCard(object) | 发布用户信息 |
| play | *[VideoPlay](#VideoPlay) | 播放信息 |
| is_like | bool | 当前用户是否点赞 |
***返回字段示例***
```javascript
{
"code": 0,
"message": "0",
"ttl": 1,
"data": [
{
"svid": 198,
"title": "体重88kg,深蹲200KG成功了,用了2年时间,记录一下",
"content": "",
"mid": 98628543,
"duration": 0,
"pubtime": "2018-10-12 12:45:51",
"ctime": 1539319551,
"avid": 27406598,
"cid": 47265445,
"from": 0,
"tag": "",
"tags": [],
"pic": "",
"like": 0,
"reply": 0,
"share": 0,
"user_info": {
"mid": 98628543,
"name": "笑圣贤",
"sex": "保密",
"rank": 10000,
"face": "http://i0.hdslb.com/bfs/face/fac0c8dc176ce9f8d3e176d759378233788994d4.jpg",
"sign": "一个练力量举的UP,1981年的大叔,体重88kg,三大项540KG",
"level": 0,
"vip_info": {
"type": 0,
"status": 0,
"due_date": 0
}
},
"play": {
"cid": 47265445,
"expire_time": 1539330912,
"file_info": [
{
"ahead": "Egg=",
"filesize": 2332329,
"timelength": 40128,
"vhead": "AWQAHv/hABpnZAAerNlBcFHlkhAAAAMAEAAAAwMg8WLZYAEABWjr7PI8"
}
],
"fnval": 0,
"fnver": 0,
"quality": 15,
"support_description": [
"高清 720P",
"清晰 480P",
"流畅 360P"
],
"support_formats": [
"flv720",
"flv480",
"flv360"
],
"support_quality": [
64,
32,
15
],
"url": "http://upos-hz-mirrorcos.acgvideo.com/upgcxcode/45/54/47265445/47265445-1-15.flv?um_deadline=1539334512&platform=&rate=98807&oi=0&um_sign=45b60b850c9e577261feb079ced1bb3d&gen=playurl&os=cos&trid=3db463de4aa2476cb56900e87f733323",
"video_codecid": 7,
"video_project": true,
"current_time": 1539327312
},
"is_like": false
},
{
"svid": 1740,
"title": "【朱一龙舔屏】全部都是你(๑> ᴗ<๑)❤【竖屏丨手机福利】",
"content": "手机观看效果最佳!送闺蜜@灰 的居仔舔屏视频,熬夜终于在七夕搞定了,就是想摸鱼剪剪竖屏玩。祝大家七夕情人节快乐!快点进来收获爱情吧!ヾ(๑╹◡╹)ノ\"",
"mid": 761997,
"duration": 0,
"pubtime": "2018-10-12 12:52:06",
"ctime": 1539319926,
"avid": 29574294,
"cid": 51427230,
"from": 0,
"tag": "",
"tags": [
{
"id": 797,
"name": "明星",
"type": 3
},
{
"id": 798,
"name": "娱乐",
"type": 1
},
{
"id": 805,
"name": "朱一龙",
"type": 3
},
{
"id": 1729,
"name": "剪辑",
"type": 3
},
{
"id": 4103,
"name": "七夕",
"type": 3
}
],
"pic": "",
"like": 0,
"reply": 0,
"share": 0,
"user_info": {
"mid": 761997,
"name": "無駄無駄",
"sex": "保密",
"rank": 10000,
"face": "http://i2.hdslb.com/bfs/face/fbe53ad204dd36d268a9e6e887918787956914fd.gif",
"sign": "【渣渣水平,蜗牛手速,感谢赏脸!】微博:@-6plus7- 【B站ID是抢注的舍不得改没错是隐藏的JOJO厨】",
"level": 0,
"vip_info": {
"type": 2,
"status": 1,
"due_date": 1570809600000
}
},
"play": {
"cid": 51427230,
"expire_time": 1539330912,
"file_info": [
{
"ahead": "EZA=",
"filesize": 6204058,
"timelength": 102254,
"vhead": "AWQAHv/hABlnZAAerNlBcFHl4QAAAwABAAADADwPFi2WAQAFaOvs8jw="
}
],
"fnval": 0,
"fnver": 0,
"quality": 15,
"support_description": [
"高清 1080P60",
"高清 720P60",
"高清 1080P",
"高清 720P",
"清晰 480P",
"流畅 360P"
],
"support_formats": [
"flv_p60",
"flv720_p60",
"flv",
"flv720",
"flv480",
"flv360"
],
"support_quality": [
116,
74,
80,
64,
32,
15
],
"url": "http://upos-hz-mirrorcos.acgvideo.com/upgcxcode/30/72/51427230/51427230-1-15.flv?um_deadline=1539334512&platform=&rate=103144&oi=0&um_sign=305264b6bc32d61fd1020a71c24f3544&gen=playurl&os=cos&trid=3db463de4aa2476cb56900e87f733323",
"video_codecid": 7,
"video_project": true,
"current_time": 1539327312
},
"is_like": false
}
]
}
```
### 批量视频地址接口
***接口说明***
提供可替换视频地址服务
***请求URL***
http://DOMAIN/bbq/app-bbq/sv/playlist
***请求方式***
HTTP/GET
***请求参数***
| 参数名 | 必选 | 类型 | 说明 |
| :----- | :--- | :----- | :------------------ |
| qn | 是 | int | 首选清晰度 |
| cids | 是 | string | 请求cid逗号分隔 |
*** 返回字段说明 ***
| 字段名 | 字段类型 | 字段说明 |
| :----: | :------------------------: | :---------------: |
| data | []*[VideoPlay](#VideoPlay) | bvc playurl 结构 |
***返回字段示例***
```javascript
{
"code": 0,
"message": "0",
"ttl": 1,
"data": [
{
"cid": 49159587,
"expire_time": 1539331184,
"file_info": [
{
"ahead": "EZBW5QA=",
"filesize": 12879106,
"timelength": 258118,
"vhead": "AWQAH//hAB1nZAAfrNnA2D3n//AoACfxAAADA+kAAOpgDxgxngEABWjpuyyL"
}
],
"fnval": 0,
"fnver": 0,
"quality": 32,
"support_description": [
"高清 1080P",
"高清 720P",
"清晰 480P",
"流畅 360P"
],
"support_formats": [
"flv",
"flv720",
"flv480",
"flv360"
],
"support_quality": [
80,
64,
32,
15
],
"url": "http://upos-hz-mirrorcos.acgvideo.com/upgcxcode/87/95/49159587/49159587-1-32.flv?um_deadline=1539334784&platform=&rate=84823&oi=0&um_sign=2969b624cf3abf67505e60d78babbc70&gen=playurl&os=cos&trid=60941200ead244fbbcbd6090c5b337d0",
"video_codecid": 7,
"video_project": true,
"current_time": 1539327585
},
{
"cid": 52172330,
"expire_time": 1539331184,
"file_info": [
{
"ahead": "EZA=",
"filesize": 2377519,
"timelength": 15181,
"vhead": "AWQAHv/hABlnZAAerNlA2D3n4QAAAwABAAADADIPFi2WAQAFaOvs8jw="
}
],
"fnval": 0,
"fnver": 0,
"quality": 32,
"support_description": [
"高清 1080P+",
"高清 1080P",
"高清 720P",
"清晰 480P",
"流畅 360P"
],
"support_formats": [
"hdflv2",
"flv",
"flv720",
"flv480",
"flv360"
],
"support_quality": [
112,
80,
64,
32,
15
],
"url": "http://upos-hz-mirrorcos.acgvideo.com/upgcxcode/30/23/52172330/52172330-1-32.flv?um_deadline=1539334784&platform=&rate=266239&oi=0&um_sign=1533acfdd923bffab96f65d63f64ad9c&gen=playurl&os=cos&trid=60941200ead244fbbcbd6090c5b337d0",
"video_codecid": 7,
"video_project": true,
"current_time": 1539327585
}
]
}
```
*附
--
***通用字段***
##### VideoPlay
| 字段名 | 字段类型 | 字段说明 |
| :-----------------: | :----------------------: | :-------------------------------------------------: |
| cid | int64 | cid |
| expire_time | int64 | 过期时间 |
| file_info | []*[FileInfo](#FileInfo) | 分片信息 |
| fnval | int64 | 播放器请求端使用的, 功能标识, 每位(为1)标识一个功能 |
| fnver | int64 | 播放器请求端使用的, 功能版本号 |
| quality | int64 | 清晰度 |
| support_description | []string | 支持清晰度描述 |
| support_formats | []string | 支持格式 |
| support_quality | []int64 | 支持清晰度 |
| url | string | 基础url |
| video_codecid | int64 | 对应视频调度的结果编码值 |
| video_project | bool | 是否可投影 |
| current_time | int64 | 当前时间戳 |
##### FileInfo
| 字段名 | 字段类型 | 字段说明 |
| :--------: | :------: | :----------------------------------: |
| ahead | int | 视频分片文件的音频头信息, BASE64编码 |
| filesize | int | 视频的对应分片文件的大小 |
| timelength | int | 视频的对应分片文件的时长 |
| vhead | int | 视频分片文件的视频头信息, BASE64编码 |
##### VideoTag
| 字段名 | 字段类型 | 字段说明 |
| :----: | :------: | :------: |
| id | int | tagid |
| name | int | tag名字 |
| type | int | tag类型 |

View File

@@ -0,0 +1,41 @@
package v1
import (
"go-common/app/interface/bbq/app-bbq/model"
"go-common/library/time"
)
// AppSettingRequest .
type AppSettingRequest struct {
Base
VersionCode int `json:"version_code" form:"version_code" validate:"required"`
}
// AppUpdate .
type AppUpdate struct {
NewVersion uint8 `json:"new_version"`
Info *model.AppVersion `json:"info,omitempty"`
}
// AppSettingResponse .
type AppSettingResponse struct {
Public map[string]interface{} `json:"public"`
Update *AppUpdate `json:"update"`
Resources []*model.AppResource `json:"resources"`
}
// AppPackage .
type AppPackage struct {
ID int64 `json:"id"`
Platform uint8 `json:"platform"`
VersionName string `json:"version_name"`
VersionCode uint32 `json:"version_code"`
Title string `json:"title"`
Content string `json:"content"`
Download string `json:"download"`
MD5 string `json:"md5"`
Size int32 `json:"size"`
Force uint8 `json:"force"`
Status uint8 `json:"status"`
CTime time.Time `json:"ctime"`
}

View File

@@ -0,0 +1,23 @@
package v1
// Base .
type Base struct {
App string `json:"mobi_app" form:"mobi_app"`
Client string `json:"platform" form:"platform"`
Version string `json:"version" form:"version"`
Channel string `json:"channel" form:"channel"`
Location string `json:"location" form:"location"`
QueryID string `json:"query_id" form:"query_id"`
Module int `json:"module_id" form:"module_id"`
BUVID string
}
// DataReport 埋点上报字段
type DataReport struct {
Base
SVID int `json:"svid" form:"svid"`
TotalDuration int `json:"total_duration" form:"total_duration"`
PlayDuration int `json:"duration" form:"duration"`
DataType int `json:"data_type" form:"data_type"`
Page int `json:"page_id" form:"page_id"`
}

View File

@@ -0,0 +1,87 @@
package v1
import (
"go-common/app/interface/bbq/app-bbq/model"
)
//CommentList 评论列表
type CommentList struct {
OReply *model.CursorRes `json:"oreply,omitempty"`
}
//CommentCursorReq 游标获取评论请求参数
type CommentCursorReq struct {
SvID int64 `form:"oid" validate:"gt=0,required"`
RpID int64 `form:"rpid"`
Sort int16 `form:"sort"`
MaxID int64 `form:"max_id"`
MinID int64 `form:"min_id"`
Size int64 `form:"size" validate:"min=0"`
Plat int64 `form:"plat"`
Build int64 `form:"build"`
Access string `form:"access_key"`
Type int64
MID int64
}
//CommentAddReq 发表评论请求参数
type CommentAddReq struct {
SvID int64 `form:"oid" validate:"gt=0,required"`
Root int64 `form:"root"`
Parent int64 `form:"parent"`
At string `form:"at"`
Message string `form:"message" validate:"required"`
Plat int16 `form:"plat"`
Device string `form:"device"`
Code string `form:"code"`
Type int64
AccessKey string
}
//CommentLikeReq 评论点怎/取消请求参数
type CommentLikeReq struct {
SvID int64 `form:"oid" validate:"gt=0,required"`
RpID int64 `form:"rpid" validate:"gt=0,required"`
Action int16 `form:"action" validate:"min=0"`
Type int64
AccessKey string
}
//CommentReportReq 评论举报参数
type CommentReportReq struct {
SvID int64 `form:"oid" validate:"required"`
RpID int64 `form:"rpid" validate:"gt=0,required"`
Reason int16 `form:"reason" validate:"min=0"`
Content string `form:"content" validate:"min=2,max=200"`
Type int64
AccessKey string
}
//CommentListReq 评论列表请求参数
type CommentListReq struct {
SvID int64 `form:"oid" validate:"gt=0,required"`
Sort int16 `form:"sort"`
NoHot int16 `form:"nohot"`
Pn int64 `form:"pn"`
Ps int64 `form:"ps"`
Plat int64 `form:"plat"`
Build int64 `form:"build"`
Access string `form:"access_key"`
Type int64
MID int64
}
//CommentSubCursorReq 游标获取子回复及子评论定位参数
type CommentSubCursorReq struct {
SvID int64 `form:"oid" validate:"gt=0,required"`
Sort int16 `form:"sort" validate:"min=0"`
Root int64 `form:"root" validate:"gt=0,required"`
RpID int64 `form:"rpid" validate:"min=0"`
Size int64 `form:"size" validate:"min=0"`
MaxID int64 `form:"max_id" validate:"min=0"`
MinID int64 `form:"min_id" validate:"min=0"`
Type int64
Plat int64 `form:"plat"`
Build int64 `form:"build"`
Access string `form:"access_key"`
}

View File

@@ -0,0 +1,63 @@
package v1
import (
"go-common/app/interface/bbq/app-bbq/model"
video "go-common/app/service/bbq/video/api/grpc/v1"
bm "go-common/library/net/http/blademaster"
)
// HotReply 热评
type HotReply struct {
Hots []*model.Reply `json:"hots,omitempty"`
}
// SvDetail one video detail
type SvDetail struct {
VideoResponse
CursorValue string `json:"cursor_value"` // 透传给客户端,标记在列表中的位置
ElapsedTime int64 `json:"elapsed_time"` // 从发布到现在时间
HotReply HotReply `json:"hot_reply"` // 热评
}
// FeedListRequest feed/list request
type FeedListRequest struct {
MID int64
Device *bm.Device
BUVID string
Mark string `json:"mark" form:"mark"`
Page int `json:"page" form:"page" validate:"required"`
Qn int64 `json:"qn" form:"qn" validate:"required"`
}
// FeedListResponse feed/list request
type FeedListResponse struct {
Mark string `json:"mark" form:"mark"`
HasMore bool `json:"has_more" form:"has_more"`
List []*SvDetail `json:"list,omitempty" form:"list"`
RecList []*SvDetail `json:"rec_list,omitempty" form:"list"`
}
// FeedUpdateNumResponse feed/list request
type FeedUpdateNumResponse struct {
Num int64 `json:"num"`
}
// SpaceSvListRequest feed/list request
// 所有在空间中的视频列表,都复用该请求,同理回包
type SpaceSvListRequest struct {
MID int64
Size int
Device *bm.Device
DeviceID string `json:"device_id" form:"device_id"`
Qn int64 `json:"qn" form:"qn" validate:"required"`
UpMid int64 `json:"up_mid" form:"up_mid" validate:"required"`
CursorPrev string `json:"cursor_prev" form:"cursor_prev"` // CursorValue
CursorNext string `json:"cursor_next" form:"cursor_next"`
}
// SpaceSvListResponse feed/list request
type SpaceSvListResponse struct {
HasMore bool `json:"has_more" form:"has_more"`
List []*SvDetail `json:"list,omitempty" form:"list"`
PrepareList []*video.UploadingVideo `json:"prepare_list,omitempty"`
}

View File

@@ -0,0 +1,19 @@
package v1
// InvitationRequest .
type InvitationRequest struct {
MID int64 `json:"mid" form:"mid" validate:"required"`
}
// Download .
type Download struct {
URL string `json:"url"`
PWD string `json:"pwd"`
Type int8 `json:"type"`
}
// InvitationResponse .
type InvitationResponse struct {
Data []*Download `json:"download,omitempty"`
InviteCode int32 `json:"invite_code"`
}

View File

@@ -0,0 +1,15 @@
package v1
import (
"go-common/app/interface/bbq/app-bbq/model"
)
// LocationRequest .
type LocationRequest struct {
PID int32 `form:"pid"`
}
// LocationResponse .
type LocationResponse struct {
List []*model.Location
}

View File

@@ -0,0 +1,47 @@
package v1
import (
notice "go-common/app/service/bbq/notice-service/api/v1"
)
// NoticeNumResponse .
type NoticeNumResponse struct {
RedDot int64 `json:"red_dot"`
}
// NoticeOverviewResponse .
type NoticeOverviewResponse struct {
Notices []*NoticeOverview `json:"notices,omitempty"`
}
// NoticeOverview .
type NoticeOverview struct {
UnreadNum int64 `json:"unread_num"`
Name string `json:"name"`
NoticeType int32 `json:"notice_type"`
ShowType int32 `json:"show_type"`
}
// NoticeListRequest .
type NoticeListRequest struct {
Mid int64
NoticeType int32 `form:"notice_type" validated:"required"`
CursorNext string `form:"cursor_next" validated:"required"`
}
// NoticeListResponse .
type NoticeListResponse struct {
HasMore bool `json:"has_more"`
List []*NoticeMsg `json:"list,omitempty"`
}
// NoticeMsg .
type NoticeMsg struct {
*notice.NoticeBase
ShowType int32 `json:"show_type"`
State int32 `json:"state"`
UserInfo *UserInfo `json:"user_info,omitempty"`
Pic string `json:"pic"`
CursorValue string `json:"cursor_value"`
ErrMsg string `json:"err_msg"`
}

View File

@@ -0,0 +1,21 @@
package v1
// PushRegisterRequest .
type PushRegisterRequest struct {
RegID string `json:"register_id" form:"register_id" validate:"required"`
Platform string `json:"platform" form:"platform" validate:"required"`
SDK uint8 `json:"sdk" form:"sdk"`
}
// PushRegisterResponse .
type PushRegisterResponse struct{}
// PushCallbackRequest .
type PushCallbackRequest struct {
Base
TID string `json:"tid" form:"tid"`
NID string `json:"nid" form:"nid"`
}
// PushCallbackResponse .
type PushCallbackResponse struct{}

View File

@@ -0,0 +1,19 @@
package v1
import "go-common/app/interface/bbq/app-bbq/model"
// ReportConfigResponse .
type ReportConfigResponse struct {
Report []*model.ReportConfig `json:"report_config,omitempty"`
Reasons []*model.ReasonConfig `json:"reason_config,omitempty"`
}
// ReportRequest .
type ReportRequest struct {
Type int16 `json:"type" form:"type" validate:"required"`
UpMID int64 `json:"up_mid" form:"up_mid"`
SVID int64 `json:"svid" form:"svid"`
RpID int64 `json:"rpid" form:"rpid"`
Danmu int64 `json:"danmu" form:"danmu"`
Reason int16 `json:"reason" form:"reason"`
}

View File

@@ -0,0 +1,82 @@
package v1
//HotWordRequest .
type HotWordRequest struct {
}
//HotWordResponse .
type HotWordResponse struct {
List []string `json:"list,omitempty"`
}
// VideoSearchList 搜索视频结构
type VideoSearchList struct {
VideoResponse
TitleHighlight string `json:"title_highlight"`
HitColumns []string `json:"hit_columns,omitempty"`
CursorValue string `json:"cursor_value"`
Offset int64 // 这里不返回给客户端,只是为了代码方便处理
}
// VideoSearchRes 搜索用视频结果
type VideoSearchRes struct {
List []*VideoSearchList `json:"list,omitempty"`
NumPage int64 `json:"numPages"`
Page int64 `json:"page"`
HasMore bool `json:"has_more"`
}
// UserSearchRes 搜索用户结果
type UserSearchRes struct {
List []*UserSearchList `json:"list,omitempty"`
NumPage int64 `json:"numPages"`
Page int64 `json:"page"`
HasMore bool `json:"has_more"`
}
// UserSearchList 搜索用户结构
type UserSearchList struct {
UserInfo
UserStatic *UserStatic `json:"user_statistics"`
UnameHighlight string `json:"uname_highlight"`
HitColumns []string `json:"hit_columns"`
CursorValue string `json:"cursor_value"`
Offset int64 // 这里不返回给客户端,只是为了代码方便处理
}
// UserStatic 用户统计信息
type UserStatic struct {
Fan int64 `json:"fan"`
Follow int64 `json:"follow"`
Like int64 `json:"like"`
Liked int64 `json:"liked"`
FollowState int8 `json:"follow_state"`
}
// BaseSearchReq 基础搜索请求
type BaseSearchReq struct {
Key string `form:"keyword" validate:"required"`
Page int64 `form:"page"`
PageSize int64 `form:"pagesize"`
Highlight int8 `form:"highlight"`
Qn int64 `form:"qn"`
// TODO:v2接口当page=0时生效由于不久会拆接口因此这里就复用老接口
CursorPrev string `form:"cursor_prev"`
CursorNext string `form:"cursor_next"`
}
// SugTag sug tag结构
type SugTag struct {
Value string `json:"value"`
Name string `json:"name" `
Type string `json:"type"`
Ref int64 `json:"ref"`
}
// SugReq sug请求
type SugReq struct {
KeyWord string `form:"keyword" validate:"required"`
PageSize int64 `form:"pagesize"`
Highlight int8 `form:"highlight"`
}

View File

@@ -0,0 +1,33 @@
package v1
// Tuple .
type Tuple struct {
Key string
Val string
}
// ShareRequest .
type ShareRequest struct {
Svid int64 `form:"svid"`
Channel int32 `form:"share_channel"`
}
// ShareResponse .
type ShareResponse struct {
URL []*Tuple `json:"url"`
Params []*Tuple `json:"params"`
}
// ShareCallbackRequest .
type ShareCallbackRequest struct {
Svid int64 `form:"svid"`
URL string `form:"url"`
Type string `form:"type"`
Ctime int64 `form:"ctime"`
Channel int32 `form:"share_channel"`
}
// ShareCallbackResponse struct
type ShareCallbackResponse struct {
ShareCount int32 `json:"share"`
}

View File

@@ -0,0 +1,111 @@
package v1
import (
"go-common/app/interface/bbq/app-bbq/model"
user "go-common/app/service/bbq/user/api"
bm "go-common/library/net/http/blademaster"
)
// SvListReq 列表参数
type SvListReq struct {
MID int64
Base *Base
RemoteIP string
PageSize int64 `form:"pagesize" validate:"gt=0,max=20,required"`
}
// SvDetailReq 视频详情参数
type SvDetailReq struct {
SVID int64 `form:"svid" validate:"gt=0,required"`
}
// SvDetailResponse 视频详情返回
type SvDetailResponse struct {
IsLike bool `json:"is_like"`
}
//PlayListReq 批量获取playurl接口
type PlayListReq struct {
CIDs string `form:"cids" validate:"required"`
MID int64
Device *bm.Device
RemoteIP string
}
// VideoResponse 返回视频结构
type VideoResponse struct {
model.SvInfo
model.SvStInfo
SVID int64 `json:"svid"`
Tag string `json:"tag"` // 首选标签
Tags []VideoTag `json:"tags,omitempty"` // 所有标签
UserInfo user.UserBase `json:"user_info,omitempty"` // 用户信息
Play VideoPlay `json:"play,omitempty"` // 播放信息
IsLike bool `json:"is_like"` // 是否点赞
QueryID string `json:"query_id"` // 推荐播放埋点字段,勿删!
Extension string `json:"extension"` // 扩展字段如title_extra等
}
//VideoTag 视屏标签
type VideoTag struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type int16 `json:"type"`
}
// VideoPlay playinfo
type VideoPlay struct {
SVID int64 `json:"svid"`
ExpireTime int64 `json:"expire_time"` //过期时间
FileInfo []*FileInfo `json:"file_info"` //分片信息
Quality int64 `json:"quality"` //清晰度
SupportQuality []int64 `json:"support_quality"` //支持清晰度
URL string `json:"url"` //基础url
CurrentTime int64 `json:"current_time"` //当前时间戳
}
// CVideo bvc playurl结构
type CVideo struct {
CID int64 `json:"cid"`
ExpireTime int64 `json:"expire_time"`
FileInfo map[string][]*FileInfo `json:"file_info,omitempty"`
Fnval int64 `json:"fnval"`
Fnver int64 `json:"fnver"`
Quality int64 `json:"quality"`
SupportDescription []string `json:"support_description,omitempty"`
SupportFormats []string `json:"support_formats,omitempty"`
SupportQuality []int64 `json:"support_quality,omitempty"`
URL string `json:"url"`
VideoCodeCID int64 `json:"video_codecid"`
VideoProject bool `json:"video_project"`
}
// FileInfo bvc fileinfo
type FileInfo struct {
Ahead string `json:"ahead"`
FileSize int64 `json:"filesize"`
TimeLength int64 `json:"timelength"`
Vhead string `json:"vhead"`
Path string `json:"path"`
URL string `json:"url"`
URLBc string `json:"url_bc"`
}
// SvStatRes 视频统计数据返回
type SvStatRes struct {
model.SvStInfo
IsLike bool `json:"is_like"`
FollowState int8 `json:"follow_state"`
}
//SvRelReq 相关推荐请求
type SvRelReq struct {
SVID int64 `form:"svid"`
QueryID string `form:"query_id"`
MID int64
APP string
APPVersion string
Limit int32
Offset int32
BUVID string
}

View File

@@ -0,0 +1,51 @@
package v1
import topic "go-common/app/service/bbq/topic/api"
// TopicVideo 话题视频的结构
type TopicVideo struct {
*VideoResponse
CursorValue string `json:"cursor_value"` // 透传给客户端,标记在列表中的位置
HotType int64 `json:"hot_type"` // 热门类型直接用topic给的数据
}
//TopicDetail 话题详情页可作为详情页回包也可作为发现页话题列表的item
type TopicDetail struct {
HasMore bool `json:"has_more"`
TopicInfo *topic.TopicInfo `json:"topic_info,omitempty"`
List []*TopicVideo `json:"list,omitempty"`
}
// DiscoveryRes 发现页返回结构
type DiscoveryRes struct {
BannerList []*Banner `json:"banner_list"`
HotWords []string `json:"hot_words"`
TopicList []*TopicDetail `json:"topic_list"`
HasMore bool `json:"has_more"`
}
// Banner Banner结构
type Banner struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type int16 `json:"type"`
Scheme string `json:"scheme"`
PIC string `json:"pic"`
}
//DiscoveryReq 发现页请求
type DiscoveryReq struct {
Page int32 `form:"page" validate:"gt=0,required"`
}
// TopicSearchReq 话题搜索请求
type TopicSearchReq struct {
Page int32 `form:"page" validate:"gt=0,required"`
Keyword string `from:"keyword"`
}
// TopicSearchResponse 话题搜索回包
type TopicSearchResponse struct {
HasMore bool `json:"has_more"`
List []*topic.TopicInfo `json:"list,omitempty"`
}

View File

@@ -0,0 +1,36 @@
package v1
// ImgUploadRequest .
type ImgUploadRequest struct {
Type int `json:"type" form:"type"`
}
//PreUploadRequest ...
type PreUploadRequest struct {
Title string `json:"title" form:"title" validate:"required"`
Extension string `json:"extension" form:"extension"`
FileExt string `json:"file_ext" form:"file_ext" validate:"required"`
}
//CallBackRequest ..
type CallBackRequest struct {
Svid int64 `json:"biz_id" form:"biz_id" validate:"required"`
URL string `json:"url" form:"url" validate:"required"`
Profile string `json:"profile" form:"profile" validate:"required"`
UploadID string `json:"upload_id" form:"upload_id" validate:"required"`
Auth string `json:"auth" form:"auth" validate:"required"`
}
// UploadCheckResponse 创作中心上传过滤
type UploadCheckResponse struct {
Msg string `json:"msg"`
IsAllow bool `json:"is_allow"`
}
//HomeImgRequest ...
type HomeImgRequest struct {
SVID int64 `json:"biz_id" form:"biz_id" validate:"required"`
URL string `json:"url" form:"url" validate:"required"`
Width int64 `json:"width" form:"width" validate:"required"`
Height int64 `json:"height" form:"height" validate:"required"`
}

View File

@@ -0,0 +1,77 @@
package v1
import (
user "go-common/app/service/bbq/user/api"
)
//LoginRequest 登陆
type LoginRequest struct {
NewTag int8 `json:"new_tag" form:"new_tag"`
}
//PhoneCheckResponse ...
type PhoneCheckResponse struct {
TELStatus int32 `json:"tel_status"`
}
// SpaceUserProfileRequest ...
type SpaceUserProfileRequest struct {
Upmid int64 `json:"up_mid" form:"up_mid" validate:"required"`
}
// NumResponse 空返回值
type NumResponse struct {
Num int64 `json:"num"`
}
//UserRelationRequest .
type UserRelationRequest struct {
UPMID int64 `json:"up_mid" form:"up_mid" validate:"required"`
// 见上述RelationAction
Action int32 `json:"action" form:"action"`
}
// UserRelationListResponse 关注、粉丝、拉黑列表结构
type UserRelationListResponse struct {
HasMore bool `json:"has_more"`
List []*UserInfo `json:"list,omitempty"`
}
//UserLikeAddRequest .
type UserLikeAddRequest struct {
SVID int64 `json:"svid" form:"svid" validate:"required"`
}
//UserLikeCancelRequest .
type UserLikeCancelRequest struct {
SVID int64 `json:"svid" form:"svid" validate:"required"`
}
//InviteCodeRequest .
type InviteCodeRequest struct {
Num int64 `json:"num" form:"num" validate:"required"`
Type string `json:"type" form:"type" validate:"required"`
Digit int64 `json:"digit" form:"digit" validate:"required"`
Author int64 `json:"author" form:"author" validate:"required"`
}
//CheckInviteCodeRequest .
type CheckInviteCodeRequest struct {
Code int64 `json:"code" form:"code" validate:"required"`
DeviceID string `json:"device_id" form:"device_id" validate:"required"`
Uname string `json:"uname" form:"uname"`
}
// UserInfo 用户相关信息,统一提供对外结构
type UserInfo struct {
user.UserBase
user.UserStat
FollowState int8 `json:"follow_state"`
CursorValue string `json:"cursor_value"`
}
// UnLikeReq 不感兴趣
type UnLikeReq struct {
MID int64 `json:"mid" form:"mid"`
SVID int64 `json:"svid" form:"svid"`
}