新增档案管理模块商机分类子模块接口 #28

Merged
weiz merged 1 commits from zhangwei into dev 2023-11-11 14:20:21 +08:00
2 changed files with 99 additions and 0 deletions
Showing only changes of commit 541ed7fced - Show all commits

View File

@ -0,0 +1,21 @@
<?php
namespace app\adminapi\controller\archives;
use app\adminapi\controller\BaseAdminController;
class ArchivesController extends BaseAdminController
{
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
}

View File

@ -0,0 +1,78 @@
<?php
namespace app\adminapi\controller\archives;
use app\adminapi\controller\BaseAdminController;
use think\response\Json;
class BusinessController extends BaseAdminController
{
protected array $reqHeader = [];
public function initialize()
{
parent::initialize();
$this->reqHeader = [
"appid:".env('app.app_id'),
"timestamp:".time(),
"sign:".makeSign(['appid'=>env('app.app_id'),'timestamp'=>time()],env('app.app_secret'))
];
}
//商机分类列表
public function lists(): Json
{
$params = $this->request->get(['page_no','page_size','name','status']);
$result = curl_post(env('project.worker_domain').'/middleapi/business/lists',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//商机分类详情
public function detail(): Json
{
$params = $this->request->get(['id']);
if(empty($params['id'])){
return $this->fail('参数错误');
}
$result = curl_post(env('project.worker_domain').'/middleapi/business/detail',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//新增商机分类
public function create(): Json
{
$params = $this->request->post(['name','pid','sort','status']);
$result = curl_post(env('project.worker_domain').'/middleapi/business/create',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//编辑商机分类
public function edit(): Json
{
$params = $this->request->post(['id','name','pid','sort','status']);
$result = curl_post(env('project.worker_domain').'/middleapi/business/edit',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
//删除商机分类
public function delete(): Json
{
$params = $this->request->post(['id']);
$result = curl_post(env('project.worker_domain').'/middleapi/business/delete',$params,$this->reqHeader);
if($result['code'] == 0){
return $this->fail($result['msg']);
}
return json($result);
}
}