utils

package
v0.0.0-...-0dd36a4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TokenMap map[string]string

Functions

func DecrypteString

func DecrypteString(key string, encrypted string, logger *zap.Logger) (plaintext string)

DecrypteString 解密

func Encryption

func Encryption(s string) string

Encryption sha256加密

func GetEmpnum

func GetEmpnum(str string, i int) string

提取员工编号的数字,并生成新的编号

func GetOrderNum

func GetOrderNum() string
   GetOrderNum
	计算订单号,订单号格式yyyymmddDDmmss+5位随机数

func GetParentDirectory

func GetParentDirectory() string

获取上级路径

func GetPath

func GetPath() string

获取绝对路径

func GetUUID

func GetUUID() (uuids string, err error)

func PathExists

func PathExists(path string) (bool, error)

判断文件夹是否存在

func Sign

func Sign(s interface{}, expires time.Duration, tokenKey, tokenSecret string) (string, error)

Sign 加密Token

func TokenInit

func TokenInit()

func Unsign

func Unsign(tokenString, tokenSecret string) (interface{}, error)

Unsign 解密Token

Types

type JwtToken

type JwtToken struct {
	Token string `json:"token"`
}

type Page

type Page struct {
	PageSize    int         `json:"-"`
	TotalCount  int         `json:"total_count"`
	TotalPage   int         `json:"-"`
	CurrentPage int         `json:"-"`
	StartIndex  int         `json:"-"`
	Data        interface{} `json:"data"`
}

func NewPage

func NewPage(currentPage int, pageSize int, totalCount int) *Page

type RtMsg

type RtMsg struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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