package common const ( // success Success = 200 // parameters invalid InvalidParametes = 1001 // 记录创建失败 DbInsertErr = 1011 // 记录更新失败 DbUpdateErr = 1012 // 记录删除失败 DbDeleteErr = 1013 // 记录查询失败 DbRecordNotFound = 1014 // 系统用户不存在 SystemHasNoUser = 1022 // 手机号码重复 MobileRepeat = 1023 // 手机号无效或密码错误 MobileInvalidPwdError = 1024 // 无效的验证码 SmsCodeInvalid = 1025 // 验证码已失效 SmsCodeExpired = 1026 // 手机号码格式有误 MobileFormatError = 1027 // 无效的文件内容 InvalidFileContent = 1031 // 文件大小超出最大限制 FileSizeOverLimit = 1032 // 文件保存失败 FileSaveFailed = 1033 ) const ( QueryStateSuccess = 0 // 从myssql中查询到了记录 QueryStateNone = 2 // 未查询到任何记录 ) const ( // sms expire seconds SmsExpiredSeconds = 600 // default gender GenderUnknow = 0 ) const ( SmsTypeRegister = 1 // 注册 SmsTypeGetback = 2 // 找回密码 SmsTypeBindMobile = 3 // 绑定手机号 SmsTypeQuickLogin = 4 // 快捷登录 ) const ( LoginTypeMobile = 1 // 手机号登录 LoginTypeQuick = 2 // 快捷登录 LoginTypeThirdParty = 3 // 第三方登录 ) const ( BindTypeWechat = 10 // 绑定微信 BindTypeQQ = 11 // 绑定QQ BindTypeWeibo = 12 // 绑定微博 ) // 微信第三方登录必备 const ( WxAppId = "wx88fe165b2e4236b6" WxAppSecret = "647520760882a91fe2754cffded4b1f5" ) /// 阿里短信配置 const ( RegionId = "cn-hangzhou" AccessKeyId = "LTAI4GEM9Zz2Tsvb8nicmwXV" AccessSecret = "kNVHucWT57Wl7PP1ds2QCxilTSjaY0" SignName = "荔枝悦动" ) /// 腾讯云短信配置 const ( SdkAppId = "1400081008" SdkAppKey = "83427541ad50e54450725d789cf396eb" SdkSmsUrl = "https://yun.tim.qq.com/v5/tlssmssvr/sendsms" SdkTemplId = 105107 ) /// 阿里云短信模板定义 const ( TemplateCodeRegister = "SMS_193055376" TemplateCodeFindPwd = "SMS_193055375" TemplateCodeBindMobile = "SMS_196618124" TemplateCodeLogin = "SMS_193055378" ) var SmsTemplateCodeMap = map[int]string{ SmsTypeRegister: TemplateCodeRegister, SmsTypeGetback: TemplateCodeFindPwd, SmsTypeBindMobile: TemplateCodeBindMobile, SmsTypeQuickLogin: TemplateCodeLogin, } const SmsValidSeconds = 60