base_controller.go 956B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package controllers
  2. import (
  3. "XT_Admin_Api/service"
  4. "github.com/astaxie/beego"
  5. "fmt"
  6. )
  7. type BaseController struct {
  8. beego.Controller
  9. }
  10. func (this *BaseController) GetAdminUserInfo() *service.AdminUserInfo {
  11. userInfo := this.GetSession("admin_user_info")
  12. fmt.Println("12")
  13. if userInfo == nil {
  14. return nil
  15. } else {
  16. return userInfo.(*service.AdminUserInfo)
  17. }
  18. }
  19. func (this *BaseController) ErrorLog(format string, a ...interface{}) {
  20. //beego.Error(fmt.Sprintf(format, a...))
  21. }
  22. func (this *BaseController) WarnLog(format string, a ...interface{}) {
  23. //beego.Warn(fmt.Sprintf(format, a...))
  24. }
  25. func (this *BaseController) InfoLog(format string, a ...interface{}) {
  26. //beego.Info(fmt.Sprintf(format, a...))
  27. }
  28. func (this *BaseController) DebugLog(format string, a ...interface{}) {
  29. //beego.Debug(fmt.Sprintf(format, a...))
  30. }
  31. func (this *BaseController) TraceLog(format string, a ...interface{}) {
  32. //beego.Trace(fmt.Sprintf(format, a...))
  33. }