|
|
@ -1,7 +1,5 @@ |
|
|
|
package userrpc |
|
|
|
|
|
|
|
// "encoding/json"
|
|
|
|
|
|
|
|
/** |
|
|
|
* 绑定粉丝 |
|
|
|
* 2021/10/23 |
|
|
@ -9,5 +7,69 @@ package userrpc |
|
|
|
*/ |
|
|
|
func Fans(site_id, dbname, user_id, business_id string, url ...string) error { |
|
|
|
|
|
|
|
conn, err := rpc_server_conn(url...) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
defer conn.Close() |
|
|
|
|
|
|
|
data := FansReq{} |
|
|
|
data.SiteId = site_id |
|
|
|
data.Dbname = dbname |
|
|
|
data.UserId = user_id |
|
|
|
data.BusinessId = business_id |
|
|
|
data.Lock = false |
|
|
|
|
|
|
|
req, err := SetReqData(data) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
res := &Response{} |
|
|
|
|
|
|
|
err = conn.Fans(req, res) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
_, err = GetResData(res) |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 绑定粉丝 |
|
|
|
* 2021/10/23 |
|
|
|
* gz |
|
|
|
*/ |
|
|
|
func LockFans(site_id, dbname, user_id, business_id string, url ...string) error { |
|
|
|
|
|
|
|
conn, err := rpc_server_conn(url...) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
defer conn.Close() |
|
|
|
|
|
|
|
data := FansReq{} |
|
|
|
data.SiteId = site_id |
|
|
|
data.Dbname = dbname |
|
|
|
data.UserId = user_id |
|
|
|
data.BusinessId = business_id |
|
|
|
data.Lock = true |
|
|
|
|
|
|
|
req, err := SetReqData(data) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
res := &Response{} |
|
|
|
|
|
|
|
err = conn.Fans(req, res) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
_, err = GetResData(res) |
|
|
|
return nil |
|
|
|
} |