model

package
v0.0.0-...-e5b71ba Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	gorm.Model

	TeamID     sql.NullInt64
	Name       string
	Content    string
	Location   string
	Volunteers []Volunteer `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

type Team

type Team struct {
	gorm.Model

	Name         string
	Organization string
	Code         string

	TeamAdmins []TeamAdmin `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Volunteers []Volunteer `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Jobs       []Job       `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type TeamAdmin

type TeamAdmin struct {
	gorm.Model

	Username string
	Password string
	TeamID   sql.NullInt64
}

type Volunteer

type Volunteer struct {
	gorm.Model

	TeamID     sql.NullInt64 `gorm:"index"`
	Name       string
	IDNumber   string // 身份证号
	Gender     bool
	Employment string // 目前在职情况
	Avatar     string // 头像地址
	Experience string `gorm:"type:text"` // 工作经历
	Status     int    // 志愿者录取状态
	Tel        string // 电话联系方式

	IntentionID sql.NullInt64 // 志愿 JobID
	Intention   Job           `gorm:"foreignKey:IntentionID"`
	JobID       sql.NullInt64
	Job         Job
}

Jump to

Keyboard shortcuts

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