utils

package
v0.0.0-...-1bf96ee Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cache_redis = "redis"
	Cache_local = "local"
)

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(baseStr string) string

----------------------------------------------------------- ----------------------- 解密 ------------------------------ ----------------------------------------------------------- 先base64转码,再解密

func AESEncrypt

func AESEncrypt(originPWD []byte) string

----------------------------------------------------------- ----------------------- 加密 ------------------------------ ----------------------------------------------------------- 加密后再base64编码成string

func CheckPWD

func CheckPWD(password, enPassword string) bool

校验密码

func CreateDir

func CreateDir(dirName string) bool

* 创建文件夹

func Error

func Error(ctx iris.Context, status int, code constants.Code)

common error define

func Exists

func Exists(path string) bool

func GetServiceSql

func GetServiceSql(sqlCode string) serviceSql.ServiceSqlDto

func InternalServerError

func InternalServerError(ctx iris.Context, code constants.Code)

func IsDir

func IsDir(fileAddr string) bool

* 判断文件是否存在

func IsEmpty

func IsEmpty(value string) bool

func IsFile

func IsFile(fileAddr string) bool

* 判断文件是否存在

func Ok

func Ok(ctx iris.Context, code constants.Code, data interface{})

func Ok_

func Ok_(ctx iris.Context, code constants.Code)

200 define

func PaginationTableData

func PaginationTableData(ctx iris.Context, total int64, data interface{})

func ParseIntValueFromInterface

func ParseIntValueFromInterface(param map[string]interface{}, name string) int64

* 从interface 对象中反射 出值

func ParseObjectValueFromInterface

func ParseObjectValueFromInterface(param map[string]interface{}, name string) interface{}

func ParseStringValueFromInterface

func ParseStringValueFromInterface(param map[string]interface{}, name string) string

func Unauthorized

func Unauthorized(ctx context.Context, code constants.Code)

401 error define

Types

type Pagination

type Pagination struct {
	Start int `json:"start" validate:"min=0"`
	Size  int `json:"size" validate:"min=0"`
}

pagination struct

func (*Pagination) Init

func (page *Pagination) Init()

初始化分页参数

Jump to

Keyboard shortcuts

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