update niucloud

This commit is contained in:
全栈小学生
2024-06-15 15:36:09 +08:00
parent 7e5030ae3b
commit a4ed423b4c
160 changed files with 5169 additions and 802 deletions

View File

@@ -0,0 +1,57 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\wxoplatform;
use app\service\admin\wechat\WechatConfigService;
use app\service\admin\wxoplatform\OplatformConfigService;
use core\base\BaseAdminController;
use think\Response;
class Config extends BaseAdminController
{
/**
* 获取微信开放平台开放平台配置信息
* @return Response
*/
public function get()
{
return success((new OplatformConfigService())->getConfig());
}
/**
* 设置微信开放平台配置信息
* @return Response
*/
public function set()
{
$data = $this->request->params([
['app_id', ''],
['app_secret', ''],
['token', ''],
['aes_key', ''],
['develop_app_id', ''],
['develop_upload_private_key', '']
]);
(new OplatformConfigService())->setConfig($data);
return success('SET_SUCCESS');
}
/**
* 获取微信开放平台静态资源
* @return Response
*/
public function static()
{
return success((new OplatformConfigService())->getStaticInfo());
}
}

View File

@@ -0,0 +1,40 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\wxoplatform;
use app\service\admin\wxoplatform\OplatformService;
use core\base\BaseAdminController;
use think\Response;
class Oplatform extends BaseAdminController
{
/**
* 获取授权链接
* @return Response
*/
public function getAuthorizationUrl()
{
return success(data:(new OplatformService())->createPreAuthorizationUrl());
}
/**
* 授权
* @return Response
*/
public function authorization() {
$data = $this->request->params([
['auth_code', ''],
['expires_in', ''],
]);
return success((new OplatformService())->authorization($data));
}
}

View File

@@ -0,0 +1,46 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\wxoplatform;
use app\service\admin\wxoplatform\OplatformServerService;
use core\base\BaseAdminController;
use think\Response;
class Server extends BaseAdminController
{
/**
* 微信开放平台授权事件接收
* @return Response
*/
public function server()
{
ob_clean();
$result = (new OplatformServerService())->server();
return response($result->getBody())->header([
'Content-Type' => 'text/plain;charset=utf-8'
]);
}
/**
* 微信开放平台消息与事件接收
* @param string $appid
* @return Response
*/
public function message(string $appid) {
ob_clean();
$result = (new OplatformServerService())->message($appid);
return response($result->getBody())->header([
'Content-Type' => 'text/plain;charset=utf-8'
]);
}
}

View File

@@ -0,0 +1,49 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\wxoplatform;
use app\service\admin\wxoplatform\WeappVersionService;
use core\base\BaseAdminController;
use think\Response;
class WeappVersion extends BaseAdminController
{
/**
* 平台提交小程序版本
* @return Response
*/
public function weappCommit() {
(new WeappVersionService())->add();
return success();
}
/**
* 获取最后一次提交记录
* @return Response
*/
public function lastCommitRecord() {
return success(data:(new WeappVersionService())->getLastCommitRecord());
}
public function commitRecord() {
return success(data:(new WeappVersionService())->getPage());
}
/**
* 站点小程序提交
* @return Response
*/
public function siteWeappCommit() {
(new WeappVersionService())->siteWeappCommit();
return success();
}
}