Commit 78b08abb authored by 杨培's avatar 杨培

增加 TipService,从此之后服务添加 Service 后缀。

parent 440e7462
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2019/12/31
* Time: 15:47
*/
namespace internalApi\ucenter;
use internalApi\base\Client;
/**
* 用户中心消息服务
*
* @package internalApi\ucenter
*/
class TipService extends Client
{
/**
* 检查指定键值是否已存在
*
* @param int $uid
* @param string $tip
* @return bool
*/
public static function has($uid, $tip) {
return self::invoke('/tip/has', func_get_args());
}
/**
* 设置指定键值为关闭
*
* @param int $uid
* @param string $tip
* @param string|int $valid 有效期,0代表永久有效
* 有效期支持三种格式<br>
* - 当天(自然天)有效,设置为 td 代表 this day,即过了今天失效<br>
* - 秒数,指定一个数字代表从当时往后的多少秒有效<br>
* - 混合标识,可用内置的一堆词组合时长,目前支持的有 ymwdhis(年月周日时分秒),如 1y1w2d3h 代表1年1周2天3小时,可自由组合<br>
* 如果传递了有效期不符合所有规定,则默认为8秒有效期
*/
public static function set($uid, $tip, $valid=0) {
self::invoke('/tip/set', func_get_args());
}
/**
* 移除指定键的标记
*
* @param int|null $uid
* @param string $tip
*/
public static function remove($uid, $tip) {
self::invoke('/tip/remove', func_get_args());
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment