redis.go
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package protocol
import (
"fmt"
"github.com/astaxie/beego"
)
//redis 键值
const (
SmsCode = "sms_code"
SmsLoginCode = "sms_login_code"
SmsChangeMobile = "sms_change_mobile"
H5AnnouncementSubmit = "h5_announcement_submit"
ChanceApprove = "chance_approve"
ChanceUpdate = "chance_update"
ChanceDelete = "chance_delete"
HashUuid = "hash_uuid" //接口uuid
)
type SmsInfo struct {
Code string `json:"code"`
Count int `json:"count"`
ErrorCount int `json:"error_count"`
LastTime int64 `json:"last_time"`
CreateTime int64 `json:"create_time"`
Checked int `json:"checked"` //0:未校验证 1:已校验
}
//redis键值
func RedisKey(businessKey string) string {
//项目:环境:业务码
return fmt.Sprintf("%v:%v:%v", "opp", beego.BConfig.RunMode, businessKey)
}
//redis键值 项标识
func RedisKeyWithId(businessKey string, id int64) string {
//项目:环境:业务码
return fmt.Sprintf("%v:%v:%v:%v", "opp", beego.BConfig.RunMode, businessKey, id)
}