panel

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHeartMapping  = "/subscribe/heartbeat"
	DefaultResultMapping = "/subscribe/result"
)

Variables

View Source
var (
	DeviceNotOnlineError = errors.New("设备不在线")
)

Functions

This section is empty.

Types

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

func NewConnector

func NewConnector(port int, logger log.Logger) *Connector

func (*Connector) AddDevice

func (c *Connector) AddDevice(sn, serialNum string, ip string, user, password string) error

AddDevice 添加设备

func (*Connector) Destroy

func (c *Connector) Destroy() error

func (*Connector) GetResultChan

func (c *Connector) GetResultChan() chan VerifyResult

GetResultChan 获取识别结果通道

func (*Connector) GetSnapChan added in v1.2.0

func (c *Connector) GetSnapChan() chan SnapResult

func (*Connector) Initialize

func (c *Connector) Initialize() error

func (*Connector) RemoveDevice

func (c *Connector) RemoveDevice(sn string) error

RemoveDevice 删除设备

func (*Connector) Send

func (c *Connector) Send(sn string, operator string, body map[string]any) (res *ResponseData, err error)

Send 向某个人脸识别面板机发送指令

type HeartBeat added in v1.2.0

type HeartBeat struct {
	SN          string `json:"SN"`
	IP          string `json:"ip"`
	Password    string `json:"password"`
	PersonCount int    `json:"personCount"`
}

type RecogniseType

type RecogniseType string

type ResponseData added in v1.2.0

type ResponseData struct {
	Result  int    `json:"result"`
	Message string `json:"message"`
}

type SnapResult added in v1.2.0

type SnapResult struct {
	SN          string    `json:"sn"`
	ImageData   string    `json:"image_data"`
	Time        string    `json:"time"`
	ReceiveTime time.Time `json:"receive_time"`
}

type VerifyData added in v1.2.0

type VerifyData struct {
	ID             string `json:"id"`
	SN             string `json:"SN"`
	Addr           string `json:"Mac_addr"`
	Time           string `json:"time"` // 识别时间
	UserID         string `json:"employee_number"`
	Name           string `json:"name"`
	ICNumber       string `json:"icNum"`
	IdentityType   string `json:"IdentifyType"`
	IdentityStatus int    `json:"resultStatus"`
	ImageData      string `json:"face_base64"`
}

type VerifyResult added in v1.2.0

type VerifyResult struct {
	SN          string    `json:"sn"`
	UserID      string    `json:"user_id"`
	UserName    string    `json:"user_name"`
	ImageData   string    `json:"image_data"`
	VerifyType  string    `json:"verify_type"`
	Time        string    `json:"time"`
	ReceiveTime time.Time `json:"receive_time"`
}

Jump to

Keyboard shortcuts

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