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.
19 lines
417 B
19 lines
417 B
package service |
|
|
|
import ( |
|
"context" |
|
"encoding/json" |
|
|
|
"go-common/app/job/live-userexp/model" |
|
"go-common/library/log" |
|
) |
|
|
|
func (s *Service) levelCacheUpdate(nwMsg []byte, oldMsg []byte) { |
|
exp := &model.Exp{} |
|
if err := json.Unmarshal(nwMsg, exp); err != nil { |
|
log.Error("json.Unmarshal(%s) error(%v)", string(nwMsg), err) |
|
return |
|
} |
|
level := model.FormatLevel(exp) |
|
s.dao.SetLevelCache(context.TODO(), level) |
|
}
|
|
|