feat(wip): site category

This commit is contained in:
Jacky 2024-10-24 23:09:16 +08:00
parent ed3c02fc6f
commit 7ad5cac3b8
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
73 changed files with 713 additions and 235 deletions

View file

@ -37,14 +37,14 @@ type Cert struct {
SSLCertificateKeyPath string `json:"ssl_certificate_key_path"`
AutoCert int `json:"auto_cert"`
ChallengeMethod string `json:"challenge_method"`
DnsCredentialID int `json:"dns_credential_id"`
DnsCredentialID uint64 `json:"dns_credential_id"`
DnsCredential *DnsCredential `json:"dns_credential,omitempty"`
ACMEUserID int `json:"acme_user_id"`
ACMEUserID uint64 `json:"acme_user_id"`
ACMEUser *AcmeUser `json:"acme_user,omitempty"`
KeyType certcrypto.KeyType `json:"key_type"`
Log string `json:"log"`
Resource *CertificateResource `json:"-" gorm:"serializer:json"`
SyncNodeIds []int `json:"sync_node_ids" gorm:"serializer:json"`
SyncNodeIds []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
MustStaple bool `json:"must_staple"`
LegoDisableCNAMESupport bool `json:"lego_disable_cname_support"`
}

View file

@ -2,8 +2,8 @@ package model
type Config struct {
Model
Name string `json:"name"`
Filepath string `json:"filepath"`
SyncNodeIds []int `json:"sync_node_ids" gorm:"serializer:json"`
SyncOverwrite bool `json:"sync_overwrite"`
Name string `json:"name"`
Filepath string `json:"filepath"`
SyncNodeIds []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
SyncOverwrite bool `json:"sync_overwrite"`
}

View file

@ -7,12 +7,10 @@ import (
type Environment struct {
Model
Name string `json:"name"`
URL string `json:"url"`
Token string `json:"token"`
Enabled bool `json:"enabled" gorm:"default:true"`
OperationSync bool `json:"operation_sync"`
SyncApiRegex string `json:"sync_api_regex"`
Name string `json:"name"`
URL string `json:"url"`
Token string `json:"token"`
Enabled bool `json:"enabled" gorm:"default:true"`
}
func (e *Environment) GetUrl(uri string) (decodedUri string, err error) {

View file

@ -9,7 +9,7 @@ import (
var db *gorm.DB
type Model struct {
ID int `gorm:"primary_key" json:"id"`
ID uint64 `gorm:"primary_key" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *gorm.DeletedAt `gorm:"index" json:"deleted_at"`
@ -57,7 +57,7 @@ type DataList struct {
type Method interface {
// FirstByID Where("id=@id")
FirstByID(id int) (*gen.T, error)
FirstByID(id uint64) (*gen.T, error)
// DeleteByID update @@table set deleted_at=strftime('%Y-%m-%d %H:%M:%S','now') where id=@id
DeleteByID(id int) error
DeleteByID(id uint64) error
}

View file

@ -6,7 +6,7 @@ type Passkey struct {
Model
Name string `json:"name"`
UserID int `json:"user_id"`
UserID uint64 `json:"user_id"`
RawID string `json:"raw_id"`
Credential *webauthn.Credential `json:"-" gorm:"serializer:json"`
LastUsedAt int64 `json:"last_used_at" gorm:"default:0"`

View file

@ -17,7 +17,7 @@ type User struct {
}
type AuthToken struct {
UserID int `json:"user_id"`
UserID uint64 `json:"user_id"`
Token string `json:"token"`
ExpiredAt int64 `json:"expired_at" gorm:"default:0"`
}