base_controller.go 922B

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