feat(supervisor): add invite, bind, and read-only overview

This commit is contained in:
nepiedg
2026-04-16 11:42:53 +08:00
parent a32ec911a1
commit 0eaf3a206a
7 changed files with 496 additions and 0 deletions
@@ -0,0 +1,28 @@
package model
import (
"time"
"gorm.io/gorm"
)
// SupervisorBinding 表示监督关系(一对:owner -> supervisor)。
type SupervisorBinding struct {
ID uint `gorm:"primaryKey;comment:主键" json:"id"`
CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"-"`
OwnerUID int `gorm:"column:owner_uid;uniqueIndex:uniq_owner_supervisor;index;comment:被监督用户ID" json:"owner_uid"`
SupervisorUID int `gorm:"column:supervisor_uid;uniqueIndex:uniq_owner_supervisor;index;comment:监督人用户ID" json:"supervisor_uid"`
Status string `gorm:"column:status;size:16;index;comment:状态(active|revoked)" json:"status"`
}
func (SupervisorBinding) TableName() string {
return "fa_quit_checkin_supervisor_binding"
}
func (SupervisorBinding) TableComment() string {
return "V2-无烟打卡-监督关系"
}