121 lines
2.4 KiB
Go
121 lines
2.4 KiB
Go
package proto
|
|
|
|
import (
|
|
"service/api/base"
|
|
"service/dbstruct"
|
|
)
|
|
|
|
// api 创建
|
|
type ApiCreateReq struct {
|
|
base.BaseRequest
|
|
AccountRelations []*dbstruct.AccountRelation `json:"account_relations"`
|
|
}
|
|
|
|
type ApiCreateData struct {
|
|
}
|
|
|
|
type ApiCreateResp struct {
|
|
base.BaseResponse
|
|
Data *ApiCreateData `json:"data"`
|
|
}
|
|
|
|
// api 删除
|
|
type ApiDeleteReq struct {
|
|
base.BaseRequest
|
|
Sentences []*dbstruct.AccountRelation `json:"sentences"` // 判断条件
|
|
}
|
|
|
|
type ApiDeleteData struct {
|
|
}
|
|
|
|
type ApiDeleteResp struct {
|
|
base.BaseResponse
|
|
Data *ApiDeleteData `json:"data"`
|
|
}
|
|
|
|
// api 更新
|
|
type ApiUpdateReq struct {
|
|
base.BaseRequest
|
|
*dbstruct.AccountRelation
|
|
Sentence *dbstruct.AccountRelation `json:"sentence"` // 判断条件
|
|
}
|
|
|
|
type ApiUpdateData struct {
|
|
}
|
|
|
|
type ApiUpdateResp struct {
|
|
base.BaseResponse
|
|
Data *ApiUpdateData `json:"data"`
|
|
}
|
|
|
|
// api 列表
|
|
type ApiListReq struct {
|
|
base.BaseRequest
|
|
Mid *int64 `json:"mid"`
|
|
Offset int `json:"offset"`
|
|
Limit int `json:"limit"`
|
|
}
|
|
|
|
type ApiListData struct {
|
|
List []*dbstruct.AccountRelation `json:"list"`
|
|
Offset int `json:"offset"`
|
|
More int `json:"more"`
|
|
}
|
|
|
|
type ApiListResp struct {
|
|
base.BaseResponse
|
|
Data *ApiListData `json:"data"`
|
|
}
|
|
|
|
// 计数
|
|
type ApiCountReq struct {
|
|
base.BaseRequest
|
|
Mid *int64 `json:"mid"`
|
|
}
|
|
|
|
type ApiCountData struct {
|
|
FollowCount int64 `json:"follow_count"`
|
|
IsFollowedCount int64 `json:"is_followed_count"`
|
|
FriendCount int64 `json:"friend_count"`
|
|
}
|
|
|
|
type ApiCountResp struct {
|
|
base.BaseResponse
|
|
Data *ApiListData `json:"data"`
|
|
}
|
|
|
|
// 根据sentence查询
|
|
type ApiListBySentenceReq struct {
|
|
base.BaseRequest
|
|
*dbstruct.AccountRelation
|
|
}
|
|
|
|
type ApiListBySentenceData struct {
|
|
IsAccountRelationExisted bool `json:"is_account_relation_existed"`
|
|
}
|
|
|
|
type ApiListBySentenceResp struct {
|
|
base.BaseResponse
|
|
Data *ApiListData `json:"data"`
|
|
}
|
|
|
|
// 根据主语mid和谓词查询
|
|
type ApiListBySubMidAndPredicateReq struct {
|
|
base.BaseRequest
|
|
SubMid *int64 `json:"sub_mid"`
|
|
Predicate *int64 `json:"predicate"`
|
|
Offset int `json:"offset"`
|
|
Limit int `json:"limit"`
|
|
}
|
|
|
|
type ApiListBySubMidAndPredicateData struct {
|
|
List []*dbstruct.AccountRelation `json:"list"`
|
|
Offset int `json:"offset"`
|
|
More int `json:"more"`
|
|
}
|
|
|
|
type ApiListBySubMidAndPredicateResp struct {
|
|
base.BaseResponse
|
|
Data *ApiListBySubMidAndPredicateData `json:"data"`
|
|
}
|