utils

package
v0.0.0-...-fcc2dfa Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: MIT Imports: 11 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 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