🎨 一堆杂七杂八的优化
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
common "git.echol.cn/loser/lckt/model/common/request"
|
||||
"gorm.io/gorm"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -283,6 +284,11 @@ func (a *AppUserApi) GetTeacherApply(context *gin.Context) {
|
||||
}
|
||||
|
||||
status, err := appUserService.GetTeacherApplyStatus(id)
|
||||
// 判断是否是记录未找到的错误
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
r.OkWithMessage("暂无申请记录", context)
|
||||
return
|
||||
}
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("获取教师申请状态失败", zap.Error(err))
|
||||
r.FailWithMessage("获取教师申请状态失败", context)
|
||||
|
Reference in New Issue
Block a user