2025-11-21 14:49:09 +08:00

93 lines
2.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\weapp;
use app\service\admin\weapp\WeappVersionService;
use core\base\BaseAdminController;
use think\Response;
/**
* 小程序版本管理控制器
* @description 小程序版本管理
*/
class Version extends BaseAdminController
{
/**
* 列表
* @description 列表
* @return Response
*/
public function lists()
{
$data = $this->request->params([
]);
return success((new WeappVersionService())->getPage($data));
}
/**
* 详情
* @description 详情
* @param int $id
* @return Response
*/
public function info(int $id)
{
return success((new WeappVersionService())->getInfo($id));
}
/**
* 添加
* @description 添加
* @return Response
*/
public function add()
{
$data = $this->request->params([
['desc', ''],
['version', '']//特殊指定版本号
]);
return success(data:(new WeappVersionService())->add($data));
}
/**
* 获取预览码
* @description 获取预览码
* @return Response
*/
public function preview()
{
return success(data:(new WeappVersionService())->getPreviewImage());
}
/**
* 删除
* @description 删除
* @param int $id
* @return Response
*/
public function del(int $id)
{
(new WeappVersionService())->del($id);
return success('DELETE_SUCCESS');
}
/**
* 获取小程序上传日志
* @param string $key
* @return Response
*/
public function uploadLog(string $key) {
return success(data: (new WeappVersionService())->getUploadLog($key));
}
}