Mapper map and set value from struct fromObj to toObj not support auto register struct
(fromObj, toObj interface{})
| 36 | // Mapper map and set value from struct fromObj to toObj |
| 37 | // not support auto register struct |
| 38 | func (dm *mapperObject) Mapper(fromObj, toObj interface{}) error { |
| 39 | fromElem := reflect.ValueOf(fromObj).Elem() |
| 40 | toElem := reflect.ValueOf(toObj).Elem() |
| 41 | if fromElem == dm.ZeroValue { |
| 42 | return errors.New("from obj is not legal value") |
| 43 | } |
| 44 | if toElem == dm.ZeroValue { |
| 45 | return errors.New("to obj is not legal value") |
| 46 | } |
| 47 | return dm.elemMapper(fromElem, toElem) |
| 48 | } |
| 49 | |
| 50 | // AutoMapper mapper and set value from struct fromObj to toObj |
| 51 | // support auto register struct |