用户接口远程调用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.1 KiB

3 years ago
  1. package userrpc
  2. /**
  3. * 绑定粉丝
  4. * 2021/10/23
  5. * gz
  6. */
  7. func Fans(site_id, dbname, user_id, business_id string, url ...string) error {
  8. conn, err := rpc_server_conn(url...)
  9. if err != nil {
  10. return err
  11. }
  12. defer conn.Close()
  13. data := FansReq{}
  14. data.SiteId = site_id
  15. data.Dbname = dbname
  16. data.UserId = user_id
  17. data.BusinessId = business_id
  18. data.Lock = false
  19. req, err := SetReqData(data)
  20. if err != nil {
  21. return err
  22. }
  23. res := &Response{}
  24. err = conn.Fans(req, res)
  25. if err != nil {
  26. return err
  27. }
  28. _, err = GetResData(res)
  29. return nil
  30. }
  31. /**
  32. * 绑定粉丝
  33. * 2021/10/23
  34. * gz
  35. */
  36. func LockFans(site_id, dbname, user_id, business_id string, url ...string) error {
  37. conn, err := rpc_server_conn(url...)
  38. if err != nil {
  39. return err
  40. }
  41. defer conn.Close()
  42. data := FansReq{}
  43. data.SiteId = site_id
  44. data.Dbname = dbname
  45. data.UserId = user_id
  46. data.BusinessId = business_id
  47. data.Lock = true
  48. req, err := SetReqData(data)
  49. if err != nil {
  50. return err
  51. }
  52. res := &Response{}
  53. err = conn.Fans(req, res)
  54. if err != nil {
  55. return err
  56. }
  57. _, err = GetResData(res)
  58. return nil
  59. }