service/codecreate/template/proto_api.txt

67 lines
1.0 KiB
Plaintext

package proto
import (
"service/api/base"
"service/dbstruct"
)
// op 创建
type ApiCreateReq struct {
base.BaseRequest
*dbstruct.#{EntityName}
}
type ApiCreateData struct {
}
type ApiCreateResp struct {
base.BaseResponse
Data *ApiCreateData `json:"data"`
}
// op 删除
type ApiDeleteReq struct {
base.BaseRequest
Id *int64 `json:"id"`
}
type ApiDeleteData struct {
}
type ApiDeleteResp struct {
base.BaseResponse
Data *ApiDeleteData `json:"data"`
}
// op 更新
type ApiUpdateReq struct {
base.BaseRequest
*dbstruct.#{EntityName}
}
type ApiUpdateData struct {
}
type ApiUpdateResp struct {
base.BaseResponse
Data *ApiUpdateData `json:"data"`
}
// op 列表
type ApiListReq struct {
base.BaseRequest
Offset int `json:"offset"`
Limit int `json:"limit"`
}
type ApiListData struct {
List []*dbstruct.#{EntityName} `json:"list"`
Offset int `json:"offset"`
More int `json:"more"`
}
type ApiListResp struct {
base.BaseResponse
Data *ApiListData `json:"data"`
}