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)
}