73 lines
1.3 KiB
Go
73 lines
1.3 KiB
Go
package proto
|
||
|
||
import (
|
||
"service/api/base"
|
||
"service/dbstruct"
|
||
)
|
||
|
||
// op 创建
|
||
type OpCreateReq struct {
|
||
*dbstruct.Product
|
||
}
|
||
|
||
type OpCreateData struct {
|
||
}
|
||
|
||
type OpCreateResp struct {
|
||
base.BaseResponse
|
||
Data *OpCreateData `json:"data"`
|
||
}
|
||
|
||
// op 删除
|
||
type OpDeleteReq struct {
|
||
Id int64 `json:"id"`
|
||
}
|
||
|
||
type OpDeleteData struct {
|
||
}
|
||
|
||
type OpDeleteResp struct {
|
||
base.BaseResponse
|
||
Data *OpDeleteData `json:"data"`
|
||
}
|
||
|
||
// op 更新
|
||
type OpUpdateReq struct {
|
||
*dbstruct.Product
|
||
}
|
||
|
||
type OpUpdateData struct {
|
||
}
|
||
|
||
type OpUpdateResp struct {
|
||
base.BaseResponse
|
||
Data *OpUpdateData `json:"data"`
|
||
}
|
||
|
||
// op 列表
|
||
type OpListReq struct {
|
||
Mids []int64 `json:"mids"` // 用户id查询
|
||
Username string `json:"username"` // 用户昵称模糊查询
|
||
SortType string `json:"sort_type"` // 排序类型,见 OpListSortType*
|
||
Ascend bool `json:"ascend"` // true:升序,false:降序
|
||
Offset int `json:"offset"`
|
||
Limit int `json:"limit"`
|
||
}
|
||
|
||
const (
|
||
OpListSortTypeCt = "ct" // 时间
|
||
OpListSortTypePrice = "price" // 价格
|
||
OpListSortTypeScore = "score" // 评分
|
||
)
|
||
|
||
type OpListData struct {
|
||
List []*dbstruct.Product `json:"list"`
|
||
Offset int `json:"offset"`
|
||
More int `json:"more"`
|
||
}
|
||
|
||
type OpListResp struct {
|
||
base.BaseResponse
|
||
Data *OpUpdateData `json:"data"`
|
||
}
|