from django.urls import path
from . import views

app_name = 'core'

urlpatterns = [
    path('', views.index, name='index'),
    path('trade/<str:trade_type>/', views.trade, name='trade'),
    path('spot/', views.trade, {'trade_type': 'spot'}, name='spot_trade'),
    path('contract/', views.trade, {'trade_type': 'contract'}, name='contract_trade'),
    path('markets/', views.market_center, name='market_center'),
    path('profile/', views.profile, name='profile'),
    path('deposit/', views.deposit, name='deposit'),
    path('withdraw/', views.withdraw, name='withdraw'),
    path('verify/', views.verify, name='verify'),
    path('login/', views.login_view, name='login'),
    path('register/', views.register_view, name='register'),
    path('api/market_data/', views.market_data, name='market_data'),
    path('api/submit_order/', views.submit_order, name='submit_order'),
    path('api/close_position/<int:position_id>/', views.close_position, name='close_position'),
    
    # Dynamic Article/Placeholder Route
    path('article/<str:title>/', views.placeholder_view, name='placeholder'),
    
    # Footer links
    path('help/', views.placeholder_view, {'title': '帮助中心'}, name='help_center'),
    path('support/', views.placeholder_view, {'title': '技术支持'}, name='support'),
    path('request/', views.placeholder_view, {'title': '提交请求'}, name='submit_request'),
    path('announcements/', views.placeholder_view, {'title': '公告中心'}, name='announcements'),
    path('assets/', views.profile, name='asset_management'),
]