util

package
v0.0.0-...-5160462 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(key string, sEnc string) (string, error)

key : AES算法的密钥(被base64之后的值) sEnc : AES加密之后的数据

func AESEncrypt

func AESEncrypt(key string, requestBody string) (string, error)

key BASE64之后的AES密钥 AES加密算法,默认会加密后的字符串进行Base64转码

func ByteToStruct

func ByteToStruct(data []byte, object interface{}) error

func EncryptdesCbc

func EncryptdesCbc(src, key string) string

CBC加密

func GetMd5String

func GetMd5String(s string) string

生成32位md5字串

func GetUrlQueryStringByLastOne

func GetUrlQueryStringByLastOne(key string, params map[string][]string) string

基于和spring机制一样当存在多个一样的参数在querystring上取数组最后一个参数值为基准

func JsonToStruct

func JsonToStruct(str string, object interface{}) error

func SendEmail

func SendEmail(email string, title string, content string, from string, to string, deliverContent string)

func SendWX

func SendWX(empNos []string, wxTemplate string)

func Sha1String

func Sha1String(data string) string

func StringJoin

func StringJoin(args ...string) string

func StructToJson

func StructToJson(v interface{}) string

func UniqueId

func UniqueId() string

生成Guid字串

Types

type TrueOrFalse

type TrueOrFalse int
const (
	False TrueOrFalse = iota
	True  TrueOrFalse = 1
)

type WxContent

type WxContent struct {
	EmpNos  []string `json:"empNos"`
	Content string   `json:"content"`
}

type YesOrNo

type YesOrNo int
const (
	Yes YesOrNo = iota
	No          = -1
)

Jump to

Keyboard shortcuts

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