53 lines
1.1 KiB
PHP
53 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Common\cache\redis;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 福恋小程序接口 redis key
|
||
|
|
*/
|
||
|
|
class ApiRedisKey
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* 获取某个群聊未读人数集合
|
||
|
|
* @param int $team_id 群聊id
|
||
|
|
* @return string
|
||
|
|
*/
|
||
|
|
public static function getGroupChatUnreadKey(int $team_id): string
|
||
|
|
{
|
||
|
|
return "chat:group:unread:team_id_{$team_id}";
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 群聊回复上下文消息
|
||
|
|
* @param $team_id
|
||
|
|
* @param $user_id
|
||
|
|
* @return string
|
||
|
|
*/
|
||
|
|
public static function getGroupChatGptReplyKey($team_id,$user_id): string
|
||
|
|
{
|
||
|
|
return "chat:group:gpt_reply_context:team_id{$team_id}:{$user_id}";
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取首页弹框点击用户集合
|
||
|
|
* @param $id
|
||
|
|
* @return string
|
||
|
|
*/
|
||
|
|
public static function getHomePopoutClickUserKey($id): string
|
||
|
|
{
|
||
|
|
return "home_popout:id{$id}_click_user";
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 用户关注他人 关注锁
|
||
|
|
* @param $user_id
|
||
|
|
* @param $other_user_id
|
||
|
|
* @return string
|
||
|
|
*/
|
||
|
|
public static function getFollowOtherUserLock($user_id, $other_user_id): string
|
||
|
|
{
|
||
|
|
return sprintf("user:%s:follow:%s:lock", $user_id, $other_user_id);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|