1234567891011121314151617181920212223242526272829303132333435 |
- package definition
- type Info struct {
- FieldType string `json:"fieldType"`
- FieldName string `json:"fieldName"`
- FieldCNName string `json:"fieldCNName"`
- Operators []Operator `json:"operators"`
- }
- func formInfo(e *Entity) Info {
- if e == nil {
- return Info{}
- }
- return Info{
- FieldType: e.FieldType,
- FieldName: e.FieldName,
- FieldCNName: e.FieldCNName,
- Operators: e.Operators,
- }
- }
- func formInfoBatch(es []Entity) []Info {
- infos := make([]Info, 0)
- if es == nil || len(es) == 0 {
- return infos
- }
- for _, e := range es {
- infos = append(infos, formInfo(&e))
- }
- return infos
- }
|