sn

package
v0.0.0-...-3590adc Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TERMINAL_ANDROID            = "0"
	TERMINAL_IOS                = "1"
	TERMINAL_WECHAT_MINIPROGRAM = "2"
	TERMINAL_WECHAT_MP          = "3"

	SECOND_CAPACITY = 999 // 一秒钟的序号容量
)

订单涞源、时间戳、随机码、机器码、进程号、每次进程重启随机自增

View Source
const (
	SERVICE_ORDER          = "0"
	CROWDSOURCING_ORDER    = "1"
	CROWDSOURCING_CONTRACT = "2"
)

业务编号

Variables

This section is empty.

Functions

func GenCode

func GenCode(terminal string, bizCode string, machineCode string) (string, error)

* 生成分布式场景下18位的唯一序列号(可以使用到2022年5月21日) terminal: 终端识别号 bizCode: 业务编号 machineCode: 机器编号

func GenShortCode

func GenShortCode(terminal string, bizCode string, machineCode string) (string, error)

* 生成分布式场景下15位的唯一序列号(可以使用到2022年5月21日) terminal: 终端识别号 bizCode: 业务编号 machineCode: 机器编号

func GenlightCode

func GenlightCode(bizCode string, machineCode string) (string, error)

* 生成分布式场景下14位的唯一序列号(可以使用到2022年5月21日) terminal: 终端识别号 bizCode: 业务编号 machineCode: 机器编号

func GetMac

func GetMac() (string, error)

获取机器的Mac地址

func GetTimestamp

func GetTimestamp() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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