Ai
2 Star 0 Fork 0

ccait-dev/fast-api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
accounts.go 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
草耑 提交于 2025-05-15 14:50 +08:00 . release
package model
import (
"gitee.com/ccait-dev/fast-api/fast/database/entity"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"log"
"time"
)
type Accounts struct {
ID uint64 `gorm:"column:id;type:bigint(20);primary_key" json:"id"`
Account string `gorm:"column:account;type:varchar(255)" json:"account" validate:"required"` // 账号
Password string `gorm:"column:password;type:varchar(255)" json:"password" validate:"required"` // 密碼僅支持大小寫字母+數字
Nickname string `gorm:"column:nickname;type:varchar(32)" json:"nickname"` // 昵称
Realname string `gorm:"column:realname;type:varchar(32)" json:"realname"` // 真实姓名
Gender string `gorm:"column:gender;type:varchar(8)" json:"gender"` // lady=女,gent=男,none=未知
Mail string `gorm:"column:mail;type:varchar(64)" json:"mail" validate:"email"` // 邮箱
CreatedAt *time.Time `gorm:"column:created_at;type:datetime" json:"createdAt"` // 创建时间
CreatedBy int64 `gorm:"column:created_by;type:bigint(20)" json:"createdBy"` // 创建人
UpdatedBy int64 `gorm:"column:updated_by;type:bigint(20)" json:"updatedBy"` // 修改人
UpdatedAt *time.Time `gorm:"column:updated_at;type:datetime" json:"updatedAt"` // 修改时间
Status string `gorm:"column:status;type:varchar(8)" json:"status"` // 状态:enabled=启用,disabled=禁用,deleted=删除
Strong int `gorm:"column:strong;type:smallint(6)" json:"strong"` // 密码强度
}
func (model Accounts) Login(ctx *gin.Context, params map[string]interface{}, db *gorm.DB) {
var msg = "this is login"
log.Println(msg)
ctx.JSON(200, entity.ResponseData{Message: msg})
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ccait-dev/fast-api.git
git@gitee.com:ccait-dev/fast-api.git
ccait-dev
fast-api
fast-api
v1.0.58

搜索帮助