🎨 完善用户讲师申请接口,新增order模块
This commit is contained in:
@@ -5,8 +5,10 @@ import "git.echol.cn/loser/lckt/service"
|
||||
type ApiGroup struct {
|
||||
AppUserApi
|
||||
BannerApi
|
||||
OrderApi
|
||||
}
|
||||
|
||||
var userService = service.ServiceGroupApp.UserServiceGroup.UserService
|
||||
var appUserService = service.ServiceGroupApp.AppServiceGroup.AppUserService
|
||||
var bannerService = service.ServiceGroupApp.AppServiceGroup.BannerService
|
||||
var orderService = service.ServiceGroupApp.AppServiceGroup.OrderService
|
||||
|
3
api/v1/app/order.go
Normal file
3
api/v1/app/order.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package app
|
||||
|
||||
type OrderApi struct{}
|
@@ -270,3 +270,22 @@ func (a *AppUserApi) ApplyTeacher(context *gin.Context) {
|
||||
|
||||
r.OkWithMessage("申请成功", context)
|
||||
}
|
||||
|
||||
// GetTeacherApply 获取教师申请状态
|
||||
func (a *AppUserApi) GetTeacherApply(context *gin.Context) {
|
||||
id := user_jwt.GetUserID(context)
|
||||
if id == 0 {
|
||||
global.GVA_LOG.Error("获取用户ID失败")
|
||||
r.FailWithMessage("获取用户ID失败", context)
|
||||
return
|
||||
}
|
||||
|
||||
status, err := appUserService.GetTeacherApplyStatus(id)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("获取教师申请状态失败", zap.Error(err))
|
||||
r.FailWithMessage("获取教师申请状态失败", context)
|
||||
return
|
||||
}
|
||||
|
||||
r.OkWithDetailed(status, "获取教师申请状态成功", context)
|
||||
}
|
||||
|
Reference in New Issue
Block a user