You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
596 B
29 lines
596 B
package member |
|
|
|
import ( |
|
"context" |
|
"fmt" |
|
) |
|
|
|
func notifyKey(mid int64) string { |
|
return fmt.Sprintf("AccountInterface-AccountNotify-T%d", mid) |
|
} |
|
|
|
// NotifyInfo notify info. |
|
type NotifyInfo struct { |
|
Uname string `json:"uname"` |
|
Mid int64 `json:"mid"` |
|
Type string `json:"type"` |
|
NewName string `json:"newName"` |
|
Action string `json:"action"` |
|
} |
|
|
|
// NotityPurgeCache is |
|
func (s *Service) NotityPurgeCache(ctx context.Context, mid int64, action string) error { |
|
msg := &NotifyInfo{ |
|
Mid: mid, |
|
Action: action, |
|
} |
|
key := notifyKey(mid) |
|
return s.accountNotify.Send(ctx, key, msg) |
|
}
|
|
|