添加剩余管理操作日志
parent
3850bcd0a3
commit
afe617a23b
|
|
@ -9,6 +9,8 @@ use App\Models\RiceShrimpIndustry;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||||
|
use App\Services\OperationLogService;
|
||||||
|
use App\Enums\OperationType;
|
||||||
|
|
||||||
class RiceShrimpIndustryController extends Controller
|
class RiceShrimpIndustryController extends Controller
|
||||||
{
|
{
|
||||||
|
|
@ -53,6 +55,8 @@ class RiceShrimpIndustryController extends Controller
|
||||||
$riceShrimpIndustry->updated_by = $user->id;
|
$riceShrimpIndustry->updated_by = $user->id;
|
||||||
$riceShrimpIndustry->save();
|
$riceShrimpIndustry->save();
|
||||||
|
|
||||||
|
(new OperationLogService())->inLog(OperationType::Create, '', $riceShrimpIndustry, $request->input());
|
||||||
|
|
||||||
return RiceShrimpIndustryResource::make(
|
return RiceShrimpIndustryResource::make(
|
||||||
$riceShrimpIndustry->setRelations([
|
$riceShrimpIndustry->setRelations([
|
||||||
'createdBy' => $user,
|
'createdBy' => $user,
|
||||||
|
|
@ -90,6 +94,8 @@ class RiceShrimpIndustryController extends Controller
|
||||||
|
|
||||||
$riceShrimpIndustry->save();
|
$riceShrimpIndustry->save();
|
||||||
|
|
||||||
|
(new OperationLogService())->inLog(OperationType::Update, '', $riceShrimpIndustry, $request->input());
|
||||||
|
|
||||||
return RiceShrimpIndustryResource::make(
|
return RiceShrimpIndustryResource::make(
|
||||||
$riceShrimpIndustry->loadMissing(['createdBy', 'updatedBy'])
|
$riceShrimpIndustry->loadMissing(['createdBy', 'updatedBy'])
|
||||||
);
|
);
|
||||||
|
|
@ -107,6 +113,8 @@ class RiceShrimpIndustryController extends Controller
|
||||||
|
|
||||||
$riceShrimpIndustry->delete();
|
$riceShrimpIndustry->delete();
|
||||||
|
|
||||||
|
(new OperationLogService())->inLog(OperationType::Delete, '', $riceShrimpIndustry);
|
||||||
|
|
||||||
return response()->json(null);
|
return response()->json(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ use App\Models\RiceShrimpPrice;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||||
|
use App\Services\OperationLogService;
|
||||||
|
use App\Enums\OperationType;
|
||||||
|
|
||||||
class RiceShrimpPriceController extends Controller
|
class RiceShrimpPriceController extends Controller
|
||||||
{
|
{
|
||||||
|
|
@ -55,6 +57,8 @@ class RiceShrimpPriceController extends Controller
|
||||||
'updatedBy' => $user,
|
'updatedBy' => $user,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
(new OperationLogService())->inLog(OperationType::Create, '', $riceShrimpPrice, $request->input());
|
||||||
|
|
||||||
return RiceShrimpPriceResource::make($riceShrimpPrice);
|
return RiceShrimpPriceResource::make($riceShrimpPrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,6 +89,8 @@ class RiceShrimpPriceController extends Controller
|
||||||
|
|
||||||
$riceShrimpPrice->save();
|
$riceShrimpPrice->save();
|
||||||
|
|
||||||
|
(new OperationLogService())->inLog(OperationType::Update, '', $riceShrimpPrice, $request->input());
|
||||||
|
|
||||||
return RiceShrimpPriceResource::make(
|
return RiceShrimpPriceResource::make(
|
||||||
$riceShrimpPrice->loadMissing(['createdBy', 'updatedBy'])
|
$riceShrimpPrice->loadMissing(['createdBy', 'updatedBy'])
|
||||||
);
|
);
|
||||||
|
|
@ -102,6 +108,8 @@ class RiceShrimpPriceController extends Controller
|
||||||
|
|
||||||
$riceShrimpPrice->delete();
|
$riceShrimpPrice->delete();
|
||||||
|
|
||||||
|
(new OperationLogService())->inLog(OperationType::Delete, '', $riceShrimpPrice);
|
||||||
|
|
||||||
return response()->json(null);
|
return response()->json(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Requestes\RestPasswordRequest;
|
use App\Http\Requestes\RestPasswordRequest;
|
||||||
|
use App\Services\OperationLogService;
|
||||||
|
use App\Enums\OperationType;
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
|
|
@ -21,6 +23,9 @@ class UserController extends Controller
|
||||||
$user->password = bcrypt($input['password']);
|
$user->password = bcrypt($input['password']);
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
|
$statusMsg = '修改密码';
|
||||||
|
(new OperationLogService())->inLog(OperationType::Update, $statusMsg.'-用户【'.$user->name.'】');
|
||||||
|
|
||||||
//退出所有端
|
//退出所有端
|
||||||
$user->tokens()->delete();
|
$user->tokens()->delete();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue