🎨 一堆杂七杂八的优化

This commit is contained in:
2025-09-01 21:30:10 +08:00
parent 3beb54c12c
commit 80decc222f
7 changed files with 71 additions and 17 deletions

View File

@@ -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)