main.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package gift
  2. import (
  3. _ "bet24.com/log"
  4. pb "bet24.com/servers/micros/giftservice/proto"
  5. )
  6. func Run() {
  7. getGiftManager().run()
  8. }
  9. func Dump(cmd, param1 string) {
  10. getGiftManager().dump(cmd, param1)
  11. }
  12. func GetGiftList(userId int) []pb.Gift {
  13. return getGiftManager().getGiftList(userId)
  14. }
  15. func GetGiftListString(userId int) string {
  16. return getGiftManager().getGiftListString(userId)
  17. }
  18. func GetGift(giftId int, userId int) *pb.Gift {
  19. return getGiftManager().getGift(giftId, userId)
  20. }
  21. func GetUnclaimedGifts(userId int) []pb.UserGift {
  22. return getGiftManager().getUnclaimedGifts(userId)
  23. }
  24. func ClaimGift(userId int, rid int) string {
  25. return getGiftManager().claimGift(userId, rid)
  26. }
  27. func SendGift(userId, toUserId, giftId int) (int, string) {
  28. return getGiftManager().sendGift(userId, toUserId, giftId)
  29. }
  30. func SendGiftBulk(userId int, toUserIds []int, giftId, num int) (int, string, *pb.Gift) {
  31. return getGiftManager().sendGiftBulk(userId, toUserIds, giftId, num)
  32. }
  33. func CheckGiftCharge(userId int, productId string) bool {
  34. return getGiftManager().checkGiftCharge(userId, productId)
  35. }
  36. func CancelChargeGift(userId int, toUserId int, productId string) {
  37. getGiftManager().removeChargeInfo(userId, toUserId, productId)
  38. }
  39. func GetReceivedGiftRecord(userId int) string {
  40. return getGiftManager().getReceivedGiftRecord(userId)
  41. }