util

package
v0.0.0-...-d6ebf68 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

json iterator 工具类

Functions

func Byte2Int

func Byte2Int(data []byte) int

byte 数组 转 int

func Capitalize

func Capitalize(str string) string

首字母大写 , 下划线转 大写 同 Case2Camel

func Case2Camel

func Case2Camel(name string) string

func GetAndSql

func GetAndSql(queryList *[]*QuerySql) (whereSqlStr string, valueArray *[]types.Any)

返回值示例 : t1.filename LIKE CONCAT("",?,"") , ["678"] 返回两个参数

func GetDynamicList

func GetDynamicList(fields string, inter interface{}) interface{}

包装了 renderDynamicList

func GetDynamicObject

func GetDynamicObject(fields string, inter interface{}) interface{}

包装了 renderDynamicObject

func GetExecPath

func GetExecPath() string

func GetStringValue

func GetStringValue(inter interface{}, defValue string) string

func Int2Byte

func Int2Byte(data int) (ret []byte)

int 转 byte 数组

func MapFailOnlyMsg

func MapFailOnlyMsg(msg string) types.Map

失败时, 响应结果 , 错误码 固定 为 400, 只需要传 msg 参数

func MapResult

func MapResult(data types.Any, msg string, code int) types.Map

返回 api 结果 List 返回结果, msg 返回消息, code 返回编码,

func MapResultNoData

func MapResultNoData(msg string, code int) types.Map

返回 不包含 data 属性 的 map

func MapSuccess

func MapSuccess(data types.Any) types.Map

返回成功 map

func MapSuccessWithMsg

func MapSuccessWithMsg(data types.Any, msg string) types.Map

返回 带提示的 成功结果 map

func ProtectFunc

func ProtectFunc(entry func())

func StringToUnit

func StringToUnit(str string) uint

String 转 unit

func UnitToString

func UnitToString(uintParam uint) string

unit 转 string

Types

type QuerySql

type QuerySql struct {
	// 示例 : t1.filename LIKE CONCAT("",?,"")
	Expr string

	// Value
	Value types.Any
}

type QuerySqlPtrs

type QuerySqlPtrs = []*QuerySql

Jump to

Keyboard shortcuts

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