// Code generated by db2go. DO NOT EDIT.
// https://github.com/civet148/sqlca

package models

const TableNameInviteCode = "invite_code" //

const (
	INVITE_CODE_COLUMN_ID           = "id"
	INVITE_CODE_COLUMN_USER_ID      = "user_id"
	INVITE_CODE_COLUMN_USER_ACC     = "user_acc"
	INVITE_CODE_COLUMN_RANDOM_CODE  = "random_code"
	INVITE_CODE_COLUMN_LINK_URL     = "link_url"
	INVITE_CODE_COLUMN_STATE        = "state"
	INVITE_CODE_COLUMN_EXPIRE_TIME  = "expire_time"
	INVITE_CODE_COLUMN_ACTION_TYPE  = "action_type"
	INVITE_CODE_COLUMN_DELETED      = "deleted"
	INVITE_CODE_COLUMN_CREATED_TIME = "created_time"
	INVITE_CODE_COLUMN_UPDATED_TIME = "updated_time"
)

type InviteCodeDO struct {
	Id          int32  `json:"id" db:"id" bson:"_id"`                                               //自增ID
	UserId      int32  `json:"user_id" db:"user_id" bson:"user_id"`                                 //注册用户ID
	UserAcc     string `json:"user_acc" db:"user_acc" bson:"user_acc"`                              //注册账户
	RandomCode  string `json:"random_code" db:"random_code" bson:"random_code"`                     //认证码(5位字母和数字组合)
	LinkUrl     string `json:"link_url" db:"link_url" bson:"link_url"`                              //链接URL(保留字段)
	State       int8   `json:"state" db:"state" bson:"state"`                                       //状态(1=等待校验 2=已校验)
	ExpireTime  int64  `json:"expire_time" db:"expire_time" bson:"expire_time"`                     //过期时间(UNIX时间戳)
	ActionType  int8   `json:"action_type" db:"action_type" bson:"action_type"`                     //操作类型(0=注册 1=重置密码)
	Deleted     bool   `json:"deleted" db:"deleted" bson:"deleted"`                                 //是否已删除(0=未删除 1=已删除)
	CreatedTime string `json:"created_time" db:"created_time" sqlca:"readonly" bson:"created_time"` //创建时间
	UpdatedTime string `json:"updated_time" db:"updated_time" sqlca:"readonly" bson:"updated_time"` //更新时间
}

func (do *InviteCodeDO) GetId() int32            { return do.Id }
func (do *InviteCodeDO) SetId(v int32)           { do.Id = v }
func (do *InviteCodeDO) GetUserId() int32        { return do.UserId }
func (do *InviteCodeDO) SetUserId(v int32)       { do.UserId = v }
func (do *InviteCodeDO) GetUserAcc() string      { return do.UserAcc }
func (do *InviteCodeDO) SetUserAcc(v string)     { do.UserAcc = v }
func (do *InviteCodeDO) GetRandomCode() string   { return do.RandomCode }
func (do *InviteCodeDO) SetRandomCode(v string)  { do.RandomCode = v }
func (do *InviteCodeDO) GetLinkUrl() string      { return do.LinkUrl }
func (do *InviteCodeDO) SetLinkUrl(v string)     { do.LinkUrl = v }
func (do *InviteCodeDO) GetState() int8          { return do.State }
func (do *InviteCodeDO) SetState(v int8)         { do.State = v }
func (do *InviteCodeDO) GetExpireTime() int64    { return do.ExpireTime }
func (do *InviteCodeDO) SetExpireTime(v int64)   { do.ExpireTime = v }
func (do *InviteCodeDO) GetActionType() int8     { return do.ActionType }
func (do *InviteCodeDO) SetActionType(v int8)    { do.ActionType = v }
func (do *InviteCodeDO) GetDeleted() bool        { return do.Deleted }
func (do *InviteCodeDO) SetDeleted(v bool)       { do.Deleted = v }
func (do *InviteCodeDO) GetCreatedTime() string  { return do.CreatedTime }
func (do *InviteCodeDO) SetCreatedTime(v string) { do.CreatedTime = v }
func (do *InviteCodeDO) GetUpdatedTime() string  { return do.UpdatedTime }
func (do *InviteCodeDO) SetUpdatedTime(v string) { do.UpdatedTime = v }

/*
CREATE TABLE `invite_code` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '自增ID',
  `user_id` int NOT NULL COMMENT '注册用户ID',
  `user_acc` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '注册账户',
  `random_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '认证码(5位字母和数字组合)',
  `link_url` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '链接URL(保留字段)',
  `state` tinyint(1) NOT NULL COMMENT '状态(1=等待校验 2=已校验)',
  `expire_time` bigint NOT NULL DEFAULT '0' COMMENT '过期时间(UNIX时间戳)',
  `action_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '操作类型(0=注册 1=重置密码)',
  `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0=未删除 1=已删除)',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_INVITECODE` (`user_acc`,`random_code`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
*/
