git feature

This commit is contained in:
2026-06-30 14:46:19 +07:00
parent 251c1b7573
commit 11e5a76977
23 changed files with 1680 additions and 28 deletions

View File

@@ -18,8 +18,11 @@ type ExamRoom struct {
StartTime time.Time `gorm:"column:start_time;not null;index" json:"startTime"`
EndTime time.Time `gorm:"column:end_time;not null;index" json:"endTime"`
AllowedApps string `gorm:"column:allowed_apps;type:text" json:"allowedApps"`
QuizURL string `gorm:"column:quiz_url;size:1024" json:"quizUrl"`
Status string `gorm:"column:status;size:16;not null;default:draft;index" json:"status"`
QuizURL string `gorm:"column:quiz_url;size:1024" json:"quizUrl"`
GitRepoURL string `gorm:"column:git_repo_url;size:512" json:"gitRepoUrl"`
GitBranch string `gorm:"column:git_branch;size:64;default:main" json:"gitBranch"`
GitPublishURL string `gorm:"column:git_publish_url;size:1024" json:"gitPublishUrl,omitempty"`
Status string `gorm:"column:status;size:16;not null;default:draft;index" json:"status"`
}
func (ExamRoom) TableName() string { return "exam_rooms" }

View File

@@ -0,0 +1,15 @@
package models
import "time"
// StaffGitHubAuth — token OAuth GitHub của từng giáo viên
type StaffGitHubAuth struct {
StaffID uint `gorm:"primaryKey;column:staff_id" json:"staffId"`
GitHubLogin string `gorm:"column:github_login;size:128;not null" json:"githubLogin"`
AccessTokenEnc string `gorm:"column:access_token_enc;type:text;not null" json:"-"`
Scope string `gorm:"column:scope;size:255" json:"scope"`
ConnectedAt time.Time `gorm:"column:connected_at;not null" json:"connectedAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (StaffGitHubAuth) TableName() string { return "staff_github_auth" }