Compare commits

..

No commits in common. "3079d94f89bc75321e574e401214e21cc4f51a0a" and "69d661c8eabf1b19c865b6fab05d71a3be071838" have entirely different histories.

2 changed files with 0 additions and 35 deletions

View File

@ -295,13 +295,6 @@ func (r *Video) AddVideoVote(c *gin.Context) {
// 检测投票有效期
systemTimeService := service.SystemTimeService{}
isStartValid := systemTimeService.CheckVoteValidStartStatus()
if isStartValid == false {
responses.FailWithMessage("投票未开始", c)
return
}
// 检测投票有效期
isValid := systemTimeService.CheckVoteValidStatus()
if isValid == false {
responses.FailWithMessage("投票已结束", c)

View File

@ -51,31 +51,3 @@ func (r *SystemTimeService) CheckVoteValidStatus() bool {
return true
}
// CheckVoteValidStartStatus 检测投票有效期
// bool true:已开始 false:未开始
func (r *SystemTimeService) CheckVoteValidStartStatus() bool {
// 获取配置-时间
systemTimeDao := dao.SystemTimeDao{}
systemTime, err := systemTimeDao.GetSystemTimeById(1)
if err != nil {
return false
}
if systemTime.StartTime == nil {
return false
}
// 开始时间
startTime := time.Time(*systemTime.StartTime)
// 当前时间
now := time.Now()
// 如果当前时间在开始时间之后(或等于),说明已开始
if !now.Before(startTime) {
return true
}
return false
}