util

package
v0.0.0-...-23f538b Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 19 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(array interface{}, val interface{}) (index int)

Contains: 检查数组是否包含指定元素 是返回元素下标 否返回-1

func CopyProperties

func CopyProperties(dst, src interface{}) (err error)

CopyProperties: 模仿Beanutils.copyProperties

func GeneratePageSql

func GeneratePageSql(createTime []string, blurry string, sort []string, blurryProperties []string, beforeOrder string) (string, string)

GeneratePageSql: 构建分页模糊搜索 sql 语句

func GetRsaKey

func GetRsaKey() error

func GetShortUuid

func GetShortUuid() string

GetShortUuid : generate short uuid, length 8

func GetUuid

func GetUuid() string

GetUuid : generate uuid, length 32

func GetVerifyCode

func GetVerifyCode() string

GetVerifyCode: 生成6位验证码

func MapToJson

func MapToJson(data map[string]interface{}) string

JSON (map转json)

func ParseJsonToMap

func ParseJsonToMap(data string) map[string]interface{}

JSON (json转map)

func ParseToIntList

func ParseToIntList(data string) []int

JSONstring (json转IntList)

func RsaDecrypt

func RsaDecrypt(cryptText []byte) (plainText string, err error)

RsaDecrypt: 解密,传入密文,返回解密后的明文

func RsaEncrypt

func RsaEncrypt(plainText string) (cryptText []byte, err error)

RsaEncrypt: RSA加密,传入明文返回密文

func Test

func Test()

func ToJsonString

func ToJsonString(data interface{}) (string, error)

将对象转为json

func TransToHtml

func TransToHtml(md string) string

TransToHtml: 将 md 格式字符串转为 html 格式

Types

This section is empty.

Jump to

Keyboard shortcuts

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