作者 lyh

gx

... ... @@ -11,15 +11,19 @@ use Illuminate\Http\Request;
use function App\Helper\send_openai_msg;
/**
* @name:ai指令
* @remark :ai指令
* @name :AiCommandController
* @author :lyh
* @time :2023/6/17 16:27
*/
class AiCommandController extends BaseController
{
/**
* @name :指令列表
* @return void
* @author :liyuhang
* @method
* @param AiCommandModel $aiCommandModel
* @name :lists
* @author :lyh
* @method :post
* @time :2023/6/17 16:27
*/
public function lists(AiCommandModel $aiCommandModel){
$lists = $aiCommandModel->lists($this->map,$this->page,$this->row,$this->order);
... ... @@ -27,10 +31,11 @@ class AiCommandController extends BaseController
}
/**
* @name :详情
* @return void
* @author :liyuhang
* @method
* @param AiCommandLogic $aiCommandLogic
* @name :info
* @author :lyh
* @method :post
* @time :2023/6/17 16:27
*/
public function info(AiCommandLogic $aiCommandLogic){
$this->request->validate([
... ... @@ -41,11 +46,14 @@ class AiCommandController extends BaseController
$aiCommandLogic->ai_info();
$this->response('success');
}
/**
* @name
* @return void
* @author :liyuhang
* @method
* @param AiCommandRequest $request
* @param AiCommandLogic $aiCommandLogic
* @name :add
* @author :lyh
* @method :post
* @time :2023/6/17 16:27
*/
public function add(AiCommandRequest $request,AiCommandLogic $aiCommandLogic){
$request->validated();
... ... @@ -54,10 +62,12 @@ class AiCommandController extends BaseController
}
/**
* @name
* @return void
* @author :liyuhang
* @method
* @param AiCommandRequest $request
* @param AiCommandLogic $aiCommandLogic
* @name :edit
* @author :lyh
* @method :post
* @time :2023/6/17 16:28
*/
public function edit(AiCommandRequest $request,AiCommandLogic $aiCommandLogic){
$request->validate([
... ... @@ -70,10 +80,11 @@ class AiCommandController extends BaseController
}
/**
* @name
* @return void
* @author :liyuhang
* @method
* @param AiCommandLogic $aiCommandLogic
* @name :del
* @author :lyh
* @method :post
* @time :2023/6/17 16:27
*/
public function del(AiCommandLogic $aiCommandLogic){
$this->request->validate([
... ...
... ... @@ -6,14 +6,20 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Models\Ai\AiLog as AiLogModel;
/**
* @remark :ai发送记录
* @name :AiLogController
* @author :lyh
* @time :2023/6/17 16:26
*/
class AiLogController extends BaseController
{
/**
* @name :ai日志列表
* @return void
* @author :liyuhang
* @method
* @param AiLogModel $aiLogModel
* @name :(ai发送日志列表)lists
* @author :lyh
* @method :post
* @time :2023/6/17 16:25
*/
public function lists(AiLogModel $aiLogModel){
$lists = $aiLogModel->lists($this->map,$this->page,$this->row,$this->order);
... ...
... ... @@ -64,10 +64,13 @@ class BaseController extends Controller
$this->header['token'] = $this->token;
return response()->json($response,200,$this->header);
}
/**
* @name :参数过滤
* @author :liyuhang
* @method
* @remark :请求参数处理
* @name :get_param
* @author :lyh
* @method :post
* @time :2023/6/17 16:34
*/
public function get_param(){
$param = $this->param;
... ... @@ -105,11 +108,18 @@ class BaseController extends Controller
}
}
}
/**
* @name 统一返回参数
* @return JsonResponse
* @author :liyuhang
* @method
* @param $msg
* @param string $code
* @param $data
* @param $result_code
* @param $type
* @remark :统一返回
* @name :response
* @author :lyh
* @method :post
* @time :2023/6/17 16:34
*/
public function response($msg = null,string $code = Code::SUCCESS,$data = [],$result_code = 200,$type = 'application/json'): JsonResponse
{
... ... @@ -128,10 +138,11 @@ class BaseController extends Controller
/**
* @param $data
* @name :返回参数统一处理
* @return array|string
* @author :liyuhang
* @method
* @remark :统一返回参数处理
* @name :_extents
* @author :lyh
* @method :post
* @time :2023/6/17 16:34
*/
protected function _extents($data) {
... ... @@ -158,7 +169,5 @@ class BaseController extends Controller
}
... ...
... ... @@ -20,10 +20,11 @@ class MailController extends BaseController
}
/**
* @name :详情
* @return void
* @author :liyuhang
* @method
* @param MailLogic $mailLogic
* @name :info
* @author :lyh
* @method :post
* @time :2023/6/17 16:25
*/
public function info(MailLogic $mailLogic){
$this->request->validate([
... ... @@ -37,10 +38,12 @@ class MailController extends BaseController
/**
* @name :添加站内信
* @return void
* @author :liyuhang
* @method
* @param MailRequest $mailRequest
* @param MailLogic $mailLogic
* @name :add
* @author :lyh
* @method :post
* @time :2023/6/17 16:25
*/
public function add(MailRequest $mailRequest,MailLogic $mailLogic){
$mailRequest->validated();
... ... @@ -49,10 +52,12 @@ class MailController extends BaseController
}
/**
* @name :编辑站内信
* @return void
* @author :liyuhang
* @method
* @param MailRequest $mailRequest
* @param MailLogic $mailLogic
* @name :edit
* @author :lyh
* @method :post
* @time :2023/6/17 16:24
*/
public function edit(MailRequest $mailRequest,MailLogic $mailLogic){
$mailRequest->validate([
... ... @@ -65,10 +70,11 @@ class MailController extends BaseController
}
/**
* @name :逻辑删除站内信
* @return void
* @author :liyuhang
* @method
* @param MailLogic $mailLogic
* @name :del
* @author :lyh
* @method :post
* @time :2023/6/17 16:24
*/
public function del(MailLogic $mailLogic){
$this->request->validate([
... ...
... ... @@ -4,6 +4,12 @@ namespace App\Http\Controllers\Aside\User;
use App\Http\Controllers\Aside\BaseController;
/**
* @remark :b端用户组织架构
* @name :ProjectDeptController
* @author :lyh
* @time :2023/6/17 16:23
*/
class ProjectDeptController extends BaseController
{
/**
... ...
... ... @@ -10,6 +10,12 @@ use App\Models\User\ProjectMenu;
use App\Models\User\ProjectMenu as ProjectMenuModel;
use Illuminate\Http\Request;
/**
* @remark :b端菜单管理
* @name :ProjectMenuController
* @author :lyh
* @time :2023/6/17 16:23
*/
class ProjectMenuController extends BaseController
{
/**
... ...
... ... @@ -9,6 +9,12 @@ use App\Http\Requests\Aside\User\ProjectRoleRequest;
use App\Models\User\ProjectRole as ProjectRoleModel;
use Illuminate\Http\Request;
/**
* @remark :b端用户角色设置管理
* @name :ProjectRoleController
* @author :lyh
* @time :2023/6/17 16:22
*/
class ProjectRoleController extends BaseController
{
/**
... ...
... ... @@ -9,6 +9,12 @@ use App\Http\Requests\Aside\User\UserRequest;
use App\Models\User\User as UserModel;
use Illuminate\Http\Request;
/**
* @remark :b端用户管理
* @name :ProjectUserController
* @author :lyh
* @time :2023/6/17 16:24
*/
class ProjectUserController extends BaseController
{
/**
... ...
... ... @@ -108,8 +108,13 @@ class FileController
echo $content;
exit;
}
/**
* 图片上传
* @remark :上传文件
* @name :upload
* @author :lyh
* @method :post
* @time :2023/6/17 16:32
*/
public function upload() {
$this->request->validate([
... ... @@ -129,11 +134,14 @@ class FileController
return $this->single($files);
}
}
/**
* @name :上传
* @return void
* @author :liyuhang
* @method
* @param $files
* @remark :单文件上传
* @name :single
* @author :lyh
* @method :post
* @time :2023/6/17 16:32
*/
public function single($files){
$hash = hash_file('md5', $files->getPathname());
... ... @@ -162,10 +170,14 @@ class FileController
}
return $this->response('资源',Code::SUCCESS,['file'=>$hash]);
}
/**
* 多文件上传
* @param type $files file对象集合
* @return type
* @param $files
* @remark :多文件上传
* @name :multi
* @author :lyh
* @method :post
* @time :2023/6/17 16:32
*/
private function multi($files) {
if (!is_array($files)) {
... ... @@ -199,11 +211,18 @@ class FileController
$fileModel->insert($save_data);
return $this->response('资源',Code::SUCCESS,['file'=>$data]);
}
/**
* @name 统一返回参数
* @return JsonResponse
* @author :liyuhang
* @method
* @param $msg
* @param string $code
* @param $data
* @param $result_code
* @param $type
* @remark :统一返回接口
* @name :response
* @author :lyh
* @method :post
* @time :2023/6/17 16:33
*/
public function response($msg = null,string $code = Code::SUCCESS,$data = [],$result_code = 200,$type = 'application/json'): JsonResponse
{
... ... @@ -220,10 +239,11 @@ class FileController
/**
* @param $data
* @name :返回参数处理
* @return array|string
* @author :liyuhang
* @method
* @remark :参数处理
* @name :_extents
* @author :lyh
* @method :post
* @time :2023/6/17 16:32
*/
protected function _extents($data) {
... ...
... ... @@ -91,7 +91,10 @@ class ImageController
}
/**
* 图片上传
* @name :(图片上传)upload
* @author :lyh
* @method :post
* @time :2023/6/17 16:28
*/
public function upload() {
$this->request->validate([
... ... @@ -112,10 +115,12 @@ class ImageController
}
/**
* @name :上传图片
* @return void
* @author :liyuhang
* @method
* @param $files
* @remark :单图片上传
* @name :single
* @author :lyh
* @method :post
* @time :2023/6/17 16:30
*/
public function single($files){
$hash = hash_file('md5', $files->getPathname());
... ... @@ -144,12 +149,16 @@ class ImageController
}
return $this->response('图片资源',Code::SUCCESS,['image'=>$hash]);
}
/**
* 生成缩略图缓存
* @param type $info
* @param type $w
* @param type $h
* @return string
* @param $info
* @param $w
* @param $h
* @remark :生成缩略图
* @name :cacheImage
* @author :lyh
* @method :post
* @time :2023/6/17 16:31
*/
private function cacheImage($info, $w, $h) {
$path = $info['path'];
... ... @@ -159,9 +168,12 @@ class ImageController
}
/**
* 多图片上传
* @param type $files file对象集合
* @return type
* @param $files
* @remark :多图片上传
* @name :multi
* @author :lyh
* @method :post
* @time :2023/6/17 16:31
*/
private function multi($files) {
... ...