调整接口
parent
06a0407d11
commit
01844680ff
|
|
@ -5,6 +5,8 @@ namespace App\Http\Controllers;
|
||||||
use App\Helpers\Paginator;
|
use App\Helpers\Paginator;
|
||||||
use App\Http\Requestes\AdminRoleRequest;
|
use App\Http\Requestes\AdminRoleRequest;
|
||||||
use App\Http\Resources\AdminRoleResource;
|
use App\Http\Resources\AdminRoleResource;
|
||||||
|
use App\Services\OperationLogService;
|
||||||
|
use App\Enums\OperationType;
|
||||||
use App\Models\AdminRole;
|
use App\Models\AdminRole;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
@ -39,6 +41,7 @@ class AdminRoleController extends Controller
|
||||||
|
|
||||||
return $this->error('添加失败,请稍后再试');
|
return $this->error('添加失败,请稍后再试');
|
||||||
}
|
}
|
||||||
|
(new OperationLogService())->inLog(OperationType::Create, '', $role, $request->input());
|
||||||
|
|
||||||
return $this->success('添加成功');
|
return $this->success('添加成功');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ class CropYieldResource extends JsonResource
|
||||||
'yield' => $this->yield,
|
'yield' => $this->yield,
|
||||||
'output' => $this->output,
|
'output' => $this->output,
|
||||||
'cultivated' => $this->cultivated,
|
'cultivated' => $this->cultivated,
|
||||||
|
'extends' => $this->extends,
|
||||||
'created_by' => $this->whenLoaded('createdBy', function () {
|
'created_by' => $this->whenLoaded('createdBy', function () {
|
||||||
return $this->createdBy?->name;
|
return $this->createdBy?->name;
|
||||||
}, ''), //录入人
|
}, ''), //录入人
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ namespace App\Providers;
|
||||||
use App\Services\LinkosService;
|
use App\Services\LinkosService;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
|
@ -32,5 +33,19 @@ class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
Schema::defaultStringLength(191);
|
Schema::defaultStringLength(191);
|
||||||
|
|
||||||
|
Relation::morphMap([
|
||||||
|
'user' => \App\Models\AdminUser::class,
|
||||||
|
'role' => \App\Models\AdminRole::class,
|
||||||
|
'agricultura_base' => \App\Models\AgriculturalBase::class,
|
||||||
|
'crop' => \App\Models\Crop::class,
|
||||||
|
'crop_yield' => \App\Models\CropYield::class,
|
||||||
|
'device' => \App\Models\Device::class,
|
||||||
|
'friend_link' => \App\Models\FriendLink::class,
|
||||||
|
'rice_shrimp_price' => \App\Models\RiceShrimpPrice::class,
|
||||||
|
'rice_shrimp_flow' => \App\Models\RiceShrimpFlow::class,
|
||||||
|
'rice_shrimp_industry' => \App\Models\RiceShrimpIndustry::class,
|
||||||
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,13 @@ class EndpointPermissionSeeder extends Seeder
|
||||||
]],
|
]],
|
||||||
'base_data' => ['name' => '基础数据管理', 'curd' => false, 'children' => [
|
'base_data' => ['name' => '基础数据管理', 'curd' => false, 'children' => [
|
||||||
'citydata_statistics' => ['name' => '全市基础数据', 'curd' => ['index', 'edit']],
|
'citydata_statistics' => ['name' => '全市基础数据', 'curd' => ['index', 'edit']],
|
||||||
|
//全市基础数据
|
||||||
'agricultural_basic' => ['name' => '基地数据', 'curd' => true],
|
'agricultural_basic' => ['name' => '基地数据', 'curd' => true],
|
||||||
'town-street' => ['name' => '城镇数据', 'curd' => true],
|
'town_street' => ['name' => '城镇数据', 'curd' => true],
|
||||||
|
//农作物数据
|
||||||
'crops' => ['name' => '基地农作物', 'curd' => true],
|
'crops' => ['name' => '基地农作物', 'curd' => true],
|
||||||
'town-crops' => ['name' => '镇街农作物', 'curd' => true],
|
'town_crops' => ['name' => '镇街农作物', 'curd' => true],
|
||||||
|
//农作物产量
|
||||||
'crops_output' => ['name' => '基地产量', 'curd' => true],
|
'crops_output' => ['name' => '基地产量', 'curd' => true],
|
||||||
'town_crops_output' => ['name' => '镇街产量', 'curd' => true],
|
'town_crops_output' => ['name' => '镇街产量', 'curd' => true],
|
||||||
// 'crops_flow' => ['name' => '农产品流向', 'curd' => true],
|
// 'crops_flow' => ['name' => '农产品流向', 'curd' => true],
|
||||||
|
|
@ -47,7 +50,7 @@ class EndpointPermissionSeeder extends Seeder
|
||||||
'edit_password' => '修改密码', 'enable' => '启用/禁用',
|
'edit_password' => '修改密码', 'enable' => '启用/禁用',
|
||||||
]],
|
]],
|
||||||
'admin_roles' => ['name' => '角色管理', 'curd' => true],
|
'admin_roles' => ['name' => '角色管理', 'curd' => true],
|
||||||
'operation_log' => ['name' => '操作日志', 'curd' => ['index']],
|
// 'operation_log' => ['name' => '操作日志', 'curd' => ['index']],
|
||||||
]],
|
]],
|
||||||
]]
|
]]
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue