93 lines
2.4 KiB
Plaintext
Executable File
93 lines
2.4 KiB
Plaintext
Executable File
syntax = "v1"
|
|
|
|
info(
|
|
desc: "danmaku gateway服务接口定义"
|
|
)
|
|
|
|
import (
|
|
"git.ixiaochuan.cn/zuiyou_server/service/proto/mproto"
|
|
"git.ixiaochuan.cn/zuiyou_server/zy_service/bizcomm/commfunc"
|
|
"git.ixiaochuan.cn/zuiyou_server/zy_service/types/posttypes"
|
|
"git.ixiaochuan.cn/zuiyou_server/zy_service/types/topicauxtypes"
|
|
"git.ixiaochuan.cn/zuiyou_server/zy_service/types/danmakutypes"
|
|
)
|
|
|
|
|
|
type (
|
|
LikeDanmakuParam {
|
|
Id int64 `json:"id"`
|
|
}
|
|
LikeDanmakuData {
|
|
Liked int64 `json:"liked"`
|
|
Liken int64 `json:"liken"`
|
|
}
|
|
DanmakuListParam{
|
|
Vid int64 `json:"vid"`
|
|
Pid int64 `json:"pid"`
|
|
T int64 `json:"t"`
|
|
Et int64 `json:"et"`
|
|
Dmv string `json:"dmv"`
|
|
Web int64 `json:"web"`
|
|
}
|
|
DanmakuListData{
|
|
List []*DanmakuStWithMember `json:"list" bson:"list" msgpack:"list"`
|
|
More *int64 `json:"more" bson:"more" msgpack:"more"`
|
|
T *int64 `json:"t" bson:"t" msgpack:"t"`
|
|
Vote *DanmakuVideoVoteSt `json:"vote,omitempty"`
|
|
}
|
|
DanmakuListDataV2{
|
|
List []*danmakutypes.DanmakuSt `json:"list" bson:"list" msgpack:"list"`
|
|
More *int64 `json:"more" bson:"more" msgpack:"more"`
|
|
T *int64 `json:"t" bson:"t" msgpack:"t"`
|
|
Vote *DanmakuVideoVoteSt `json:"vote,omitempty"`
|
|
}
|
|
|
|
)
|
|
|
|
@server(
|
|
prefix: /danmaku
|
|
group: danmaku
|
|
check_permission: true
|
|
check_freq: false
|
|
)
|
|
service gateway {
|
|
@handler LikeDanmakuHandle
|
|
post /like (LikeDanmakuParam) returns (LikeDanmakuData)
|
|
|
|
@handler DisLikeDanmakuHandle
|
|
post /dislike (LikeDanmakuParam) returns (LikeDanmakuData)
|
|
|
|
@handler DanmakuListHandle
|
|
post /list (DanmakuListParam) returns (DanmakuListData) opts (check_permission: false)
|
|
}
|
|
|
|
dag LikeDanmakuHandle (
|
|
// 检查设备是否被封禁、用户是否被封禁、是否拉黑彼此
|
|
CheckUser ()
|
|
DanmakuLike (
|
|
dependency [CheckUser]
|
|
)
|
|
)
|
|
|
|
dag DisLikeDanmakuHandle (
|
|
// 检查设备是否被封禁、用户是否被封禁、是否拉黑彼此
|
|
CheckUser ()
|
|
DanmakuLike (
|
|
dependency [CheckUser]
|
|
)
|
|
)
|
|
|
|
dag DanmakuListHandle (
|
|
PreCheck()
|
|
DanmakuList(
|
|
dependency [PreCheck]
|
|
)
|
|
GetUserDanmakuIntercept(
|
|
dependency [PreCheck]
|
|
)
|
|
DealAndFilterDanmakuList(
|
|
dependency [PreCheck, DanmakuList, GetUserDanmakuIntercept]
|
|
)
|
|
)
|
|
|