service/api/proto/product/proto/product_op.go

73 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"`
}