正在显示
5 个修改的文件
包含
12 行增加
和
3 行删除
| @@ -26,6 +26,15 @@ func NewSearchTableDataLogic(ctx context.Context, svcCtx *svc.ServiceContext) *S | @@ -26,6 +26,15 @@ func NewSearchTableDataLogic(ctx context.Context, svcCtx *svc.ServiceContext) *S | ||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest) (resp interface{}, err error) { | 28 | func (l *SearchTableDataLogic) SearchTableData(req *types.SearchTableDataRequest) (resp interface{}, err error) { |
| 29 | + if req.ObjectId == 0 { | ||
| 30 | + resp = map[string]interface{}{ | ||
| 31 | + "objectId": 0, | ||
| 32 | + "fields": nil, | ||
| 33 | + "total": 0, | ||
| 34 | + "data": make([]string, 0), | ||
| 35 | + } | ||
| 36 | + return | ||
| 37 | + } | ||
| 29 | tableDataPreviewRequest := &bytelib.TableDataPreviewRequest{ | 38 | tableDataPreviewRequest := &bytelib.TableDataPreviewRequest{ |
| 30 | Token: req.Token, | 39 | Token: req.Token, |
| 31 | ObjectType: bytelib.ObjectMetaTable, | 40 | ObjectType: bytelib.ObjectMetaTable, |
| @@ -211,7 +211,7 @@ type GetTableDetailResponse struct { | @@ -211,7 +211,7 @@ type GetTableDetailResponse struct { | ||
| 211 | 211 | ||
| 212 | type SearchTableDataRequest struct { | 212 | type SearchTableDataRequest struct { |
| 213 | Token string `header:"x-mmm-accesstoken,optional"` | 213 | Token string `header:"x-mmm-accesstoken,optional"` |
| 214 | - ObjectId int `json:"objectId"` // 对象ID | 214 | + ObjectId int `json:"objectId,optional"` // 对象ID |
| 215 | PageNumber int `json:"page,optional"` // 分页数 | 215 | PageNumber int `json:"page,optional"` // 分页数 |
| 216 | PageSize int `json:"size,optional"` // 页码 | 216 | PageSize int `json:"size,optional"` // 页码 |
| 217 | Condition []*Condition `json:"conditions,optional"` // 条件 | 217 | Condition []*Condition `json:"conditions,optional"` // 条件 |
| @@ -80,7 +80,7 @@ type ( | @@ -80,7 +80,7 @@ type ( | ||
| 80 | 80 | ||
| 81 | SearchTableDataRequest struct{ | 81 | SearchTableDataRequest struct{ |
| 82 | Token string `header:"x-mmm-accesstoken,optional"` | 82 | Token string `header:"x-mmm-accesstoken,optional"` |
| 83 | - ObjectId int `json:"objectId"` // 对象ID | 83 | + ObjectId int `json:"objectId,optional"` // 对象ID |
| 84 | PageNumber int `json:"page,optional"` // 分页数 | 84 | PageNumber int `json:"page,optional"` // 分页数 |
| 85 | PageSize int `json:"size,optional"` // 页码 | 85 | PageSize int `json:"size,optional"` // 页码 |
| 86 | Condition []*Condition `json:"conditions,optional"` // 条件 | 86 | Condition []*Condition `json:"conditions,optional"` // 条件 |
go.sum
0 → 100644
此 diff 太大无法显示。
-
请 注册 或 登录 后发表评论