增加包装的IsSame方法

This commit is contained in:
白茶清欢 2024-03-11 11:18:25 +08:00
parent 65107176f4
commit 1e1db09499
1 changed files with 16 additions and 0 deletions

View File

@ -50,3 +50,19 @@ func (d *diff) CompareSingle(field string, input wrapper.Map, storage wrapper.Ma
return define.DefaultDiffFunc(field, input, storage, option)
}
}
// IsSame 判断连个数据是否一致
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 11:16 2024/3/11
func (d *diff) IsSame(fieldList []string, input wrapper.Map, storage wrapper.Map, option *define.DiffOption) bool {
res := d.Compare(fieldList, input, storage, option)
for _, item := range res {
if item.IsSame {
continue
}
return false
}
return true
}