-
Notifications
You must be signed in to change notification settings - Fork 2
/
result.go
72 lines (57 loc) · 1.82 KB
/
result.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package driver
import (
"github.com/luw2007/bitable-mysql-driver/internal/lark"
)
// Person a field value for person.
type Person lark.FieldPerson
// Attachment a field value for attachment.
type Attachment lark.FieldAttachment
// URL a field value for link.
type URL lark.FieldURL
type RecordUrl URL
type RecordPersons []Person
type RecordAttachments []Attachment
type RecordOptions []string
// AppMeta a App meta.
type AppMeta lark.AppMeta
// Table a table meta.
type Table lark.Table
// Record a record meta.
type Record lark.Record
// View a view meta.
type View lark.View
// Field a field info
type Field struct {
FieldID string `json:"field_id,omitempty"`
FieldName string `json:"field_name,omitempty"`
Type int64 `json:"type,omitempty"`
Property *FieldProperty `json:"property,omitempty"`
}
// FieldProperty a field property. Different types have different values.
type FieldProperty struct {
Options []*FieldOption `json:"options,omitempty"`
Formatter string `json:"formatter,omitempty"`
DateFormat string `json:"date_format,omitempty"`
TimeFormat string `json:"time_format,omitempty"`
AutoFill bool `json:"auto_fill,omitempty"`
Multiple bool `json:"multiple,omitempty"`
TableId string `json:"table_id,omitempty"`
ViewId string `json:"view_id,omitempty"`
Fields []string `json:"fields,omitempty"`
}
// FieldOption when field.Type can be select.
type FieldOption struct {
Name string `json:"name,omitempty"`
Id string `json:"id,omitempty"`
}
type bitableResult struct {
lastInsertID int64
rowsAffected int64
err error
}
func (b bitableResult) LastInsertId() (int64, error) {
return b.lastInsertID, b.err
}
func (b bitableResult) RowsAffected() (int64, error) {
return b.rowsAffected, b.err
}