既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
PassingGrade string `json:"passing\_grade" gorm:"not null;comment:及格分"`
ExamDuration string `json:"exam\_duration" gorm:"not null;comment:考试时长"`
NumberOfPoints string `json:"number\_of\_points" gorm:"comment:积分数量"`
MinimumSubmissionTime string `json:"minimum\_submission\_time" gorm:"comment:最低交卷时长"`
NotesOnExam string `json:"notes\_on\_exam" gorm:"comment:考前注意事项"`
Password string `json:"password" gorm:"comment:口令密码"`
State string `json:"state" gorm:"default:正常;comment:状态"`
ExamState string `json:"exam\_state" gorm:"index;comment:考试状态"`
ExamPermissionDetail string `json:"exam\_permission\_detail" gorm:"comment:考试权限"`
ExamTimeStart time.Time `json:"exam\_time\_start" gorm:"index;comment:考试开始时间"`
ExamTimeEnd time.Time `json:"exam\_time\_end" gorm:"index;comment:考试结束时间"`
LimitExamTime bool `json:"limit\_exam\_time" gorm:"comment:限制考试时间"`
ExamTypeID uint `json:"exam\_type\_id" gorm:"not null;comment:考试类型"`
TotalScore uint `json:"total\_score" gorm:"comment:考试总分"`
SysUserID uint `json:"sys\_user\_id" gorm:"comment:指定人员Id"`
ExamCreatedBy uint `json:"exam\_created\_by" gorm:"comment:考试创建人"`
ExamPaperID uint `json:"exam\_paper\_id" gorm:"comment:试卷Id"`
DeptID uint `json:"dept\_id" gorm:"comment:考试所属部门"`
ExamPaper ExamPaper `json:"exam\_paper" `
}
### 将考试基本信息以及试卷信息存入Redis
var ExamId uint
global.GVA_DB.Model(&exam.Exam{}).Select("id").Find(&ExamId)
var ExamInfo exam.Exam
//准备将查到的ExamInfo存入Redis中
global.GVA_DB.Model(&exam.Exam{}).Where("id = ?", ExamId).First(&ExamInfo)
// 过期时间=这场考试的开始时间-这场考试的结束时间
passingDuration := ExamInfo.ExamTimeEnd.Sub(ExamInfo.ExamTimeStart)
//将要存入redis的结构体序列化一下
jsonExamInfo, _ := json.Marshal(ExamInfo)
//使用Hash数据结构存入结构体
err = global.GVA_REDIS.HSet(c, "ExamInfo", string(ExamId), jsonExamInfo).Err()
if err != nil {
return errors2.New("考试信息加入Redis缓存失败")
}
// 给存入redis的hash元素加入过期时间
global.GVA_REDIS.Expire(c, "ExamInfo:string(ExamId)", passingDuration)
### 存入redis的核心代码
1. 先将结构体序列化
var ExamInfo exam.Exam
jsonExamInfo, _ := json.Marshal(ExamInfo)
2. 使用hash数据结构存储结构体(key:“ExamInfo”,field: string(ExamId), value:jsonExamInfo)
err = global.GVA_REDIS.HSet(c, “ExamInfo”, string(ExamId), jsonExamInfo).Err()
### 把结构体从redis中取出
1.先从redis中取出来数据
![img](https://img-blog.csdnimg.cn/img_convert/4d6976f2b9239374fadd12852d666070.png)
![img](https://img-blog.csdnimg.cn/img_convert/81df8127c3e7ed2ff1f6c822317afd01.png)
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**[需要这份系统化的资料的朋友,可以添加戳这里获取](https://bbs.csdn.net/topics/618658159)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**