live.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package assist
  2. import (
  3. "context"
  4. "go-common/library/log"
  5. )
  6. // LiveStatus get user assist rights about liveRoom
  7. func (s *Service) LiveStatus(c context.Context, mid int64, ip string) (open int8, err error) {
  8. if open, err = s.assist.LiveStatus(c, mid, ip); err != nil {
  9. log.Error("s.assist.HasLiveRight mid(%d), ip(%s)", mid, ip)
  10. return
  11. }
  12. return
  13. }
  14. // liveAddAssist add assist to live
  15. // Notice: 这里是新账号系统的Demo
  16. func (s *Service) liveAddAssist(c context.Context, mid, assistMid int64, ak, ck, ip string) (err error) {
  17. identified, _ := s.acc.IdentifyInfo(c, mid, 1, ip)
  18. if err = s.acc.CheckIdentify(identified); err != nil {
  19. log.Error("s.acc.IdentifyInfo mid(%d),ip(%s)", mid, ip)
  20. return
  21. }
  22. if err = s.assist.LiveAddAssist(c, mid, assistMid, ck, ip); err != nil {
  23. return
  24. }
  25. return
  26. }
  27. // liveDelAssist del assist to live
  28. func (s *Service) liveDelAssist(c context.Context, mid, assistMid int64, ck, ip string) (err error) {
  29. if err = s.assist.LiveDelAssist(c, mid, assistMid, ck, ip); err != nil {
  30. return
  31. }
  32. return
  33. }
  34. // LiveCheckAssist check if is assist in live
  35. func (s *Service) LiveCheckAssist(c context.Context, mid, assistMid int64, ip string) (isAss int8, err error) {
  36. if isAss, err = s.assist.LiveCheckAssist(c, mid, assistMid, ip); err != nil {
  37. return
  38. }
  39. return
  40. }
  41. // LiveRevocBanned revoke banned in live
  42. func (s *Service) LiveRevocBanned(c context.Context, mid int64, banID, ck, ip string) (err error) {
  43. if err = s.assist.LiveBannedRevoc(c, mid, banID, ck, ip); err != nil {
  44. return
  45. }
  46. return
  47. }