beego_utils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package beego_utils beego 获取参数

Package beego_utils beego 参数返回

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelperConfigSessStringcfg

func HelperConfigSessStringcfg(sessionName string, configName string) (cfg string, err error)

HelperConfigSessStringcfg 获取 session key string

func HelperConvectBody

func HelperConvectBody(this *beego.Controller, out interface{})

HelperConvectBody Post 获取json

func HelperConvertMac

func HelperConvertMac(mac *string) (err error)

HelperConvertMac 转换macaddr,去掉 “: - ”以及空格

func HelperConvetInterface

func HelperConvetInterface(in interface{}, out interface{}) (err error)

func HelperDate2Str

func HelperDate2Str(timeIn time.Time) string

func HelperDealMac

func HelperDealMac(mac string) (ipaddr string)

func HelperFileSuffix

func HelperFileSuffix(filename string) (suffix string)

HelperFileSuffix 获取文件 扩展名

func HelperGetInt64Param

func HelperGetInt64Param(this *beego.Controller, para string) int64

HelperGetInt64Param Get 获取int64

func HelperGetIntParam

func HelperGetIntParam(this *beego.Controller, para string) int

HelperGetIntParam Get 获取int

func HelperGetNetwork

func HelperGetNetwork() (macaddr string, ip string, err error)

func HelperGetPath

func HelperGetPath(this *beego.Controller, path string) string

HelperGetPath Get 获取string url/:

func HelperGetStringParam

func HelperGetStringParam(this *beego.Controller, para string) string

HelperGetStringParam Get 获取string

func HelperMd5andSalt

func HelperMd5andSalt(salt string) (md5Str string)

HelperMd5andSalt 获取 md5 加密字符串, 有盐值 (srcStr string 未使用已删除)

func HelperStr2Date

func HelperStr2Date(strTime string) (time.Time, error)

HelperStr2Date 时间转字符串

func HelperTimeGetDaySection

func HelperTimeGetDaySection() (startTime time.Time, endTime time.Time, err error)

func ReturnFail

func ReturnFail(this *beego.Controller, msg string)

返回错误

func ReturnMuti

func ReturnMuti(this *beego.Controller, msg interface{}, data interface{})

返回告警

func ReturnSuccess

func ReturnSuccess(this *beego.Controller, data interface{})

返回正确

func ReturnWarning

func ReturnWarning(this *beego.Controller, msg interface{}, data interface{})

返回告警

Types

type CodeType

type CodeType int
const (
	// RetSuccess 200
	RetSuccess CodeType = 0

	// 404
	RetError CodeType = 1

	// other
	RetWarning CodeType = -1
)

type Network

type Network struct {
	Name       string
	IP         string
	Mask       string
	MACAddress string
}

func HelperGetNetworkInfo

func HelperGetNetworkInfo() ([]*Network, error)

type Result

type Result struct {
	Code CodeType    `json:"code"`
	Msg  interface{} `json:"msg"`
	Data interface{} `json:"data"`
}

func ResultInit

func ResultInit() *Result

init

Jump to

Keyboard shortcuts

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