Skip to content

Commit 37f7138

Browse files
authored
Update Document.php
1 parent cd4bdd6 commit 37f7138

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Document.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Document
1010

1111
private static $item = 0;
1212

13+
1314
public function add()
1415
{
1516
$debug_backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1];
@@ -82,6 +83,10 @@ public function generate()
8283
$this->setReturn('');
8384
}
8485

86+
if(!array_key_exists('updateAt', $this->getLocalDocument())){
87+
$this->setUpdateAt(null);
88+
}
89+
8590
if(!array_key_exists('param', $this->getLocalDocument())){
8691
$this->set('param', array());
8792
}else{
@@ -225,6 +230,14 @@ public function setReturn($return)
225230
return $this->set('return', $return);
226231
}
227232

233+
/**
234+
* 设置更新时间
235+
*/
236+
public function setUpdateAt(?\DateTimeInterface $dateTime)
237+
{
238+
return $this->set('updateAt', $dateTime);
239+
}
240+
228241
/**
229242
* 添加接口参数
230243
*
@@ -279,4 +292,4 @@ public function addPostParam($name, $comment = '', $type = 'string', $is_null =
279292
{
280293
return $this->addParam($name, $comment, $type, $is_null, $default, $explain, 'post');
281294
}
282-
}
295+
}

0 commit comments

Comments
 (0)