service/codecreate/template/proto_api.txt

67 lines
1.0 KiB
Plaintext
Raw Normal View History

2023-12-21 22:17:40 +08:00
package proto
import (
"service/api/base"
"service/dbstruct"
)
// op 创建
2024-12-06 13:16:00 +08:00
type ApiCreateReq struct {
2023-12-21 22:17:40 +08:00
base.BaseRequest
*dbstruct.#{EntityName}
}
2024-12-06 13:16:00 +08:00
type ApiCreateData struct {
2023-12-21 22:17:40 +08:00
}
2024-12-06 13:16:00 +08:00
type ApiCreateResp struct {
2023-12-21 22:17:40 +08:00
base.BaseResponse
2024-12-06 13:16:00 +08:00
Data *ApiCreateData `json:"data"`
2023-12-21 22:17:40 +08:00
}
// op 删除
2024-12-06 13:16:00 +08:00
type ApiDeleteReq struct {
2023-12-21 22:17:40 +08:00
base.BaseRequest
2024-12-06 15:07:23 +08:00
Id *int64 `json:"id"`
2023-12-21 22:17:40 +08:00
}
2024-12-06 13:16:00 +08:00
type ApiDeleteData struct {
2023-12-21 22:17:40 +08:00
}
2024-12-06 13:16:00 +08:00
type ApiDeleteResp struct {
2023-12-21 22:17:40 +08:00
base.BaseResponse
2024-12-06 13:16:00 +08:00
Data *ApiDeleteData `json:"data"`
2023-12-21 22:17:40 +08:00
}
// op 更新
2024-12-06 13:16:00 +08:00
type ApiUpdateReq struct {
2023-12-21 22:17:40 +08:00
base.BaseRequest
*dbstruct.#{EntityName}
}
2024-12-06 13:16:00 +08:00
type ApiUpdateData struct {
2023-12-21 22:17:40 +08:00
}
2024-12-06 13:16:00 +08:00
type ApiUpdateResp struct {
2023-12-21 22:17:40 +08:00
base.BaseResponse
2024-12-06 13:16:00 +08:00
Data *ApiUpdateData `json:"data"`
2023-12-21 22:17:40 +08:00
}
// op 列表
2024-12-06 13:16:00 +08:00
type ApiListReq struct {
2023-12-21 22:17:40 +08:00
base.BaseRequest
Offset int `json:"offset"`
Limit int `json:"limit"`
}
2024-12-06 13:16:00 +08:00
type ApiListData struct {
2023-12-21 22:17:40 +08:00
List []*dbstruct.#{EntityName} `json:"list"`
Offset int `json:"offset"`
More int `json:"more"`
}
2024-12-06 13:16:00 +08:00
type ApiListResp struct {
2023-12-21 22:17:40 +08:00
base.BaseResponse
2024-12-06 13:16:00 +08:00
Data *ApiListData `json:"data"`
2023-12-21 22:17:40 +08:00
}