feat(api): add client app service endpoints
This commit is contained in:
22
backend/api/internal/models/staff_attendance.go
Normal file
22
backend/api/internal/models/staff_attendance.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.apinb.com/bsm-sdk/core/database"
|
||||
"time"
|
||||
)
|
||||
|
||||
// StaffAttendance 保存工作人员上下班不可变记录。
|
||||
type StaffAttendance struct {
|
||||
Entity // 公共实体字段
|
||||
StaffAccountID uint64 `gorm:"column:staff_account_id;not null;index" json:"staff_account_id"` // 工作人员内部主键
|
||||
RoleCode string `gorm:"column:role_code;type:varchar(64);not null" json:"role_code"` // 打卡时岗位快照
|
||||
Action string `gorm:"column:action;type:varchar(16);not null;index" json:"action"` // 上班或下班动作
|
||||
OccurredAt time.Time `gorm:"column:occurred_at;type:timestamptz;not null;index" json:"occurred_at"` // 客户端采集时间
|
||||
Longitude string `gorm:"column:longitude;type:varchar(32);not null;default:''" json:"longitude"` // 打卡经度
|
||||
Latitude string `gorm:"column:latitude;type:varchar(32);not null;default:''" json:"latitude"` // 打卡纬度
|
||||
DeviceIdentity string `gorm:"column:device_identity;type:varchar(128);not null;default:''" json:"device_identity"` // 采集设备标识
|
||||
RequestNo string `gorm:"column:request_no;type:varchar(128);not null;uniqueIndex" json:"request_no"` // 打卡幂等号
|
||||
}
|
||||
|
||||
func init() { database.AppendMigrate(&StaffAttendance{}) }
|
||||
func (*StaffAttendance) TableName() string { return "staff_attendance" }
|
||||
Reference in New Issue
Block a user