|
@@ -82,11 +82,18 @@ func (logic *ByteNoticeLogic) handleNotice(conn transaction.Conn, notice *domain |
|
@@ -82,11 +82,18 @@ func (logic *ByteNoticeLogic) handleNotice(conn transaction.Conn, notice *domain |
82
|
if err != nil {
|
82
|
if err != nil {
|
83
|
return err
|
83
|
return err
|
84
|
}
|
84
|
}
|
85
|
- tableInfo, err := logic.svcCtx.ByteMetadataService.TableInfo(logic.ctx, &bytelib.TableInfoRequest{
|
|
|
86
|
- Token: accessToken,
|
|
|
87
|
- TableId: notice.TableId,
|
85
|
+ tablePreview, err := logic.svcCtx.ByteMetadataService.TableDataPreview(logic.ctx, &bytelib.TableDataPreviewRequest{
|
|
|
86
|
+ Token: accessToken,
|
|
|
87
|
+ ObjectId: int64(notice.TableId),
|
|
|
88
|
+ ObjectType: bytelib.ObjectMetaTable,
|
|
|
89
|
+ Where: &bytelib.TableQueryWhere{
|
|
|
90
|
+ PageNumber: 1,
|
|
|
91
|
+ PageSize: 1,
|
|
|
92
|
+ },
|
|
|
93
|
+ UseCache: false,
|
|
|
94
|
+ HiddenData: false,
|
88
|
})
|
95
|
})
|
89
|
- if err != nil {
|
96
|
+ if err != nil || tablePreview.ObjectId <= 0 {
|
90
|
return nil
|
97
|
return nil
|
91
|
}
|
98
|
}
|
92
|
if len(list.List) > 0 {
|
99
|
if len(list.List) > 0 {
|
|
@@ -113,9 +120,9 @@ func (logic *ByteNoticeLogic) handleNotice(conn transaction.Conn, notice *domain |
|
@@ -113,9 +120,9 @@ func (logic *ByteNoticeLogic) handleNotice(conn transaction.Conn, notice *domain |
113
|
}
|
120
|
}
|
114
|
//保存字段
|
121
|
//保存字段
|
115
|
_, err = logic.saveFields(conn, &domain.ObjectField{
|
122
|
_, err = logic.saveFields(conn, &domain.ObjectField{
|
116
|
- Id: int64(tableInfo.TableId),
|
|
|
117
|
- Name: tableInfo.Name,
|
|
|
118
|
- Fields: tableInfo.Fields,
|
123
|
+ Id: tablePreview.ObjectId,
|
|
|
124
|
+ Name: tablePreview.Name,
|
|
|
125
|
+ Fields: tablePreview.Fields,
|
119
|
})
|
126
|
})
|
120
|
if err != nil {
|
127
|
if err != nil {
|
121
|
return err
|
128
|
return err
|