std_record

package
v0.0.36-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStdRecord

func ConvertStdRecord(record interface{}) (newRecord interface{})

func ConvertStdRecords

func ConvertStdRecords(records interface{}) interface{}

func ConvertStdRecordsFromMap

func ConvertStdRecordsFromMap(records map[int64]interface{}) map[int64]interface{}

func ConvertStdRecordsFromMapV3 added in v0.0.35

func ConvertStdRecordsFromMapV3(records map[string]interface{}) ([]interface{}, error)

Types

type IRecord

type IRecord interface {
	GetFieldValue(fieldAPIName string) (value interface{}, err error)    // 获取字段值
	DecodeFieldValue(fieldAPIName string, value interface{}) (err error) // 解析字段值
	DecodeRecordValue(value interface{}) (err error)                     // 解析记录值

	GetFieldValueInt64(fieldAPIName string) (value int64, err error)                       // 字段类型:浮点数(小数个数为0)
	GetFieldValueFloat64(fieldAPIName string) (value float64, err error)                   // 字段类型:浮点数
	GetFieldValueBool(fieldAPIName string) (value bool, err error)                         // 字段类型:布尔
	GetFieldValueString(fieldAPIName string) (value string, err error)                     // 字段类型:字符串
	GetFieldValueEmail(fieldAPIName string) (value string, err error)                      // 字段类型:邮箱
	GetFieldValueDate(fieldAPIName string) (value string, err error)                       // 字段类型:日期
	GetFieldValueDatetime(fieldAPIName string) (value int64, err error)                    // 字段类型:日期时间
	GetFieldValueOptionSingle(fieldAPIName string) (value string, err error)               // 字段类型:单值选项
	GetFieldValueOptionMulti(fieldAPIName string) (value []string, err error)              // 字段类型:多值选项
	GetFieldValueMultilingual(fieldAPIName string) (value faassdk.Multilingual, err error) // 字段类型:多语
	GetFieldValuePhoneNumber(fieldAPIName string) (value *faassdk.PhoneNumber, err error)  // 字段类型:电话号码
	GetFieldValueAvatar(fieldAPIName string) (value *faassdk.Avatar, err error)            // 字段类型:头像
	GetFieldValueAttachment(fieldAPIName string) (value []*faassdk.Attachment, err error)  // 字段类型:文件
	GetFieldValueRichText(fieldAPIName string) (value *faassdk.RichText, err error)        // 字段类型:富文本

	SetFieldValue(fieldAPIName string, value interface{})

	GetUnauthFields() []string // 获取无权限字段
}

type Record

type Record struct {
	Record       map[string]interface{} `json:"record"`
	UnauthFields []string               `json:"_unauthFields"`
}

func (*Record) DecodeFieldValue

func (r *Record) DecodeFieldValue(fieldAPIName string, value interface{}) (err error)

func (*Record) DecodeRecordValue

func (r *Record) DecodeRecordValue(value interface{}) (err error)

DecodeRecordValue 将 record 解码成指定结构

func (*Record) GetFieldValue

func (r *Record) GetFieldValue(fieldAPIName string) (value interface{}, err error)

func (*Record) GetFieldValueAttachment

func (r *Record) GetFieldValueAttachment(fieldAPIName string) (value []*faassdk.Attachment, err error)

func (*Record) GetFieldValueAvatar

func (r *Record) GetFieldValueAvatar(fieldAPIName string) (value *faassdk.Avatar, err error)

func (*Record) GetFieldValueBool

func (r *Record) GetFieldValueBool(fieldAPIName string) (value bool, err error)

func (*Record) GetFieldValueDate

func (r *Record) GetFieldValueDate(fieldAPIName string) (value string, err error)

func (*Record) GetFieldValueDatetime

func (r *Record) GetFieldValueDatetime(fieldAPIName string) (value int64, err error)

func (*Record) GetFieldValueEmail

func (r *Record) GetFieldValueEmail(fieldAPIName string) (value string, err error)

func (*Record) GetFieldValueFloat64

func (r *Record) GetFieldValueFloat64(fieldAPIName string) (value float64, err error)

func (*Record) GetFieldValueInt64

func (r *Record) GetFieldValueInt64(fieldAPIName string) (value int64, err error)

func (*Record) GetFieldValueMultilingual

func (r *Record) GetFieldValueMultilingual(fieldAPIName string) (value faassdk.Multilingual, err error)

func (*Record) GetFieldValueOptionMulti

func (r *Record) GetFieldValueOptionMulti(fieldAPIName string) (value []string, err error)

func (*Record) GetFieldValueOptionSingle

func (r *Record) GetFieldValueOptionSingle(fieldAPIName string) (value string, err error)

func (*Record) GetFieldValuePhoneNumber

func (r *Record) GetFieldValuePhoneNumber(fieldAPIName string) (value *faassdk.PhoneNumber, err error)

func (*Record) GetFieldValueRichText

func (r *Record) GetFieldValueRichText(fieldAPIName string) (value *faassdk.RichText, err error)

func (*Record) GetFieldValueString

func (r *Record) GetFieldValueString(fieldAPIName string) (value string, err error)

func (*Record) GetUnauthFields

func (r *Record) GetUnauthFields() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL