model

package
v0.0.0-...-def10c2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableNameKnowledge = "knowledge"
	DefaultStudyBatch  = 100
)
View Source
const (
	TableNameStudyRecord = "study_record"

	StateStudied    = 0
	StateNotStudied = 1
)
View Source
const (
	GenderUnknown = 0
	GenderMan     = 1
	GenderWoman   = 2
)
View Source
const (
	TableNameUserProfile = "user_profile"
	DefaultStudyNum      = 100
)
View Source
const (
	TableNameAdminAccount = "admin_account"
)
View Source
const (
	TableNameSubject = "subject"
)

Variables

View Source
var (
	ErrStudyMineProfileNotExist = errors.New("not exits mine profile")
	ErrStudyUserProfileNotExist = errors.New("not exits user profile")
)

Functions

This section is empty.

Types

type AccountLoginReq

type AccountLoginReq struct {
	Username string `json:"username" validate:"required"`
	Password string `json:"password" validate:"required"`
}

type AccountLoginResp

type AccountLoginResp struct {
	Id       int64  `json:"id"`
	FullName string `json:"fullName"`
	Avatar   string `json:"avatar"`
	Token    string `json:"token"`
}

type AdminAccountTable

type AdminAccountTable struct {
	model.BaseModel
	Username string
	Password string
	Avatar   string
}

type DateCount

type DateCount struct {
	Date  string `json:"date"`
	Count int    `json:"count"`
}

type DateCountItem

type DateCountItem struct {
	DateFormat string
	Count      int
}

type KnowledgeListResp

type KnowledgeListResp struct {
	List    []*KnowledgeListRespItem `json:"list"`
	HasMore bool                     `json:"has_more"`
}

type KnowledgeListRespItem

type KnowledgeListRespItem struct {
	ID          int64      `json:"id"`
	SubjectID   int64      `json:"subject_id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Other       OtherField `json:"other"`
}

type KnowledgeTable

type KnowledgeTable struct {
	model.BaseModel
	SubjectID   int64  // 题库id
	Name        string // 名称
	Description string // 描述
	Other       string // 其他字段;json
}

知识点表

type OtherField

type OtherField struct {
	Pinyin string `json:"pinyin"`
}

type ProfileApiDetailEditReq

type ProfileApiDetailEditReq struct {
	Name     string `json:"name" validate:"required,gt=0,lte=32"`
	Gender   int    `json:"gender" validate:"oneof=0 1 2"`
	Portrait string `json:"portrait" validate:"required"`
}

type ProfileApiDetailResp

type ProfileApiDetailResp struct {
	UpdatedAt        int64  `json:"updated_at"`
	Uid              int64  `json:"uid"`      // 用户ID
	Name             string `json:"name"`     // 用户昵称
	Gender           int    `json:"gender"`   // 性别 1-男;2-女
	Portrait         string `json:"portrait"` // 头像
	CurrentSubjectId int64  `json:"current_subject_id"`
	StudyTotalDay    int    `json:"study_total_day"`
	StudyNum         int    `json:"study_num"`
}

type ReSubjectStudyReq

type ReSubjectStudyReq struct {
	ID int64 `json:"id" validate:"required"`
}

type StateAmount

type StateAmount struct {
	State  int
	Amount int
}

type StudyDateCountReq

type StudyDateCountReq struct {
	StartTime int64 `form:"start_time" validate:"gt=0"`
}

type StudyDateCountResp

type StudyDateCountResp struct {
	DateCountList []*DateCount `json:"date_count_list"`
}

type StudyDoingReq

type StudyDoingReq struct {
	SubjectID   int64 `json:"subject_id" validate:"gt=0"`
	KnowledgeID int64 `json:"knowledge_id" validate:"gt=0"`
	State       int   `json:"state"`
}

type StudyDoingResp

type StudyDoingResp struct {
	IsCompletedToday bool `json:"is_completed_today"`
}

type StudyKnowledgeItem

type StudyKnowledgeItem struct {
	ID          int64      `json:"id"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Other       OtherField `json:"other"`
}

type StudyKnowledgeReq

type StudyKnowledgeReq struct {
	SubjectID int64 `form:"subject_id" validate:"gt=0"`
}

type StudyKnowledgeResp

type StudyKnowledgeResp struct {
	List       []*StudyKnowledgeItem `json:"list"`
	HasStudied int                   `json:"has_studied"`
	HasMore    bool                  `json:"has_more"`
}

type StudyNumEditReq

type StudyNumEditReq struct {
	Num int `json:"num" validate:"required"`
}

type StudyRankResp

type StudyRankResp struct {
	Mine *TodayStudySortRespItem   `json:"mine"`
	List []*TodayStudySortRespItem `json:"list"`
}

type StudyRecord

type StudyRecord struct {
	SubjectID int64
	Count     int
}

type StudyRecordItem

type StudyRecordItem struct {
	SubjectID   int64  `json:"subject_id"`
	SubjectName string `json:"subject_name"`
	Studied     int    `json:"studied"`
	Total       int    `json:"total"`
}

type StudyRecordListResp

type StudyRecordListResp struct {
	List    []*StudyRecordItem `json:"list"`
	HasMore bool               `json:"has_more"`
}

type StudyRecordTable

type StudyRecordTable struct {
	model.BaseModel
	Uid         int64
	SubjectID   int64 // 题库id
	KnowledgeID int64 // 知识点id
	State       int
}

学习记录表

type StudySummaryReq

type StudySummaryReq struct {
	SubjectID int64 `form:"subject_id" validate:"gt=0"`
}

type StudySummaryResp

type StudySummaryResp struct {
	StudiedNum int `json:"studied_num"`
	ReStudyNum int `json:"restudy_num"`
	RemainNum  int `json:"remain_num"`
}

type SubjectDetailReq

type SubjectDetailReq struct {
	ID    int64 `form:"id" validate:"required"`
	Start int   `form:"start"`
	Limit int   `form:"limit"`
}

type SubjectItem

type SubjectItem struct {
	ID          int64  `json:"id"`
	UpdatedAt   int64  `json:"updated_at"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Total       int    `json:"total"`
}

type SubjectListResp

type SubjectListResp struct {
	Studying *SubjectItem   `json:"studying"`
	Others   []*SubjectItem `json:"others"`
}

type SubjectOpsCreateReq

type SubjectOpsCreateReq struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Enable      bool   `json:"enable"`
}

type SubjectOpsEditReq

type SubjectOpsEditReq struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Enable      bool   `json:"enable"`
}

type SubjectOpsItem

type SubjectOpsItem struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Total       int    `json:"total"`
	CreatedAt   int64  `json:"created_at"`
	UpdatedAt   int64  `json:"updated_at"`
	DeletedAt   int64  `json:"deleted_at"`
}

type SubjectOpsListReq

type SubjectOpsListReq struct {
	Range  string `form:"range"`
	Filter string `form:"filter"`
	Sort   string `form:"sort"`
}

type SubjectOpsListReqFilter

type SubjectOpsListReqFilter struct {
	Name string
}

type SubjectStudyReq

type SubjectStudyReq struct {
	ID int64 `json:"id" validate:"required"`
}

type SubjectTable

type SubjectTable struct {
	model.BaseModel
	Name        string // 题库名称
	Description string // 描述
	Total       int    // 题库总数量
}

题库表

type TodayStudySortRespItem

type TodayStudySortRespItem struct {
	Uid        int64  `json:"uid"`
	Name       string `json:"name"`
	Gender     int    `json:"gender"`
	Portrait   string `json:"portrait"`
	StudyTotal int    `json:"study_total"`
	Rank       int    `json:"rank"`
}

type UserProfileTable

type UserProfileTable struct {
	model.BaseModel
	Name             string    // 用户昵称
	Gender           int       // 性别
	Portrait         string    // 头像
	Openid           string    // WX用户openid
	SessionKey       string    // session_key
	CurrentSubjectId int64     // 当前学习题库
	StudyTotalDay    int       // 累计学习天数
	StudyLastTime    time.Time // 最近学习时间
	StudyNum         int       // 学习目标
}

type UserStudyRank

type UserStudyRank struct {
	Uid   int64
	Total int
}

Jump to

Keyboard shortcuts

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