entity

package
v0.0.0-...-cfca2e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskStatusNew       = "new"        // 新任务
	TaskStatusAuditFail = "audit_fail" // 审核失败
	TaskStatusJoin      = "join"       // 待报名
	TaskStatusTorun     = "torun"      // 开始报名
	TaskStatusSign      = "sign"       // 开始报名
	TaskStatusRunning   = "running"    // 报名结束
	TaskStatusPaused    = "paused"     // 暂停
	TaskStatusFinished  = "finished"   // 完成
	TaskStatusCanceled  = "canceled"   // 取消
)

定义任务的执行状态 任务的执行状态有:新任务(发布待审核)、审核失败、报名(审核通过待报名), 待运行(报名结束等待运行), 运行、暂停、完成、取消

View Source
const (
	UserStatusActive = "active"
	UserStatusFrozen = "frozen"
)

用户状态 有效 冻结

View Source
const (
	UserTaskStatusApply     = "apply"
	UserTaskStatusAuditFail = StatusAuditReject
	UserTaskStatusAuditPass = StatusAuditApproved
)

用户报名任务审核状态

View Source
const (
	StatusAuditReject   = "rejected"
	StatusAuditApproved = "approved"
)
View Source
const (
	UserRoleAdmin  = "admin"
	UserRoleMember = "member"
)

用户角色 管理员 一般用户

View Source
const (
	UserTaskRoleLeader   = "leader"
	UserTaskRoleMember   = "member"
	UserTaskRoleRecorder = "recorder"
	UserTaskRoleNone     = "none"
)

用户报名在任务中角色 队长 队员 记录员 其他

View Source
const (
	NotifyStatusUnread = "unread"
	NotifyStatusRead   = "read"
)

通知阅读状态 未读 已读

View Source
const TableNameHistory = "history"
View Source
const TableNameNotice = "notices"
View Source
const TableNameSchemaMigration = "schema_migrations"
View Source
const TableNameTask = "tasks"
View Source
const TableNameTaskRun = "task_runs"
View Source
const TableNameTaskRunLog = "task_run_logs"
View Source
const TableNameTaskRunUser = "task_run_users"
View Source
const TableNameUser = "users"
View Source
const TableNameUserRole = "user_roles"
View Source
const TableNameUserTask = "task_users"
View Source
const TableNameUserTaskAudit = "task_user_audits"

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	ID        int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Name      string    `gorm:"column:name;not null" json:"name"`
	Size      int64     `gorm:"column:size;not null" json:"size"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	DeletedAt time.Time `gorm:"column:deleted_at" json:"deleted_at"`
	Path      string    `gorm:"column:path" json:"path"`
}

type History

type History struct {
	ID          int32  `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Source      string `gorm:"column:source" json:"source"`
	Destination string `gorm:"column:destination" json:"destination"`
	Original    string `gorm:"column:original" json:"original"`
	Translation string `gorm:"column:translation" json:"translation"`
}

History mapped from table <history>

func (*History) TableName

func (*History) TableName() string

TableName History's table name

type Notice

type Notice struct {
	ID        int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Title     string    `gorm:"column:title;not null" json:"title"`
	UserID    int       `gorm:"column:user_id" json:"user_id"`
	Content   string    `gorm:"column:content;not null" json:"content"`
	Status    string    `gorm:"column:status" json:"status"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
}

Notice mapped from table <notices>

func (*Notice) TableName

func (*Notice) TableName() string

TableName Notice's table name

type Point

type Point struct {
	// contains filtered or unexported fields
}

func (*Point) Scan

func (p *Point) Scan(val interface{}) (err error)

实现sql.scanner接口

func (*Point) String

func (p *Point) String() string

func (*Point) Value

func (p *Point) Value() (driver.Value, error)

实现driver.Valuer接口

type SchemaMigration

type SchemaMigration struct {
	Version int64 `gorm:"column:version;primaryKey" json:"version"`
	Dirty   bool  `gorm:"column:dirty;not null" json:"dirty"`
}

SchemaMigration mapped from table <schema_migrations>

func (*SchemaMigration) TableName

func (*SchemaMigration) TableName() string

TableName SchemaMigration's table name

type Task

type Task struct {
	ID         int            `gorm:"column:id;primaryKey;autoIncrement:true" json:"id" `
	Name       string         `gorm:"column:name;not null" json:"name"`
	CreateBy   int            `gorm:"column:create_by" json:"create_by"`
	CreatedAt  time.Time      `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt  time.Time      `gorm:"column:updated_at" json:"updated_at" swaggerignore:"true"`
	FinishedAt time.Time      `gorm:"column:finished_at" json:"finished_at" `
	DeletedAt  gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at" swaggerignore:"true"`
	Describe   string         `gorm:"column:describe" json:"describe"`
	Require    string         `gorm:"column:require" json:"require"`
	Location   string         `gorm:"column:location" json:"location"`
	Status     string         `gorm:"column:status" json:"status"`
}

Task mapped from table <tasks>

func (*Task) TableName

func (*Task) TableName() string

TableName Task's table name

type TaskRun

type TaskRun struct {
	ID        int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	TaskID    int       `gorm:"column:task_id" json:"task_id"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	StartAt   time.Time `gorm:"column:start_at" json:"start_at"`
	Endat     time.Time `gorm:"column:end_at" json:"end_at"`
	Duration  int       `gorm:"column:duration" json:"duration"`
	Status    string    `gorm:"column:status" json:"status"`
}

TaskRun mapped from table <task_runs>

func (*TaskRun) TableName

func (*TaskRun) TableName() string

TableName TaskRun's table name

type TaskRunLog

type TaskRunLog struct {
	ID        int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	TaskID    int       `gorm:"column:task_id" json:"task_id"`
	TaskRunID int       `gorm:"column:task_run_id" json:"task_run_id"`
	UserID    int       `gorm:"column:user_id" json:"user_id"`
	Content   string    `gorm:"column:content" json:"content"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	Images    string    `gorm:"column:images" json:"images"`
	Videos    string    `gorm:"column:videos" json:"videos"`
}

TaskRunLog mapped from table <task_run_logs>

func (*TaskRunLog) TableName

func (*TaskRunLog) TableName() string

TableName TaskRunLog's table name

type TaskRunUser

type TaskRunUser struct {
	ID         int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	TaskID     int       `gorm:"column:task_id" json:"task_id"`
	TaskRunID  int       `gorm:"column:task_run_id" json:"task_run_id"`
	UserID     int       `gorm:"column:user_id" json:"user_id"`
	Duration   int       `gorm:"column:duration" json:"duration"`
	CreatedAt  time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	StartAt    time.Time `gorm:"column:start_at" json:"start_at"`
	FinishedAt time.Time `gorm:"column:finished_at" json:"finished_at"`
	Status     string    `gorm:"column:status" json:"status"`
}

TaskRunUser mapped from table <task_run_users>

func (*TaskRunUser) TableName

func (*TaskRunUser) TableName() string

TableName TaskRunUser's table name

type User

type User struct {
	ID        int            `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	Username  string         `gorm:"column:username;not null" json:"username"`
	Password  string         `gorm:"column:password;not null" json:"password"`
	Email     string         `gorm:"column:email" json:"email"`
	Phone     string         `gorm:"column:phone" json:"phone"`
	Status    string         `gorm:"column:status" json:"status"`
	CreatedAt time.Time      `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
	Openid    string         `gorm:"column:openid" json:"openid"`
	Ext       string         `gorm:"column:ext" json:"ext"`
}

User mapped from table <users>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

type UserRole

type UserRole struct {
	ID        int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	UserID    int       `gorm:"column:user_id" json:"user_id"`
	Role      string    `gorm:"column:role;not null" json:"role"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
}

UserRole mapped from table <user_roles>

func (*UserRole) TableName

func (*UserRole) TableName() string

TableName UserRole's table name

type UserSetting

type UserSetting struct {
	UserID                string `json:"user_id"`
	IntroUserID           string `json:"intro_user_id"`
	Name                  string `json:"name"`
	LoginName             string `json:"login_name"`
	Sex                   string `json:"sex"`
	Phone                 string `json:"phone"`
	Birthday              string `json:"birthday"`
	WechatName            string `json:"wechat_name"`
	Married               string `json:"married"`
	Idcard                string `json:"idcard"`
	Education             string `json:"education"`
	Email                 string `json:"email"`
	Mingzu                string `json:"mingzu"`
	Region                string `json:"region"`
	Address               string `json:"address"`
	EmergencyContact      string `json:"emergency_contact"`
	EmergencyPhone        string `json:"emergency_phone"`
	EmergencyRelationship string `json:"emergency_relationship"`
	InsuranceStart        string `json:"insurance_start"`
	InsuranceEnd          string `json:"insurance_end"`
	Intro                 string `json:"intro"`
	WorkCategory          string `json:"work_category"`
	InsuranceName         string `json:"insurance_name"`
	InsurancePhoto        string `json:"insurance_photo"`
}

UserSetting 用户的基本信息

type UserTask

type UserTask struct {
	ID        int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	TaskID    int       `gorm:"column:task_id" json:"task_id"`
	UserID    int       `gorm:"column:user_id" json:"user_id"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	Status    string    `gorm:"column:status" json:"status"`
	Role      string    `gorm:"column:role" json:"role"`
	User      User      `json:"user"`
	Task      Task      `json:"task"`
}

UserTask mapped from table <task_users>

func (*UserTask) TableName

func (*UserTask) TableName() string

TableName UserTask's table name

type UserTaskAudit

type UserTaskAudit struct {
	ID          int       `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
	TaskID      int       `gorm:"column:task_id" json:"task_id"`
	UserID      int       `gorm:"column:user_id" json:"user_id"`
	AuditUserID int       `gorm:"column:audit_user_id" json:"audit_user_id"`
	CreatedAt   time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	Status      string    `gorm:"column:status" json:"status"`
	Reason      string    `gorm:"column:reason" json:"reason"`
}

UserTaskAudit mapped from table <task_user_audits>

func (*UserTaskAudit) TableName

func (*UserTaskAudit) TableName() string

TableName UserTaskAudit's table name

type UserTaskSummary

type UserTaskSummary struct {
	TotalTask     int64 `json:"total_task"`
	TotalDuration int64 `json:"total_duration"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL