Documentation
¶
Overview ¶
**************************************************
** @Desc : This file for AES/ECB/PKCS5Padding ** @Time : 2019.04.09 16:25 ** @Author : Joker ** @File : aes_ecb_v1 ** @Last Modified by : Joker ** @Last Modified time: 2019.04.09 16:25 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for 加密、解密方法 ** @Time : 2018.12.28 14:10 ** @Author : Joker ** @File : encryption ** @Last Modified by : Joker ** @Last Modified time: 2019-4-8 09:54:58 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for 共有方法 ** @Time : 2019.04.01 11:48 ** @Author : Joker ** @File : global_method ** @Last Modified by : Joker ** @Last Modified time: 2019.04.01 11:48 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for 发送短信验证码 ** @Time : 2019.04.04 9:37 ** @Author : Joker ** @File : send_messages ** @Last Modified by : Joker ** @Last Modified time: 2019.04.04 9:37 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for 字符串常量 ** @Time : 2019.04.01 11:45 ** @Author : Joker ** @File : strings ** @Last Modified by : Joker ** @Last Modified time: 2019.04.01 11:45 ** @Software: GoLand
***************************************************
**************************************************
** @Desc : This file for ... ** @Time : 2019.04.03 18:01 ** @Author : Joker ** @File : template ** @Last Modified by : Joker ** @Last Modified time: 2019.04.03 18:01 ** @Software: GoLand
***************************************************
Index ¶
- Constants
- func GetApiOrderStatus() map[string]string
- func GetChannelType() map[string]string
- func GetOrderStatus() map[string]string
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- type AES
- func (the *AES) AesDecrypt(crypted, key []byte) ([]byte, error)
- func (the *AES) AesDecryptV2(crypted, key []byte) ([]byte, error)
- func (the *AES) AesEncrypt(src, key string) (string, error)
- func (the *AES) AesEncryptV2(src, key string) (string, error)
- func (*AES) PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func (*AES) PKCS5UnPadding(origData []byte) []byte
- type Encrypt
- func (*Encrypt) Base64Decode(raw string) ([]byte, error)
- func (*Encrypt) Base64Encode(raw []byte) string
- func (*Encrypt) EncodeMd5(buf []byte) string
- func (*Encrypt) RsaDecrypto(keyText, privateKey []byte) ([]byte, error)
- func (*Encrypt) RsaEncrypto(origData, publicKey []byte) ([]byte, error)
- func (*Encrypt) SHA256WithRSAToSign(originalData, privateKey []byte) ([]byte, error)
- type GlobalMethod
- func (*GlobalMethod) GbkToUtf8(s []byte) ([]byte, error)
- func (*GlobalMethod) GetDatabaseStatus(code int) map[string]interface{}
- func (*GlobalMethod) GetNowTime() string
- func (*GlobalMethod) GetNowTimeV2() string
- func (*GlobalMethod) GetNowTimeV3() string
- func (*GlobalMethod) JsonFormat(code int, data interface{}, msg string, url string) (json map[string]interface{})
- func (*GlobalMethod) LoginPasswordSolt(pwd, salt string) string
- func (*GlobalMethod) MoneyFenToYuan(fen string) (float64, bool)
- func (*GlobalMethod) MoneyYuanToFen(yuan float64) (string, bool)
- func (*GlobalMethod) MoneyYuanToFloat(yuan string) (float64, error)
- func (*GlobalMethod) MoneyYuanToString(yuan float64) string
- func (this *GlobalMethod) PasswordSolt(pwd string) (string, string)
- func (*GlobalMethod) RandIpAddr() (ip string)
- func (*GlobalMethod) RandomIntOfString(length int) string
- func (*GlobalMethod) RandomString(length int) string
- func (*GlobalMethod) StructToMap(s interface{}) map[string]string
- func (*GlobalMethod) ToStringByMap(m map[string]string) (s string)
- func (*GlobalMethod) UrlEncode(m map[string]string) string
- type SendMessages
- type Template
Constants ¶
const ( APIKEY = "fd264aa****" TPL1 = 2512750 URLSENDSMS = "https://sms.yunpian.com/v2/sms/tpl_single_send.json" )
短信配置
const ( TPL2 = 2453286 MOBILE = "18670135299" )
提现成功接收短信通知
const ( FAILED_FLAG = -9 FAILED_STRING = "操作失败! " SUCCESS_FLAG = 9 SUCCESS_STRING = "操作成功! " )
成功与否的标记
const ( STARTKEY = "\n-----BEGIN PUBLIC KEY-----\n" ENDKEY = "\n-----END PUBLIC KEY-----" )
秘钥头尾
const ( I = "I" S = "S" F = "F" )
订单状态
const ( A = "a" //对接 P = "p" //平台 )
订单类别
const ( SingleMaxForPay = 45000 SingleMaxForTransfer = 20000 SingleMinForRecharge = 20 )
const UPASSWORD = "tcp@143258"
用户登录默认密码
const (
XF = "XF"
)
通道类型
Variables ¶
This section is empty.
Functions ¶
func GetApiOrderStatus ¶
func GetChannelType ¶
func GetOrderStatus ¶
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.
Types ¶
type Encrypt ¶
type Encrypt struct{}
func (*Encrypt) RsaDecrypto ¶
RSA解密
func (*Encrypt) RsaEncrypto ¶
RSA加密
type GlobalMethod ¶
type GlobalMethod struct{}
func (*GlobalMethod) GbkToUtf8 ¶
func (*GlobalMethod) GbkToUtf8(s []byte) ([]byte, error)
gbk转为utf-8
func (*GlobalMethod) GetDatabaseStatus ¶
func (*GlobalMethod) GetDatabaseStatus(code int) map[string]interface{}
返回当前操作数据库的状态:成功/失败
func (*GlobalMethod) GetNowTime ¶
func (*GlobalMethod) GetNowTime() string
返回当前时间的字符串:2006-01-02 15:04:05
func (*GlobalMethod) GetNowTimeV2 ¶
func (*GlobalMethod) GetNowTimeV2() string
返回当前时间的字符串:20060102150405
func (*GlobalMethod) GetNowTimeV3 ¶
func (*GlobalMethod) GetNowTimeV3() string
返回当前时间的字符串:2006-01-02
func (*GlobalMethod) JsonFormat ¶
func (*GlobalMethod) JsonFormat(code int, data interface{}, msg string, url string) (json map[string]interface{})
* * @Description: 返回当前操作数据库的状态 * @Author: Joker * @Date: 2019.04.01 14:37 * @Param: code: 状态码,msg; 状态信息:url: 跳转地址; data: json内容 * @return: 返回Json串 *
func (*GlobalMethod) LoginPasswordSolt ¶
func (*GlobalMethod) LoginPasswordSolt(pwd, salt string) string
* * @Description: 登录密码加盐 * @Author: Joker * @Date: 2019.04.01 11:49 * @Param: pwd: 原始密码 * @Param: salt: 盐值 * @return: hash *
func (*GlobalMethod) MoneyFenToYuan ¶
func (*GlobalMethod) MoneyFenToYuan(fen string) (float64, bool)
* * @Description: 金额分转化为元 * @Author: Joker * @Date: 2019.04.10 9:20 * @Param: fen: 分 * @return: float64: 元; bool:false: 转化没有错误 *
func (*GlobalMethod) MoneyYuanToFen ¶
func (*GlobalMethod) MoneyYuanToFen(yuan float64) (string, bool)
* * @Description: 金额元转化为分 * @Author: Joker * @Date: 2019.04.10 9:19 * @Param: yuan: 元 * @return: string: 分; bool: true:转化没有错误 *
func (*GlobalMethod) MoneyYuanToFloat ¶
func (*GlobalMethod) MoneyYuanToFloat(yuan string) (float64, error)
func (*GlobalMethod) MoneyYuanToString ¶
func (*GlobalMethod) MoneyYuanToString(yuan float64) string
func (*GlobalMethod) PasswordSolt ¶
func (this *GlobalMethod) PasswordSolt(pwd string) (string, string)
* * @Description: 注册密码加盐 * @Author: Joker * @Date: 2019.04.01 11:48 * @Param: pwd: 原始密码 * @return: 返回hash和盐 *
func (*GlobalMethod) RandomIntOfString ¶
func (*GlobalMethod) RandomIntOfString(length int) string
生成n位随机数字字符串
func (*GlobalMethod) RandomString ¶
func (*GlobalMethod) RandomString(length int) string
在数字、大写字母、小写字母范围内生成num位的随机字符串
func (*GlobalMethod) StructToMap ¶
func (*GlobalMethod) StructToMap(s interface{}) map[string]string
struct to map
func (*GlobalMethod) ToStringByMap ¶
func (*GlobalMethod) ToStringByMap(m map[string]string) (s string)
将map拼接成字符串,去掉最后一个&符号
type SendMessages ¶
type SendMessages struct{}
func (*SendMessages) SendSmsForPay ¶
func (*SendMessages) SendSmsForPay(mobile, code string) bool
发送提现通知
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
**************************************************
|
************************************************** |