Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package income
import (
"context"
)
// Blacklist map[ctype]map[int64]bool
func (s *Service) Blacklist(c context.Context, limit int64) (m map[int]map[int64]bool, err error) {
var id int64
m = make(map[int]map[int64]bool)
for {
var ab map[int][]int64
ab, id, err = s.dao.Blacklist(c, id, limit)
if err != nil {
return
}
if len(ab) == 0 {
break
}
for ctype, avIDs := range ab {
for _, avID := range avIDs {
if _, ok := m[ctype]; ok {
m[ctype][avID] = true
} else {
m[ctype] = map[int64]bool{
avID: true,
}
}
}
}
}
return
}