MCPcopy Create free account
hub / github.com/dearcode/candy / set

Method set

store/friend.go:29–43  ·  view source on GitHub ↗

修改好友关系

(uid, fid int64, state meta.Relation, msg string)

Source from the content-addressed store, hash-verified

27
28// 修改好友关系
29func (f *friendDB) set(uid, fid int64, state meta.Relation, msg string) error {
30 key := UserFriendKey(uid, fid)
31
32 r := friendRelation{ID: fid, State: state, Msg: msg}
33 buf, err := json.Marshal(&r)
34 if err != nil {
35 return errors.Trace(err)
36 }
37
38 if err = f.db.Put(key, buf, nil); err != nil {
39 return errors.Trace(err)
40 }
41
42 return nil
43}
44
45func (f *friendDB) confirm(uid, fid int64) error {
46 key := UserFriendKey(uid, fid)

Callers 1

FriendMethod · 0.80

Calls 1

UserFriendKeyFunction · 0.85

Tested by

no test coverage detected