utils

package
v0.0.0-...-fe0d846 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDecrypt

func AesCBCDecrypt(encryptData, key, iv []byte) ([]byte, error)

func Base64Decode

func Base64Decode(str string) string

func Base64Encode

func Base64Encode(str string) string

func ContainsInt

func ContainsInt(s []int, e int) bool

func DateEqual

func DateEqual(date1, date2 time.Time) bool

func ExactMapValues2Int64Array

func ExactMapValues2Int64Array(maparray []orm.Params, key string) []int64

func ExactMapValues2StringArray

func ExactMapValues2StringArray(maparray []orm.Params, key string) []string

func Float642String

func Float642String(val float64) string

func FormatTimestamp

func FormatTimestamp(timestamp int64, format string) string

the result likes 2015-02-08 10:19:39 AM

func GetHTTPRtnJsonData

func GetHTTPRtnJsonData(errno int, errmsg string) interface{}

func GetTimestamp

func GetTimestamp() int64

the result likes 1423361979

func GetUUID

func GetUUID() string

func Int2String

func Int2String(val int) string

func Int642String

func Int642String(val int64) string

func Md5

func Md5(str string) string

func Now

func Now() string

func Operate

func Operate(goroutineMapName string, operateType OperateType)

Operate 操作map

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func RandomString

func RandomString(length int) string

RandomString 在数字、大写字母、小写字母范围内生成num位的随机字符串

func ReturnHTTPSuccess

func ReturnHTTPSuccess(this *beego.Controller, val interface{})

func String2Int

func String2Int(val string) int

func String2md5

func String2md5(str string) string

将字符串加密成 md5

func ToString

func ToString() string

ToString 获取map的描述

func UrlEncode

func UrlEncode(str string) (string, error)

Types

type HTTPData

type HTTPData struct {
	ErrNo  int         `json:"errno"`
	ErrMsg string      `json:"errmsg"`
	Data   interface{} `json:"data"`
}

type HTTPPageData

type HTTPPageData struct {
	NumsPerPage int         `json:"pageSize"`
	CurrentPage int         `json:"currentPage"`
	Count       int         `json:"count"`
	TotalPages  int         `json:"totalPages"`
	Data        interface{} `json:"data"`
}

func GetPageData

func GetPageData(rawData []orm.Params, page int, size int) HTTPPageData

type OperateType

type OperateType int

OperateType 操作类型

const (
	//AddOperate 加
	AddOperate OperateType = 1 + iota

	//ReduceOperate 减
	ReduceOperate
)

Jump to

Keyboard shortcuts

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