feat: add QRCode state api, support QRCode login

This commit is contained in:
weloe
2023-10-15 22:18:39 +08:00
parent 8d64059a42
commit 82f65143b3
5 changed files with 228 additions and 0 deletions

23
model/qrcode.go Normal file
View File

@@ -0,0 +1,23 @@
package model
type QRCodeState int
// QRCode State
const (
WaitScan QRCodeState = 1
WaitAuth QRCodeState = 2
ConfirmAuth QRCodeState = 3
CancelAuth QRCodeState = 4
Expired QRCodeState = 5
)
type QRCode struct {
id string
State QRCodeState
LoginId string
Ticket string
}
func NewQRCode(id string) *QRCode {
return &QRCode{id: id, State: WaitScan}
}