大体接口

This commit is contained in:
Jerry Yan 2020-05-25 20:48:32 +08:00
parent cccadac9cc
commit 91d6258476
3 changed files with 59 additions and 1 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@
*.zip *.zip
/hyhproject/common/conf/database.php /hyhproject/common/conf/database.php
*.DS_Store *.DS_Store
/runtime/ /runtime/
/static

View File

@ -0,0 +1,57 @@
<?php
namespace wstmart\app\controller;
class Note extends Base
{
public function index(){
$userId = (int)session('WST_USER.userId');
}
public function detail(){
$userId = (int)session('WST_USER.userId');
if(($id = (int)input( 'id', 0)) > 0){
return WSTReturn("", 1, [
"id"=>$id,
"create_time"=>"昨天",
"title"=>"标题",
"content"=>"内容",
]);
}
return WSTReturn("异常请求",0);
}
public function save(){
$userId = (int)session('WST_USER.userId');
$id = (int)input( 'post.id', 0);
$title = input("post.title");
$content = input("post.content");
if(empty($title)) return WSTReturn("请填写标题",0);
if(empty($content)) return WSTReturn("请填写内容",0);
if($id > 0){
return WSTReturn("成功", 1);
}elseif($id == 0){
return WSTReturn("成功", 1);
}
return WSTReturn("异常请求",0);
}
public function creditIndex(){
$userId = (int)session('WST_USER.userId');
}
public function creditDetail(){
}
public function creditCreate(){
}
public function creditAdd(){
}
}

Binary file not shown.