1
This commit is contained in:
18
dao/print_activation.go
Normal file
18
dao/print_activation.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package dao
|
||||
|
||||
import "git.rosy.net.cn/jx-print/globals"
|
||||
|
||||
type PrintActivation struct {
|
||||
}
|
||||
|
||||
var PrintActivationDao = new(PrintActivation)
|
||||
|
||||
// QueryPrintHeartBeat 查询打印机是否心跳监听正常
|
||||
func (p *PrintActivation) QueryPrintHeartBeat(printNo string) (bool, error) {
|
||||
count := 0
|
||||
err := globals.GetDB().QueryRow(`SELECT count(print_no) FROM print_activation WHERE print_no = ?`, []interface{}{printNo}...).Scan(&count)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return count == 1, nil
|
||||
}
|
||||
Reference in New Issue
Block a user