constants

package
v0.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ActionTypeEditPhone 修改手机号
	ActionTypeEditPhone = "EDIT_PHONE"
	// ActionTypeWithdraw 提现
	ActionTypeWithdraw = "WITHDRAW"
	// ActionTypeLogin 登录
	ActionTypeLogin = "LOGIN"
	// ActionTypeMergeAccount 合并账号
	ActionTypeMergeAccount = "MERGE_ACCOUNT"
	// ActionTypeRegister 注册
	ActionTypeRegister = "REGISTER"
	// ActionTypeBalanceChange 余额变更
	ActionTypeBalanceChange = "BALANCE_CHANGE"
)

定义常量来表示 StatusCodes 的键

View Source
const (
	// StatusSuccess 操作成功
	StatusSuccess = "Success"
	// StatusError 操作失败
	StatusError = "Error"
	// StatusSnBlank SN不正确
	StatusSnBlank = "SnBlank"
	// StatusCodeInvalid Code不正确
	StatusCodeInvalid = "CodeInvalid"
	// StatusAppIdInvalid AppID 不正确
	StatusAppIdInvalid = "AppIdInvalid"
	// StatusDeviceInfoErr 设备信息错误
	StatusDeviceInfoErr = "DeviceInfoError"
	// StatusOpenIdInvalid OpenID 不正确
	StatusOpenIdInvalid = "OpenIdInvalid"
	// StatusPhoneInvalid 手机号不正确
	StatusPhoneInvalid = "PhoneInvalid"
	// StatusUuIDInvalid UUID不正确
	StatusUuIDInvalid = "UuidInvalid"
	// StatusSignNameInvalid 签名不正确
	StatusSignNameInvalid = "SignNameInvalid"
	// StatusAccessKeyInvalid AccessKey 不正确
	StatusAccessKeyInvalid = "AccessKey"
	// StatusAccessSecretInvalid AccessSecret 不正确
	StatusAccessSecretInvalid = "AccessSecret"
	// StatusSmsCodeInvalid 短信验证码不正确
	StatusSmsCodeInvalid = "SmsCodeInvalid"
	// StatusPhoneMergeConflictInvalid 手机号合并冲突
	StatusPhoneMergeConflictInvalid = "PhoneMergeConflictInvalid"
	// StatusErrPendingDataInvalid 有处理中数据,暂时无法合并
	StatusErrPendingDataInvalid = "ErrPendingData"
	StatusDataConflict          = "DataConflict"
)

定义常量来表示 StatusCodes 的键

View Source
const (
	// SmsRedisSendMessage 短信发送Key
	SmsRedisSendMessage = "SMS_Redis_SEND_MESSAGE:"
)

Variables

View Source
var ActionTypeCodes = map[string]ActionTypeMessage{
	"EDIT_PHONE": {
		Des:     "用户ID %d 修改手机号,原手机号 %s,修改为 %s",
		Message: "修改手机号",
	},
	"WITHDRAW": {
		Des:     "用户ID %d 发起了提现请求,提现金额为 %s",
		Message: "用户提现",
	},
	"LOGIN": {
		Des:     "用户ID %d 成功登录,登录时间为 %s",
		Message: "用户登录",
	},
	"MERGE_ACCOUNT": {
		Des:     "用户ID %d 发起合并账户,被合并账户ID %d,合并后账户ID %d",
		Message: "用户合并账户",
	},
	"REGISTER": {
		Des:     "用户ID %d 完成了注册,注册时使用的手机号是 %s",
		Message: "用户注册",
	},
	"BALANCE_CHANGE": {
		Des:     "用户ID %d 原余额:%.2f,变更金额是: %.2f, 变更后余额:%.2f",
		Message: "用户余额变更",
	},
}

ActionTypeCodes 定义状态和提示信息

View Source
var SmsType = map[string]StatusMessage{
	"Success": {
		Code:    1,
		Message: "操作成功",
	},
	"Error": {
		Code:    0,
		Message: "操作失败",
	},
}

SmsType 定义短信类型

View Source
var StatusCodes = map[string]StatusMessage{
	"Success": {
		Code:    1,
		Message: "操作成功",
	},
	"Error": {
		Code:    0,
		Message: "操作失败",
	},
	"SnBlank": {
		Code:    0,
		Message: "sn 不能为空",
	},
	"CodeInvalid": {
		Code:    0,
		Message: "Code无效的代码",
	},
	"AppIdInvalid": {
		Code:    0,
		Message: "无效的 AppId",
	},
	"DeviceInfoError": {
		Code:    0,
		Message: "设备暂未开通",
	},
	"OpenIdInvalid": {
		Code:    0,
		Message: "无效的 OpenId",
	},
	"UuiDInvalid": {
		Code:    0,
		Message: "无效的 UuId",
	},
	"SignNameInvalid": {
		Code:    0,
		Message: "无效的 SignName",
	},
	"SmsCodeInvalid": {
		Code:    0,
		Message: "无效的 SmsCode",
	},
	"PhoneMergeConflictInvalid": {
		Code:    0,
		Message: "合并手机号不能是当前手机号",
	},
	"ErrPendingData": {
		Code:    0,
		Message: "当前有正在处理的数据,暂时无法合并,请稍后再试",
	},
	"DataConflict": {
		Code:    0,
		Message: "系统存在冲突数据请仔细检查,或联系管理员",
	},
}

StatusCodes 定义状态和提示信息

Functions

func GetSmsKey added in v0.0.15

func GetSmsKey(smsKey, phone string) string

GetSmsKey 返回缓存值数据

Types

type ActionTypeMessage added in v0.0.17

type ActionTypeMessage struct {
	Des     string
	Message string
}

ActionTypeMessage 操作动作类型信息

type StatusMessage

type StatusMessage struct {
	Code    int32
	Message string
}

StatusMessage 状态和提示信息的结构体

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL