package base import ( "server/common" "strconv" "github.com/liangdas/mqant/log" ) func GetUIDAndCurrency(s string) (uid int, ct common.CurrencyType) { uids := []rune{} cts := []rune{} for _, v := range s { if v < 48 || v > 57 { cts = append(cts, v) continue } uids = append(uids, v) } tmp := string(uids) number, err := strconv.Atoi(tmp) if err != nil { log.Error("err:%v", err) return } ct = common.GetCurrencyID(string(cts)) uid = number return }