first commit

This commit is contained in:
编码猿
2024-09-27 01:32:49 +08:00
commit 28ebe05a64
7399 changed files with 1174529 additions and 0 deletions

View File

@@ -0,0 +1,97 @@
<?php
/**
* Created by PhpStorm && wx_lql
* Welfares.php in Project yifu => 文件描述
* 2019/8/7 11:05
*
*  ┏┓  ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃       ┃  
* ┃   ━   ┃ ++ + + +
*
* ████━████ ┃+
* ┃       ┃ +
* ┃   ┻   ┃
* ┃       ┃ + +
* ┗━┓   ┏━┛
*   ┃   ┃           
*   ┃   ┃ + + + +
*   ┃   ┃
*   ┃   ┃ + 神兽保佑
*   ┃   ┃ 代码无bug  
*   ┃   ┃  +         
*   ┃    ┗━━━┓ + +
*   ┃      ┣┓
*   ┃      ┏┛
*   ┗┓┓┏━┳┓┏┛ + + + +
*    ┃┫┫ ┃┫┫
*   ┗┻┛ ┗┻┛+ + + +
*/
namespace app\api\controller;
class VersionController extends ApiController
{
/**
* @apiDefine Version 版本管理
*/
/**
* 不需要鉴权方法
* index、save不需要鉴权
* ['index','save']
* 所有方法都不需要鉴权
* [*]
*/
protected $noAuth = ['index'];
/**
* @apiVersion 1.0.0
* @api {get} /version/index 版本更新检测(朱晓伟)
* @apiName index
* @apiGroup Version
* @apiParam {String} [version] 当前版本号用于版本对比例如1.0.0,只允许使用"."分割,不支持下划线
* @apiSuccessExample Success-Response:
* {
* "code": 200,
* "message": "成功",
* "data": {
* "version": 1.0.1,
* "url": "http://www.baidu.com",
* "describe": "有重大更新啦!!",
* "update_method": 0,// 更新方式0:普通更新1、强制更新
* }
* }
* @apiErrorExample Error-Response:
* {
* "code": 200,
* "message": "无更新",
* "data": {}
* }
*/
public function index()
{
$new_version = '1.4.0';
$version =input('param.version');
$ret['isUpdate'] = false;
$ret['update_method'] = false;
if(version_compare($new_version,$version) > 0){
$data['version'] = $new_version;
$data['url'] = 'itms-apps://apps.apple.com/cn/app/qq-2011/id444934666';
$data['describe'] = '1.修复已知bug;
2.细节优化;';
$ret['iOS'] = $data;
$data['version'] = $new_version;
$data['url'] = 'http://d.firim.info/aw7u';
$data['describe'] = '1.修复已知bug;
2.细节优化;';
$ret['Android'] = $data;
$ret['isUpdate'] = true;
$ret['update_method'] = true;
return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'), $ret);
}
return self::returnMsg(self::SUCCESS, '无更新',$ret);
}
}