utils

package
v0.0.0-...-a778a28 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2019 License: MIT Imports: 12 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 PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func ReturnHTTPSuccess

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

func String2Int

func String2Int(val string) int

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 PageData

type PageData 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) PageData

Jump to

Keyboard shortcuts

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