SetDataMap 设置 Data 字段(JSON 序列化)
(v map[string]interface{})
| 26 | |
| 27 | // SetDataMap 设置 Data 字段(JSON 序列化) |
| 28 | func (m *MessageProcessStep) SetDataMap(v map[string]interface{}) error { |
| 29 | if len(v) == 0 { |
| 30 | m.Data = "" |
| 31 | return nil |
| 32 | } |
| 33 | b, err := json.Marshal(v) |
| 34 | if err != nil { |
| 35 | return err |
| 36 | } |
| 37 | m.Data = string(b) |
| 38 | return nil |
| 39 | } |
| 40 | |
| 41 | // GetDataMap 读取 Data 字段(JSON 反序列化) |
| 42 | func (m *MessageProcessStep) GetDataMap() (map[string]interface{}, error) { |
no outgoing calls
no test coverage detected