# coding=utf-8
from django.urls import path, re_path
from smartfarming.views.upload_file import FileUploadView

from smartfarming.views.user import (
    LoginAPIView, 
    LoginInfoAPIView, 
    LoginOutAPIView,
    RoleAPIView, 
    RoleAddAPIView, 
    RoleDelAPIView,
    RoleUpdateAPIView,
    UserListAPIView,
    UserUpdateAPIView,
    UserAddAPIView,
    UserDeleteAPIView,
    PerAPIView,
    CaptchaView,
    HomeThemeModelAPIView,
    HomeThemeModelListAPIView
)

from smartfarming.views.home_land import (
    BaseAPIView,
    BaseUpdateAPIView,
    MongoLandInfoAPIView,
    MongoLandInfoAddAPIView,
    MongoLandInfoUpdateAPIView,
    MongoLandInfoDeleteAPIView,
    MongoAreaJobDetailAPIView,
    MongoAreaJobAddAPIView,
    MongoPlantInfoAPIView,
    PlanDetailAPIView,
    MongoPlantInfoDeleteAPIView,
    MongoPlantInfoAddAPIView,
    MongoPlantInfoUpdateAPIView,
    MongoGrowOperateAPIView,
    MongoGrowOperateRecoveryAPIView,
    PlanWeekendAPIView,
    PlanWeekendDelete,
    PlanWeekendAddAPIView,
    CountryModelAPIView,
    CountryModelAddAPIView,
    CountryModelUpdateAPIView,
    CountryModelDeleteAPIView,
    LandPlanInfoAPIView
)

from smartfarming.views.device import (
    CbdScdXyDeviceSaveAPIView,
    DeviceListAPIView,
    DeviceChangeAPIView
)

from smartfarming.views.knowledge import (
    KnowledgeCategoryAPIView,
    KnowledgeCategoryAddAPIView,
    KnowledgeCategoryDeleteAPIView,
    KnowledgeCategoryUpdateAPIView,
    KnowledgeManageAPIView,
    KnowledgeManageAddAPIView,
    KnowledgeManageUpdateAPIView,
    KnowledgeManageDeleteAPIView,
    KnowledgeManageDetailAPIView,
    InformationAPIView,
    InformationAddAPIView,
    InformationUpdateAPIView,
    InformationDeleteAPIView
)


from smartfarming.views.pests_bank import PestBankAPIView


urlpatterns = [
    path('login',LoginAPIView.as_view()), # 登录
    path('captcha',CaptchaView.as_view()), # 登录验证码
    path('logout',LoginOutAPIView.as_view()), # 登出
    path('login_info',LoginInfoAPIView.as_view()), # 登录信息
    path('per',PerAPIView.as_view()), # 权限信息
    path('roles',RoleAPIView.as_view()),  # 角色 列表
    path('role_add', RoleAddAPIView.as_view()),  # 增加角色
    path('role_delete', RoleDelAPIView.as_view()),  # 删除角色 
    path('role_update', RoleUpdateAPIView.as_view()),  # 更新角色 
    path('users', UserListAPIView.as_view()),  # 用户列表
    path('user_update', UserUpdateAPIView.as_view()),  # 删除角色 
    path('user_add', UserAddAPIView.as_view()),  # 删除角色 
    path('user_delete', UserDeleteAPIView.as_view()),  # 删除角色 
    path('theme', HomeThemeModelListAPIView.as_view()),  # 主题列表 
    path('theme_add', HomeThemeModelAPIView.as_view()),  # 修改主题 
    path("upload_file", FileUploadView.as_view()),  # 上传图片
    
    path("base", BaseAPIView.as_view()),  # 基地列表
    path("base_update", BaseUpdateAPIView.as_view()),  # 基地修改
    path("land", MongoLandInfoAPIView.as_view()),  # 地块列表
    path("land_add", MongoLandInfoAddAPIView.as_view()),  # 地块新增
    path("land_update", MongoLandInfoUpdateAPIView.as_view()),  # 地块更新
    path("land_delete", MongoLandInfoDeleteAPIView.as_view()),  # 地块删除
    path("job", MongoAreaJobDetailAPIView.as_view()),  # 农事详情
    path("job_add", MongoAreaJobAddAPIView.as_view()),  # 农事新增
    path("plan", MongoPlantInfoAPIView.as_view()), # 作物列表
    path("plan_detail", PlanDetailAPIView.as_view()), # 作物详情
    path("plan_weekend", MongoPlantInfoAddAPIView.as_view()), # 作物新增
    path("plan_update", MongoPlantInfoUpdateAPIView.as_view()), # 作物更新
    path("plan_delete", MongoPlantInfoDeleteAPIView.as_view()), # 作物删除
    path("grow_add", MongoGrowOperateAPIView.as_view()),  # 种植新增
    path("grow_recovery", MongoGrowOperateRecoveryAPIView.as_view()),  # 种植采收
    path("weekend", PlanWeekendAPIView.as_view()),  # 生成周期列表
    path("weekend_add", PlanWeekendAddAPIView.as_view()),  # 生成周期增加
    path("weekend_delete", PlanWeekendDelete.as_view()),  # 生成周期删除
    path("device_add", CbdScdXyDeviceSaveAPIView.as_view()),  # 增加设备及数据接口  【提供给大数据平台】
    path("device", DeviceListAPIView.as_view()), # 设备列表
    path("device_update", DeviceChangeAPIView.as_view()), # 设备更新
    path("country", CountryModelAPIView.as_view()),  # 乡村列表
    path("country_add", CountryModelAddAPIView.as_view()),  # 乡村增加
    path("country_update", CountryModelUpdateAPIView.as_view()),  # 乡村编辑
    path("country_delete", CountryModelDeleteAPIView.as_view()),  # 乡村删除
    path("pest", PestBankAPIView.as_view()),  # 虫害列表
    path("plan_info", LandPlanInfoAPIView.as_view()), # 种植作物列表及统计

    path("knowledge", KnowledgeCategoryAPIView.as_view()),  # 知识分类列表
    path("knowledge_update", KnowledgeCategoryUpdateAPIView.as_view()),  # 知识分类编辑
    path("knowledge_add", KnowledgeCategoryAddAPIView.as_view()), # 知识分类新增
    path("knowledge_delete", KnowledgeCategoryDeleteAPIView.as_view()), # 知识分类删除
    path("manage", KnowledgeManageAPIView.as_view()),  # 知识信息列表
    path("manage_update", KnowledgeManageUpdateAPIView.as_view()),  # 知识信息编辑
    path("manage_add", KnowledgeManageAddAPIView.as_view()), # 知识信息新增
    path("manage_delete", KnowledgeManageDeleteAPIView.as_view()), # 知识信息删除
    path("manage_detail", KnowledgeManageDetailAPIView.as_view()), # 知识信息详情

    path("information", InformationAPIView.as_view()),  # 研判信息列表
    path("information_update", InformationUpdateAPIView.as_view()),  # 研判信息编辑
    path("information_add", InformationAddAPIView.as_view()), # 研判信息新增
    path("information_delete", InformationDeleteAPIView.as_view()), # 研判信息删除
]
