teacher.go 855 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package teacher
  2. import (
  3. "bet24.com/log"
  4. item "bet24.com/servers/micros/item_inventory/proto"
  5. )
  6. var mgr *teachermgr
  7. func Run() {
  8. log.Debug("teacher running")
  9. mgr = newTeacherMgr()
  10. }
  11. // 注册
  12. func Register(userId int) int {
  13. return mgr.register(userId)
  14. }
  15. // 信息
  16. func Info(teacherId int) *teacher {
  17. return mgr.info(teacherId)
  18. }
  19. // 绑定
  20. func Bind(studentId, teacherId, isSendMail int) (int, []item.ItemPack) {
  21. return mgr.bind(studentId, teacherId, isSendMail)
  22. }
  23. // 徒弟列表
  24. func Students(teacherId int) []*student {
  25. return mgr.students(teacherId)
  26. }
  27. // 收益列表
  28. func ProfitList(teacherId, days, pageIndex, pageSize int) (int, []*profit) {
  29. return mgr.profitList(teacherId, days, pageIndex, pageSize)
  30. }
  31. // 扣减收益
  32. func ReduceProfit(userId, profit, profitType int) int {
  33. return mgr.reduceProfit(userId, profit, profitType)
  34. }