// Copyright 2023 Anlity <leo@leocode.net>. All rights reserved.
// Use of this source code is governed by a AGPL v3.0 style
// license that can be found in the LICENSE file.

// ==========================================================================
// This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY.
// ==========================================================================

package internal

import (
	"github.com/gogf/gf/database/gdb"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/frame/gmvc"
)

// AdminDao is the manager for logic model data accessing
// and custom defined data operations functions management.
type AdminDao struct {
	gmvc.M               // M is the core and embedded struct that inherits all chaining operations from gdb.Model.
	DB      gdb.DB       // DB is the raw underlying database management object.
	Table   string       // Table is the table name of the DAO.
	Columns adminColumns // Columns contains all the columns of Table that for convenient usage.
}

// AdminColumns defines and stores column names for table c_admin.
type adminColumns struct {
	Id                 string //
	UserId             string // 前台会员ID
	AdminName          string // 管理员名
	RealName           string // 真实姓名
	Remark             string // 备注
	RoleId             string // 角色ID
	IsEnable           string // 是否启用
	AuthKey            string // 授权key
	PasswordHash       string // hash密码
	PasswordResetToken string //
	DontDel            string // 是否允许删除
	LoginNums          string // 登陆次数
	FailNums           string // 失败次数
	LastLoginIp        string // 最后登录IP
	LastLoginAt        string // 最后登录时间
	BindIp             string // 绑定IP
	CreateAdmin        string // 创建管理员ID
	UpdateAdmin        string // 更新管理员ID
	CreatedAt          string // 创建时间
	UpdatedAt          string // 更新时间
	IsDelete           string // 是否删除
	DeletedAt          string // 删除时间
}

func NewAdminDao() *AdminDao {
	return &AdminDao{
		M:     g.DB("default").Model("c_admin").Safe(),
		DB:    g.DB("default"),
		Table: "c_admin",
		Columns: adminColumns{
			Id:                 "id",
			UserId:             "user_id",
			AdminName:          "admin_name",
			RealName:           "real_name",
			Remark:             "remark",
			RoleId:             "role_id",
			IsEnable:           "is_enable",
			AuthKey:            "auth_key",
			PasswordHash:       "password_hash",
			PasswordResetToken: "password_reset_token",
			DontDel:            "dont_del",
			LoginNums:          "login_nums",
			FailNums:           "fail_nums",
			LastLoginIp:        "last_login_ip",
			LastLoginAt:        "last_login_at",
			BindIp:             "bind_ip",
			CreateAdmin:        "create_admin",
			UpdateAdmin:        "update_admin",
			CreatedAt:          "created_at",
			UpdatedAt:          "updated_at",
			IsDelete:           "is_delete",
			DeletedAt:          "deleted_at",
		},
	}
}
