model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAccept

type AuthAccept struct {
	Error int             `json:"error"`
	Msg   string          `json:"msg"`
	Data  json.RawMessage `json:"data"`
}

type Depart

type Depart struct {
	ID   int64  `gorm:"primaryKey;unique;not null" json:"id"` // 部门id
	Name string `gorm:"not null" json:"name"`                 // 部门名字
	Desc string `gorm:"not null" json:"desc"`                 // 部门描述
}

type GetAllDepartsResp

type GetAllDepartsResp struct {
	Count   int       `json:"count" example:"4"`  // 部门个数
	Departs []*Depart `json:"departs" example:""` // 详细部门数组
}

type GetMeResp

type GetMeResp struct {
	StaffID   int64  `json:"staff_id" example:"21051101"`                              // 学号
	StaffName string `json:"staff_name" example:"小明"`                                  // 姓名
	Photo     string `json:"photo" example:"df93c5bb-b957-4e24-afa1-9cr2372ef8fe.jpg"` // 照片文件名
	Show      int    `json:"show" example:"1"`                                         // 是否显示照片,1为显示,2为不显示
	Depart    string `json:"depart" example:"未选择"`                                     // 部门名称
}

type GetOptionsReq

type GetOptionsReq struct {
	Num    int   `form:"num" example:"4" binding:"required,gte=1"`
	Depart int64 `form:"depart" example:"-1" binding:"required"`
}

type GetOptionsResp

type GetOptionsResp struct {
	Photo   string    `json:"photo" example:"be4aed10-aaf4-453a-8d4e-e0ace7bc56ea.jpeg"` // 照片
	Options []*Option `json:"options"`                                                   // 选项数组
}

type JudgeOptionReq

type JudgeOptionReq struct {
	Photo string `form:"photo" binding:"required" example:"be4aed10-aaf4-453a-8d4e-e0ace7bc56ea.jpeg"`
	ID    int64  `form:"id" binding:"required" example:"4"`
}

type JudgeOptionResp

type JudgeOptionResp struct {
	Right int      `json:"right" example:"2"`                 // 是否正确,1为正确,2为不正确
	Name  []string `json:"name,omitempty" example:"小明,小红,小黑"` // 返回所有使用了这张照片的人,大部分情况下只有一张
}

type Option

type Option struct {
	ID   int64  `json:"id"`   // 学生ID
	Name string `json:"name"` // 学生姓名
}

type Photo

type Photo struct {
	ID   int64  `gorm:"primaryKey;unique;not null" json:"-" example:"12" swaggerignore:"true"`          // 照片ID
	File string `gorm:"unique;not null" json:"file" example:"e744fd4e-313f-4977-9642-448927a283c1.jpg"` // 文件名
	Size int64  `gorm:"not null" json:"size" example:"1110524"`                                         // 照片大小
	TimeHook
}

type Student

type Student struct {
	ID        int64  `gorm:"primaryKey;unique;not null" json:"-" swaggerignore:"true" example:"11"` // id
	StaffID   int64  `gorm:"unique;not null" json:"staffID" example:"21051101"`                     // 学号
	StaffName string `gorm:"not null" json:"staffName" example:"小明"`                                // 姓名
	Show      int    `gorm:"not null" json:"show" example:"1"`                                      // 是否显示照片,1为显示,2为不显示
	Photo     int64  `gorm:"not null" json:"photo" example:"6"`                                     // 默认为-1
	Depart    int64  `gorm:"not null" json:"depart" example:"3"`                                    // 无部门为-1
	TimeHook
}

type TimeHook

type TimeHook struct {
	CreatedAt int64 `gorm:"not null" json:"-" swaggerignore:"true"`
	UpdatedAt int64 `gorm:"not null" json:"-" swaggerignore:"true"`
}

type UpdateMeReq

type UpdateMeReq struct {
	Photo  string `json:"photo" binding:"required" example:"df93c5bb-b957-4e24-afa1-9cr2372ef8fe.jpg"` // 照片文件名
	Show   int    `json:"show" binding:"required,gte=1,lte=2" example:"2"`                             // 是否显示照片,1为显示,2为不显示
	Depart int64  `json:"depart" binding:"required" example:"3"`                                       // 部门ID
}

Jump to

Keyboard shortcuts

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