refactor: user curd

This commit is contained in:
Jacky 2025-01-31 23:11:14 +08:00
parent 80f01e61d3
commit 465eae9858
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
19 changed files with 1601 additions and 1881 deletions

View file

@ -9,8 +9,8 @@ import (
type User struct {
Model
Name string `json:"name"`
Password string `json:"-"`
Name string `json:"name" cosy:"add:max=20;update:omitempty,max=20;list:fussy;db_unique"`
Password string `json:"-" cosy:"add:required,max=20;update:omitempty,max=20"`
Status bool `json:"status" gorm:"default:1"`
OTPSecret []byte `json:"-" gorm:"type:blob"`
EnabledTwoFA bool `json:"enabled_2fa" gorm:"-"`