@@ -25,7 +25,7 @@ import (
25
25
26
26
const (
27
27
NAME = "go-kintone"
28
- VERSION = "0.4.2 "
28
+ VERSION = "0.6.0 "
29
29
DEFAULT_TIMEOUT = time .Second * 600 // Default value for App.Timeout
30
30
)
31
31
@@ -982,49 +982,51 @@ func (app *App) DeleteComment(recordId uint64, commentId uint64) error {
982
982
983
983
// FieldInfo is the meta data structure of a field.
984
984
type FieldInfo struct {
985
- Label string `json:"label"` // Label string
986
- Code string `json:"code"` // Unique field code
987
- Type string `json:"type"` // Field type. One of FT_* constant.
988
- NoLabel bool `json:"noLabel"` // true to hide the label
989
- Required bool `json:"required"` // true if this field must be filled
990
- Unique bool `json:"unique"` // true if field values must be unique
991
- MaxValue interface {} `json:"maxValue"` // nil or numeric string
992
- MinValue interface {} `json:"minValue"` // nil or numeric string
993
- MaxLength interface {} `json:"maxLength"` // nil or numeric string
994
- MinLength interface {} `json:"minLength"` // nil or numeric string
995
- Default interface {} `json:"defaultValue"` // anything
996
- DefaultTime interface {} `json:"defaultExpression"` // nil or "NOW"
997
- Options []string `json:"options"` // list of selectable values
998
- Expression string `json:"expression"` // to calculate values
999
- Separator bool `json:"digit"` // true to use thousand separator
1000
- Medium string `json:"protocol"` // "WEB", "CALL", or "MAIL"
1001
- Format string `json:"format"` // "NUMBER", "NUMBER_DIGIT", "DATETIME", "DATE", "TIME", "HOUR_MINUTE", "DAY_HOUR_MINUTE"
1002
- Fields []FieldInfo `json:"fields"` // Field list of this subtable
1003
- Index int `json:"index"`
985
+ Label string `json:"label"` // Label string
986
+ Code string `json:"code"` // Unique field code
987
+ Type string `json:"type"` // Field type. One of FT_* constant.
988
+ NoLabel bool `json:"noLabel"` // true to hide the label
989
+ Required bool `json:"required"` // true if this field must be filled
990
+ Unique bool `json:"unique"` // true if field values must be unique
991
+ MaxValue interface {} `json:"maxValue"` // nil or numeric string
992
+ MinValue interface {} `json:"minValue"` // nil or numeric string
993
+ MaxLength interface {} `json:"maxLength"` // nil or numeric string
994
+ MinLength interface {} `json:"minLength"` // nil or numeric string
995
+ Default interface {} `json:"defaultValue"` // anything
996
+ DefaultTime interface {} `json:"defaultExpression"` // nil or "NOW"
997
+ Options []string `json:"options"` // list of selectable values
998
+ Expression string `json:"expression"` // to calculate values
999
+ Separator bool `json:"digit"` // true to use thousand separator
1000
+ Medium string `json:"protocol"` // "WEB", "CALL", or "MAIL"
1001
+ Format string `json:"format"` // "NUMBER", "NUMBER_DIGIT", "DATETIME", "DATE", "TIME", "HOUR_MINUTE", "DAY_HOUR_MINUTE"
1002
+ Fields []FieldInfo `json:"fields"` // Field list of this subtable
1003
+ Index int `json:"index"`
1004
+ Lookup * map [string ]interface {} `json:"lookup,omitempty"` // lookup
1004
1005
}
1005
1006
1006
1007
// Work around code to handle "true"/"false" strings as booleans...
1007
1008
func (fi * FieldInfo ) UnmarshalJSON (data []byte ) error {
1008
1009
var t struct {
1009
- Label string `json:"label"`
1010
- Code string `json:"code"`
1011
- Type string `json:"type"`
1012
- NoLabel string `json:"noLabel"`
1013
- Required string `json:"required"`
1014
- Unique string `json:"unique"`
1015
- MaxValue interface {} `json:"maxValue"`
1016
- MinValue interface {} `json:"minValue"`
1017
- MaxLength interface {} `json:"maxLength"`
1018
- MinLength interface {} `json:"minLength"`
1019
- Default interface {} `json:"defaultValue"`
1020
- DefaultTime interface {} `json:"defaultExpression"`
1021
- Options []string `json:"options"`
1022
- Expression string `json:"expression"`
1023
- Separator string `json:"digit"`
1024
- Medium string `json:"protocol"`
1025
- Format string `json:"format"`
1026
- Fields []FieldInfo `json:"fields"`
1027
- Index int `json:"index"`
1010
+ Label string `json:"label"`
1011
+ Code string `json:"code"`
1012
+ Type string `json:"type"`
1013
+ NoLabel string `json:"noLabel"`
1014
+ Required string `json:"required"`
1015
+ Unique string `json:"unique"`
1016
+ MaxValue interface {} `json:"maxValue"`
1017
+ MinValue interface {} `json:"minValue"`
1018
+ MaxLength interface {} `json:"maxLength"`
1019
+ MinLength interface {} `json:"minLength"`
1020
+ Default interface {} `json:"defaultValue"`
1021
+ DefaultTime interface {} `json:"defaultExpression"`
1022
+ Options []string `json:"options"`
1023
+ Expression string `json:"expression"`
1024
+ Separator string `json:"digit"`
1025
+ Medium string `json:"protocol"`
1026
+ Format string `json:"format"`
1027
+ Fields []FieldInfo `json:"fields"`
1028
+ Index int `json:"index"`
1029
+ Lookup * map [string ]interface {} `json:"lookup,omitempty"`
1028
1030
}
1029
1031
err := json .Unmarshal (data , & t )
1030
1032
if err != nil {
@@ -1038,7 +1040,7 @@ func (fi *FieldInfo) UnmarshalJSON(data []byte) error {
1038
1040
t .MaxValue , t .MinValue , t .MaxLength , t .MinLength ,
1039
1041
t .Default , t .DefaultTime , t .Options , t .Expression ,
1040
1042
(t .Separator == "true" ),
1041
- t .Medium , t .Format , t .Fields , t .Index ,
1043
+ t .Medium , t .Format , t .Fields , t .Index , t . Lookup ,
1042
1044
}
1043
1045
return nil
1044
1046
}
@@ -1098,6 +1100,9 @@ func decodeFieldInfo(t AppFormFields, ret map[string]*FieldInfo) {
1098
1100
sb = append (sb , * ret [z ])
1099
1101
}
1100
1102
fi .Fields = sb
1103
+ case "lookup" :
1104
+ result , _ := (w ).(map [string ]interface {})
1105
+ fi .Lookup = & result
1101
1106
default :
1102
1107
break
1103
1108
}
0 commit comments