sys

package
v0.0.0-...-8d4382c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

**************************************************

** @Desc : This file for 共有方法
** @Time : 2019.04.01 11:48
** @Author : Joker
** @File : public_method
** @Last Modified by : Joker
** @Last Modified time: 2019-11-29 11:05:28
** @Software: GoLand

***************************************************

**************************************************

** @Desc : This file for session配置
** @Time : 19.11.30 17:44
** @Author : Joker
** @File : session
** @Last Modified by : Joker
** @Last Modified time: 19.11.30 17:44
** @Software: GoLand

***************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSession

func InitSession()

Types

type PublicMethod

type PublicMethod struct{}

func (*PublicMethod) FormatFloat64ToString

func (*PublicMethod) FormatFloat64ToString(f float64) string

格式化浮点数

func (*PublicMethod) GetDatabaseStatus

func (*PublicMethod) GetDatabaseStatus(code int) map[string]interface{}

返回当前操作数据库的状态:成功/失败

func (*PublicMethod) GetNowTime

func (*PublicMethod) GetNowTime() string

返回当前时间的字符串:2006-01-02 15:04:05

func (*PublicMethod) GetNowTimeV2

func (*PublicMethod) GetNowTimeV2() string

返回当前时间的字符串:20060102150405

func (*PublicMethod) IsSameDay

func (*PublicMethod) IsSameDay(d string) (bool, string)

比较是否是同一天

func (*PublicMethod) JsonFormat

func (*PublicMethod) JsonFormat(code int, data interface{}, msg string, url string) (json map[string]interface{})

@Description: 返回当前操作数据库的状态 @Author: Joker @Date: 2019.04.01 14:37 @Param: code: 状态码,msg; 状态信息:url: 跳转地址; data: json内容 @return: Json串

func (*PublicMethod) ParseDatetime

func (*PublicMethod) ParseDatetime(t time.Time) string

返回格式化的字符串:2006-01-02 15:04:05

func (*PublicMethod) PathExists

func (*PublicMethod) PathExists(path string) (bool, error)

判断文件或文件夹是否存在 使用os.Stat()函数返回的错误值进行判断: 如果返回的错误为nil,说明文件或文件夹存在 如果返回的错误类型 使用os.IsNotExist()判断为true,说明文件或文件夹不存在 如果返回的错误为其它类型,则不确定是否在存在

func (*PublicMethod) RandomIntOfString

func (*PublicMethod) RandomIntOfString(length int) string

生成n位随机数字字符串

func (*PublicMethod) RandomString

func (*PublicMethod) RandomString(length int) string

在数字、大写字母、小写字母范围内生成num位的随机字符串

Directories

Path Synopsis
************************************************** ** @Desc : This file for 银行编码 ** @Time : 19.12.4 10:42 ** @Author : Joker ** @File : bank_info ** @Last Modified by : Joker ** @Last Modified time: 19.12.4 10:42 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 配置常量 ** @Time : 2019.04.01 11:45 ** @Author : Joker ** @File : strings ** @Last Modified by : Joker ** @Last Modified time: 2019-11-29 11:05:48 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 系统常量 ** @Time : 19.11.30 11:28 ** @Author : Joker ** @File : constant ** @Last Modified by : Joker ** @Last Modified time: 19.11.30 11:28 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 支付方式 ** @Time : 19.12.3 15:24 ** @Author : Joker ** @File : pay_type ** @Last Modified by : Joker ** @Last Modified time: 19.12.3 15:24 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 正则表达式 ** @Time : 19.12.5 10:25 ** @Author : Joker ** @File : regular_expression ** @Last Modified by : Joker ** @Last Modified time: 19.12.5 10:25 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 状态常量 ** @Time : 19.11.30 11:12 ** @Author : Joker ** @File : status ** @Last Modified by : Joker ** @Last Modified time: 19.11.30 11:12 ** @Software: GoLand ***************************************************
************************************************** ** @Desc : This file for 银行编码 ** @Time : 19.12.4 10:42 ** @Author : Joker ** @File : bank_info ** @Last Modified by : Joker ** @Last Modified time: 19.12.4 10:42 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 配置常量 ** @Time : 2019.04.01 11:45 ** @Author : Joker ** @File : strings ** @Last Modified by : Joker ** @Last Modified time: 2019-11-29 11:05:48 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 系统常量 ** @Time : 19.11.30 11:28 ** @Author : Joker ** @File : constant ** @Last Modified by : Joker ** @Last Modified time: 19.11.30 11:28 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 支付方式 ** @Time : 19.12.3 15:24 ** @Author : Joker ** @File : pay_type ** @Last Modified by : Joker ** @Last Modified time: 19.12.3 15:24 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 正则表达式 ** @Time : 19.12.5 10:25 ** @Author : Joker ** @File : regular_expression ** @Last Modified by : Joker ** @Last Modified time: 19.12.5 10:25 ** @Software: GoLand *************************************************** ************************************************** ** @Desc : This file for 状态常量 ** @Time : 19.11.30 11:12 ** @Author : Joker ** @File : status ** @Last Modified by : Joker ** @Last Modified time: 19.11.30 11:12 ** @Software: GoLand ***************************************************

Jump to

Keyboard shortcuts

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