chengkun
2025-05-20 f6f7bd25619ad0c0dfb5e609332e9fa1db419386
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
require_once(dirname(__FILE__) . '/' . 'GTRevoke.php');
require_once(dirname(__FILE__) . '/' . 'GTNotification.php');
 
class GTPushMessage extends GTApiRequest
{
    /**
     * 通知展示时间段,格式为毫秒时间戳段,两个时间的时间差必须大于10分钟,例如:"1590547347000-1590633747000"
     */
    private $duration;
 
    /**
     * 个推通知消息内容,与{@link #transmission}、{@link #revoke} 三选一
     */
    private $notification;
 
    /**
     * 透传消息内容,与{@link #notification}、{@link #revoke} 三选一
     */
    private $transmission;
 
    /**
     * 撤回消息,撤回消息不能与{@link #notification}和{@link #transmission}并存
     */
    private $revoke;
 
    public function getDuration()
    {
        return $this->duration;
    }
 
    public function setDuration($duration)
    {
        $this->duration = $duration;
        $this->apiParam["duration"] = $duration;
    }
 
    public function getNotification()
    {
        return $this->notification;
    }
 
    public function setNotification($notification)
    {
        $this->notification = $notification;
    }
 
    public function getTransmission()
    {
        return $this->transmission;
    }
 
    public function setTransmission($transmission)
    {
        $this->transmission = $transmission;
        $this->apiParam["transmission"] = $transmission;
    }
 
    public function getRevoke()
    {
        return $this->revoke;
    }
 
    public function setRevoke($revoke)
    {
        $this->revoke = $revoke;
    }
 
    public function getApiParam()
    {
        if ($this->notification != null){
            $this->apiParam["notification"] = $this->notification->getApiParam();
        }
        if ($this->revoke != null){
            $this->apiParam["revoke"] = $this->revoke->getApiParam();
        }
        return $this->apiParam;
    }
 
}