fix: adjustment directory structure
This commit is contained in:
30
proxy/Nredis/holiday.go
Normal file
30
proxy/Nredis/holiday.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package Nredis
|
||||
|
||||
import (
|
||||
l4g "proxy/logger"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func SetHdId2TariffId(id int, tariffId int) bool {
|
||||
err := rdb.Set(ctx, "HdId:"+strconv.Itoa(id), strconv.Itoa(tariffId), 0).Err()
|
||||
if err != nil {
|
||||
l4g.RedisLog.Errorf("Set HdId:%d %s, err: %v", id, strconv.Itoa(tariffId), err)
|
||||
return false
|
||||
} else {
|
||||
l4g.RedisLog.Infof("Set HdId:%d %s", id, tariffId)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
func GetTariffIdByHdId(id int) string {
|
||||
var tariffIdStr string
|
||||
var err error
|
||||
tariffIdStr, err = rdb.Get(ctx, "HdId:"+strconv.Itoa(id)).Result()
|
||||
if err != nil {
|
||||
return ""
|
||||
} else {
|
||||
return tariffIdStr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user