feat: raising hand endpoint

This commit is contained in:
efim
2023-11-12 08:31:42 +00:00
parent 16df084928
commit 34d610a8c8
5 changed files with 122 additions and 7 deletions

View File

@@ -13,6 +13,16 @@ import (
type PersonId int
func (p PersonId) MarshalBinary() ([]byte, error) {
bytes, err := json.Marshal(p)
return bytes, err
}
func (p *PersonId) UnmarshalBinary(data []byte) error {
err := json.Unmarshal(data, p)
return err
}
// TODO move to rooms i guess
func RandomPersonId() PersonId {
randInt := rand.Int()
@@ -81,6 +91,7 @@ func (redisRM RedisRM) Update(ctx context.Context, roomName string, f func(fromR
return err
}
savedRoom.InitMaps()
room := f(savedRoom)
_, err = tx.Pipelined(ctx, func(pipe redis.Pipeliner) error {