Documentation ¶
Index ¶
- Constants
- func CreateActivationCode(machineCode string, date string, params Parameters, fixedCode string) (activationCode string, err error)
- func CreateQRCode(qr QRCode, fixedCode string) (batchCode string, qrCodeList []string, err error)
- func GetMachineCode(fixedcode string) string
- func VerifyDate(date string) bool
- type Categorys
- type Parameters
- type QRCode
Constants ¶
View Source
const (
// 日期显示格式
DateFormat = "2006-01-02"
)
View Source
const (
// 保留位
Reserve = "00"
)
Variables ¶
This section is empty.
Functions ¶
func CreateActivationCode ¶ added in v0.1.2
func CreateActivationCode(machineCode string, date string, params Parameters, fixedCode string) (activationCode string, err error)
生成激活码
input: machineCode: 机器码 date: 日期 (Format: 2006-12-03) params: 参数 (Struct: Parameters) fixedCode: 固定码 output: activationCode: 激活码 (XXXX-XXXX-XXXX) err: 异常信息
func CreateQRCode ¶ added in v0.1.6
根据玻片批次码,批量生产二维码数据
Types ¶
type Parameters ¶ added in v0.1.5
type Parameters struct { Testing bool // [0] true:测试版 false:正式版 UseQRCode bool // [1] true:强制使用玻片二维码 UseQRCodeCount int // [2-3] 允许使用二维码的次数 (0, 1, 3, 5) (0:无限制) AllowRD bool // [26] R带(核型) (True:允许) AllowYS bool // [27] 羊水(核型) (True:允许) AllowPB bool // [28] 外周血(形态/核型) (True:允许) AllowBM bool // [29] 骨髓(形态/核型) (True:允许) }
func CheckActivationCode ¶ added in v0.1.2
func CheckActivationCode(activationCode string, fixedCode string) (status bool, date string, parameters Parameters, err error)
在生产服务器上验证激活码
input: activationcode: 激活码 fixedcode: 固定码 output: status: 激活状态 date: 到期日期 parameters: 参数 err: 异常信息
type QRCode ¶ added in v0.1.6
type QRCode struct { Category Categorys // 类型 Batch int // 批号, 采用34进制 (占用4个字节) (0 ~ 1336335) No int // 编号, 采用34进制 (占用2个字节) (0 ~ 1155) UseTimes int // 限制扫描的次数 (1个字节) 采用34进制 (0 ~ 33) (0:无限制) }
批次二维码、标签二维码
B 0001 00 1 00 AB | | | | | +--- (2字节) 签名 | | | | +------ (2字节) 保留 | | | +--------- (1字节) 限制次数 | | +----------- (1字节) 编号 (每一批中实际最大的号做为这一批的批次码, 小于的做为标签码) (理论最大值: 1155) | +-------------- (2字节) 批号 (最大值1336335) +------------------- (4字节) 类型 BPKLYR
func CheckQRCode ¶ added in v0.1.6
检验标签码
input: qrcode: 标签码字符串 fixedCode: 固定码 output: status: 检验状态 qr: 标签码 (Struct: QRCode) err: 异常状态信息
Click to show internal directories.
Click to hide internal directories.