feat: support rest data return channel result
This commit is contained in:
@@ -200,3 +200,14 @@ func (r *UDMAuthUser) ParseCommandParams(item model.UDMAuthUser) string {
|
||||
}
|
||||
return strings.Join(conditions, ",")
|
||||
}
|
||||
|
||||
// ResetDataWithResult 重置鉴权用户数据,清空数据库重新同步Redis数据
|
||||
// 通过 channel 返回 ClearAndInsert 的执行结果
|
||||
func (r *UDMAuthUser) ResetDataWithResult(neId string) chan int64 {
|
||||
arr := r.dataByRedis("*", neId)
|
||||
resultCh := make(chan int64, 1)
|
||||
go func() {
|
||||
resultCh <- r.udmAuthRepository.ClearAndInsert(neId, arr)
|
||||
}()
|
||||
return resultCh
|
||||
}
|
||||
|
||||
@@ -362,3 +362,14 @@ func (r *UDMSubUser) ParseCommandParams(item model.UDMSubUser) string {
|
||||
conditions = append(conditions, fmt.Sprintf("cag=%s", item.Cag))
|
||||
return strings.Join(conditions, ",")
|
||||
}
|
||||
|
||||
// ResetDataWithResult 重置鉴权用户数据,清空数据库重新同步Redis数据
|
||||
// 通过 channel 返回 ClearAndInsert 的执行结果
|
||||
func (r *UDMSubUser) ResetDataWithResult(neId string) chan int64 {
|
||||
arr := r.dataByRedis("*", neId)
|
||||
resultCh := make(chan int64, 1)
|
||||
go func() {
|
||||
resultCh <- r.udmSubRepository.ClearAndInsert(neId, arr)
|
||||
}()
|
||||
return resultCh
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user