Versions in this module Expand all Collapse all v0 v0.1.156 Jan 31, 2023 Changes in this version + const ErrorBind + const ErrorBindMsg + const ErrorInternal + const ErrorInternalMsg + const ErrorSuccess + const ErrorSuccessMsg + const ErrorToken + const ErrorTokenMsg + const Kuaidi100StateClearError + const Kuaidi100StateCleared + const Kuaidi100StateClearing + const Kuaidi100StateCollect + const Kuaidi100StateDifficult + const Kuaidi100StateDispatch + const Kuaidi100StateOnTheWay + const Kuaidi100StateReject + const Kuaidi100StateReturnOnTheWay + const Kuaidi100StateReturnSignFor + const Kuaidi100StateSignFor + const Kuaidi100StateSwitching + const Kuaidi100StateToBeCleared + const MySqlGoTypeBytes + const MySqlGoTypeFloat64 + const MySqlGoTypeInt64 + const MySqlGoTypeString + const MySqlGoTypeTime + const QueryJoinTypeInner + var GinRespInternalErr = GinResp + var GinRespSuccess = GinResp + var MysqlTypeToGoMap = map[string]int64 + var ZapLog *zap.Logger + func AesDecrypt(cryted string, key string) (string, error) + func AesEncrypt(orig string, key string) (string, error) + func DbCreate(dataSourceName string, showSQL bool) *sqlx.DB + func DbDeleteKV(ctx context.Context, tx DbExeAble, table string, keys []string, ...) (int64, error) + func DbExecuteCountManyContent(ctx context.Context, tx DbExeAble, query string, n int, args ...interface{}) (int64, error) + func DbExecuteCountNamedContent(ctx context.Context, tx DbExeAble, query string, argMap map[string]interface{}) (int64, error) + func DbExecuteLastIDNamedContent(ctx context.Context, tx DbExeAble, query string, argMap map[string]interface{}) (int64, error) + func DbGetNamedContent(ctx context.Context, tx DbExeAble, dest interface{}, query string, ...) (bool, error) + func DbNamedRowsContent(ctx context.Context, tx DbExeAble, query string, argMap map[string]interface{}) ([]gin.H, error) + func DbSelectNamedContent(ctx context.Context, tx DbExeAble, dest interface{}, query string, ...) error + func DbSetShowSQL(b bool) + func DbStructGetDiff(tx DbExeAble, tableNames []string, sqlFilePath string) (string, error) + func DbTransaction(ctx context.Context, db *sqlx.DB, f func(dbTx DbExeAble) error) error + func DbUpdateKV(ctx context.Context, tx DbExeAble, table string, updateMap H, keys []string, ...) (int64, error) + func DecodeHashID(salt string, minLen int, value string) (int, error) + func DecodeHashIDs(salt string, minLen int, value string) ([]int, error) + func DecryptAesEcb(data, key []byte) ([]byte, error) + func EncodeHashID(salt string, minLen, id int) (string, error) + func EncodeHashIDs(salt string, minLen int, ids []int) (string, error) + func GetHash(in string) (string, error) + func GetStringSize(str string, fontPath string, fontSize float64, dpi float64) (fixed.Rectangle26_6, fixed.Int26_6, error) + func GetUUIDStr() string + func GetWriteLinesWidthFont(content string, fontSize float64, width int, fontPath string) ([]string, error) + func GetWriteSizeFont(content string, fontSize float64, fontPath string) (int, int, error) + func GinBodyRepeat(r io.Reader) (io.ReadCloser, error) + func GinCors() gin.HandlerFunc + func GinDoEncRespSuccess(c *gin.Context, key string, isAll bool, data gin.H) + func GinDoRespErr(c *gin.Context, code int64, msg string, data gin.H) + func GinDoRespInternalErr(c *gin.Context) + func GinDoRespSuccess(c *gin.Context, data gin.H) + func GinFillBindError(c *gin.Context, err error) + func GinMidRepeatReadBody(c *gin.Context) + func GinMinTokenToUserID(tx DbExeAble, ...) func(*gin.Context) + func GinMinTokenToUserIDRedis(tx DbExeAble, redisClient *redis.Client, ...) func(*gin.Context) + func GinMinTokenToUserIDRedisIgnore(tx DbExeAble, redisClient *redis.Client, ...) func(*gin.Context) + func IP2long(ipAddr string) (uint32, error) + func IntArrToString(A []int64, denim string) string + func IsInSlice(arr []interface{}, iv interface{}) bool + func IsIntInSlice(arr []int64, str int64) bool + func IsStringInSlice(arr []string, str string) bool + func LogSetLevel(level zapcore.Level) error + func LogSetToProd() error + func ModelRowInterfaceToStruct(m map[string]interface{}, v interface{}) error + func ModelRowToInterface(m map[string]string, intCols []string, floatCols []string) (map[string]interface{}, error) + func ModelRowToStruct(m map[string]string, v interface{}) error + func ModelRowsInterfaceToStruct(rows []map[string]interface{}, v interface{}) error + func ModelRowsToInterface(ms []map[string]string, intCols []string, floatCols []string) ([]map[string]interface{}, error) + func ModelRowsToStruct(rows []map[string]string, v interface{}) error + func PKCS7Padding(ciphertext []byte, blocksize int) []byte + func PKCS7UnPadding(origData []byte) []byte + func QiniuGetDownloadURL(ctx context.Context, access string, secret string, domain string, ...) string + func QiniuTokenFrom(ctx context.Context, access string, secret string, bucket string) string + func QiniuUploadImg(ctx context.Context, access string, secret string, bucket string, ...) error + func QueryDelete(table string) *deleteData + func QueryInsert(into string) *insertData + func QueryJoin(joinType int64, obj string) *joinData + func QuerySelect(columns ...QueryMaker) *selectData + func QueryUpdate(table string) *updateData + func RedisCreate(address string, password string, dbIndex int) *redis.Client + func RedisGet(ctx context.Context, client *redis.Client, key string) (string, error) + func RedisRm(ctx context.Context, client *redis.Client, key string) error + func RedisSet(ctx context.Context, client *redis.Client, key, value string, du time.Duration) error + func RedisSetBaseKey(v string) + func RsaSign(signContent string, privateKey *rsa.PrivateKey, hash crypto.Hash) (string, error) + func SQLRedisGetWxToken(c context.Context, tx DbExeAble, redisClient *redis.Client, appID string, ...) (string, error) + func SQLRedisRestWxToken(c context.Context, tx DbExeAble, redisClient *redis.Client, appID string, ...) + func TencenSms(sdkID, sdkKey, appID, sign, templateID string, tels []string, ...) error + func TimeGetMillisecond() int64 + func UploadToQiniu(ctx context.Context, access string, secret string, zone *storage.Zone, ...) error + func WechatCheckSign(appSecret string, paramsMap gin.H) bool + func WechatGetPrepay(...) (gin.H, error) + func WechatGetSign(appSecret string, paramsMap gin.H) string + func WriteOnImageFont(target *image.NRGBA, content string, fontSize float64, x int, y int, ...) error + func WriteOnImageLinesFontWithGap(target *image.NRGBA, lines []string, fontSize float64, x int, y int, ...) error + func WxPayV3CheckSign(header map[string][]string, body []byte, cerStr string) error + func WxPayV3Decrype(key string, cipherStr, nonce, associatedData string) (string, error) + func WxPayV3GetHeaderByKey(header map[string][]string, key string) (string, error) + func WxPayV3GetPrepay(keySerial string, key *rsa.PrivateKey, ...) (gin.H, string, error) + func WxPayV3Sign(mchid, keySerial string, key *rsa.PrivateKey, req *gorequest.SuperAgent) (*gorequest.SuperAgent, error) + func WxPayV3SignPrepayid(key *rsa.PrivateKey, appID, prepayid string) (gin.H, error) + func WxPayV3SignStr(key *rsa.PrivateKey, cols []string) (string, error) + func XMLWalk(bs []byte) (map[string]interface{}, error) + type DbExeAble interface + Exec func(query string, args ...interface{}) (sql.Result, error) + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + Get func(dest interface{}, query string, args ...interface{}) error + GetContext func(ctx context.Context, dest interface{}, query string, args ...interface{}) error + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + QueryRowContext func(ctx context.Context, query string, args ...interface{}) *sql.Row + QueryRowxContext func(ctx context.Context, query string, args ...interface{}) *sqlx.Row + QueryxContext func(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) + Rebind func(string) string + Select func(dest interface{}, query string, args ...interface{}) error + SelectContext func(ctx context.Context, dest interface{}, query string, args ...interface{}) error + type GinResp struct + Data gin.H + ErrCode int64 + ErrMsg string + func GinFillSuccessData(data gin.H) GinResp + type H map[string]interface + type LoggerAble interface + Debugf func(template string, args ...interface{}) + Errorf func(template string, args ...interface{}) + Fatalf func(template string, args ...interface{}) + Infof func(template string, args ...interface{}) + Warnf func(template string, args ...interface{}) + var Log LoggerAble + type QueryAs QueryKvStr + func (o QueryAs) ToSQL() ([]byte, map[string]interface{}, error) + type QueryAsc string + func (o QueryAsc) ToSQL() ([]byte, map[string]interface{}, error) + type QueryColumn string + func (o QueryColumn) ToSQL() ([]byte, map[string]interface{}, error) + type QueryDesc string + func (o QueryDesc) ToSQL() ([]byte, map[string]interface{}, error) + type QueryDuplicateValue string + func (o QueryDuplicateValue) ToSQL() ([]byte, map[string]interface{}, error) + type QueryEq QueryKv + func (o QueryEq) ToSQL() ([]byte, map[string]interface{}, error) + type QueryEqRaw QueryKvStr + func (o QueryEqRaw) ToSQL() ([]byte, map[string]interface{}, error) + type QueryGt QueryKv + func (o QueryGt) ToSQL() ([]byte, map[string]interface{}, error) + type QueryKv struct + K string + V interface{} + type QueryKvStr struct + K string + V string + type QueryLt QueryKv + func (o QueryLt) ToSQL() ([]byte, map[string]interface{}, error) + type QueryMaker interface + ToSQL func() ([]byte, map[string]interface{}, error) + type StKuaidi100CbBody struct + AutoCheck string + Billstatus string + ComNew string + ComOld string + LastResult struct{ ... } + Message string + Status string + type StKuaidi100GetResp struct + Com string + Condition string + Data []struct{ ... } + IsLoop bool + Ischeck string + Message string + Nu string + RouteInfo struct{ ... } + State string + Status string + func Kuaidi100Query(customer, key, company, number, tel string) (*StKuaidi100GetResp, error) + type StKuaidi100PollResp struct + Message string + Result bool + ReturnCode string + func Kuaidi100Poll(key, company, number, tel, callbackurl string) (*StKuaidi100PollResp, error) + type StRefundRespXML struct + Appid string + CashFee int64 + CashRefundFee int64 + CouponRefundCount int64 + CouponRefundFee int64 + MchID string + NonceStr string + OutRefundNo string + OutTradeNo string + RefundChannel string + RefundFee int64 + RefundID string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + Text string + TotalFee int64 + TransactionID string + XMLName xml.Name + func WechatRefund(cer tls.Certificate, ...) (*StRefundRespXML, error) + type StWeChatCbBody struct + Appid string + Attach string + BankType string + CouponCount string + CouponFee string + CouponID string + CouponType string + FeeType string + IsSubscribe string + MchID string + NonceStr string + Openid string + OutTradeNo string + ResultCode string + ReturnCode string + Sign string + Text string + TimeEnd string + TotalFee string + TradeType string + TransactionID string + XMLName xml.Name + func WechatCheckCb(mchKey string, body []byte) (*StWeChatCbBody, error) + type StWxPayRawResp struct + CreateTime time.Time + EventType string + ID string + Resource struct{ ... } + ResourceType string + Summary string + type StWxPayResp struct + Amount struct{ ... } + Appid string + Attach string + BankType string + Mchid string + OutTradeNo string + Payer struct{ ... } + SuccessTime time.Time + TradeState string + TradeStateDesc string + TradeType string + TransactionID string + func WxPayV3DecodePayResp(v3Key string, body []byte, mchid, appid string) (*StWxPayResp, error) + type StWxRefundCb struct + OutRefundNo string + OutTradeNo string + RefundAccount string + RefundFee string + RefundID string + RefundRecvAccout string + RefundRequestSource string + RefundStatus string + SettlementRefundFee string + SettlementTotalFee string + SuccessTime string + Text string + TotalFee string + TransactionID string + XMLName xml.Name + func WxPayCheckRefundCb(mchKey string, body []byte) (*StWxRefundCb, error) + type StWxV3RefundCb struct + CreateTime time.Time + EventType string + ID string + Resource struct{ ... } + ResourceType string + Summary string + type StWxV3RefundCbContent struct + Amount struct{ ... } + Mchid string + OutRefundNo string + OutTradeNo string + RefundID string + RefundStatus string + SuccessTime time.Time + TransactionID string + UserReceivedAccount string + func WxPayV3DecodeRefundsCb(v3Key string, body []byte) (*StWxV3RefundCbContent, error) + type StWxV3RefundResp struct + Amount struct{ ... } + Channel string + Code string + CreateTime time.Time + FundsAccount string + Message string + OutRefundNo string + OutTradeNo string + PromotionDetail []interface{} + RefundID string + Status string + TransactionID string + UserReceivedAccount string + func WxPayV3Refunds(keySerial string, key *rsa.PrivateKey, ...) (*StWxV3RefundResp, error) + type WxAppCodeResp struct + AccessToken string + ErrCode int64 + ExpiresIn int64 + Openid string + RefreshToken string + Scope string + func WxAppCode(appID, appSecret, code string) (*WxAppCodeResp, error) + type WxAppUserInfoResp struct + City string + Country string + ErrCode int64 + Headimgurl string + Nickname string + Openid string + Province string + Sex int64 + Unionid string + func WxAppUserInfo(accessToken, openID string) (*WxAppUserInfoResp, error) + type WxJsCodeResp struct + Errcode int64 + Errmsg string + OpenID string + SessionKey string + Unionid string + func WxJsCode(appID, appSecret, code string) (*WxJsCodeResp, error) + type XMLNode struct + Content string + Nodes []XMLNode + XMLName xml.Name