This commit is contained in:
dpurbosakti
2025-08-14 16:09:31 +07:00
parent 3c84d0d662
commit aa871a95bb
11 changed files with 153 additions and 66 deletions
+7 -4
View File
@@ -1,14 +1,17 @@
package core
import "gorm.io/gorm"
import (
"time"
"gorm.io/gorm"
)
type Base struct {
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
CreatedAt time.Time `json:"createdAt" gorm:"type:timestamptz"`
UpdatedAt string `json:"updatedAt" gorm:"type:timestamptz"`
DeteledAt gorm.DeletedAt `json:"deletedAt,omitempty"`
}
//
type Main struct {
Id uint `json:"id" gorm:"primaryKey"` // depends on the system architecture
Base
+2 -2
View File
@@ -9,6 +9,6 @@ type User struct {
ecore.Main // adjust this according to the needs
Name string `json:"name" gorm:"not null;size:25"`
Password string `json:"password" gorm:"not null;size:255"`
Status_Code erc.StatusCode `json:"status_code" gorm:"not null;size:10"`
FailedLoginCount uint `json:"failedLoginCount"`
Status_Code erc.StatusCode `json:"status_code" gorm:"not null;size:12"`
FailedLoginCount uint8 `json:"failedLoginCount" gorm:"type:smallint"`
}