# -*- coding: utf-8 -*-

from django.conf.urls import url

from account import views as account_views
from account import tourguide_views
from box import views as box_views
from geo import views as geo_views
from group import views as group_views
from group import (groupuser_views, lensman_views, tourguidegroup_views, tourguidegroupadmin_views,
                   tourguidegroupuser_views)
from message import views as message_views
from miniapp import views as mini_views
from operation import views as op_views
from pay import views as pay_views
from photo import views as photo_views
from server import server_views


# 帐户相关
urlpatterns = [
    url(r'^u/wx/authorize$', account_views.user_wx_authorize_api, name='user_wx_authorize_api'),  # 用户端 - 微信用户授权

    url(r'^u/guest/status$', op_views.guest_api, name='user_guest_status_api'),  # 用户端 - 微游客状态(是否开启)
    url(r'^u/guest/login$', account_views.user_guest_login_api, name='user_guest_login_api'),  # 用户端 - 微游客登录
]

# 摄影师相关
urlpatterns += [
    url(r'^l/submit$', lensman_views.lensman_submit_api, name='lensman_submit_api'),  # 摄影师信息提交

    url(r'^l/wx/authorize$', lensman_views.lensman_wx_authorize_api, name='lensman_wx_authorize_api'),  # 摄影师端 - 微信用户授权

    url(r'^l/price_fix$', lensman_views.lensman_price_fix_api, name='lensman_price_fix_api'),  # 摄影师定价

    url(r'^l/upload$', lensman_views.lensman_photo_upload_api, name='lensman_photo_upload_api'),  # 摄影师照片上传
    url(r'^l/origin_upload$', lensman_views.lensman_origin_photo_upload_api, name='lensman_origin_photo_upload_api'),  # 摄影师原图上传

    url(r'^l/brief$', lensman_views.lensman_brief_api, name='lensman_brief_api'),  # 摄影师简报
    url(r'^l/origin_wanted$', lensman_views.lensman_origin_wanted_api, name='lensman_origin_wanted_api'),  # 摄影师原图订单
]

# 导游相关
urlpatterns += [
    url(r'^t/submit$', tourguide_views.tourguide_submit_api, name='tourguide_submit_api'),  # 导游信息提交

    url(r'^t/wx/authorize$', tourguide_views.tourguide_wx_authorize_api, name='tourguide_wx_authorize_api'),  # 导游端 - 微信用户授权

    url(r'^t/guest/status$', op_views.guest_api, name='tourguide_guest_status_api'),  # 游端 - 游客状态(是否开启)
    url(r'^t/guest/login$', tourguide_views.tourguide_guest_login_api, name='tourguide_guest_login_api'),  # 游端 - 游客登录
]

# 群组相关
urlpatterns += [
    url(r'^g/create$', group_views.group_create_api, name='group_create_api'),  # 群组创建
    url(r'^g/detail$', group_views.group_detail_api, name='group_detail_api'),  # 群组详情
    url(r'^g/update$', group_views.group_update_api, name='group_update_api'),  # 群组更新
    url(r'^g/delete$', group_views.group_delete_api, name='group_delete_api'),  # 群组删除
    url(r'^g/list$', group_views.group_list_api, name='group_list_api'),  # 群组列表
    url(r'^g/lock$', group_views.group_lock_api, name='group_lock_api'),  # 群组锁定
    url(r'^g/unlock$', group_views.group_unlock_api, name='group_unlock_api'),  # 群组解锁
    url(r'^g/data$', group_views.group_data_api, name='group_data_api'),  # 群组数据，评论数，点赞数
]

# 群成员相关
urlpatterns += [
    url(r'^g/join$', groupuser_views.group_user_join_api, name='group_join_api'),  # 群成员加群
    url(r'^g/remove$', groupuser_views.group_user_remove_api, name='group_remove_api'),  # 群成员移除，管理员主动，群成员被动
    url(r'^g/quit$', groupuser_views.group_user_quit_api, name='group_quit_api'),  # 群成员退出，群成员主动
]

# 旅行团相关
urlpatterns += [
    url(r'^tg/create$', tourguidegroup_views.tg_group_create_api, name='tg_group_create_api'),  # 旅行团创建
    url(r'^tg/detail$', tourguidegroup_views.tg_group_detail_api, name='tg_group_detail_api'),  # 旅行团详情
    url(r'^tg/update$', tourguidegroup_views.tg_group_update_api, name='tg_group_update_api'),  # 旅行团更新
    url(r'^tg/close$', tourguidegroup_views.tg_group_close_api, name='tg_group_close_api'),  # 旅行团关闭
    url(r'^tg/gather/start$', tourguidegroup_views.tg_group_gather_start_api, name='tg_group_gather_start_api'),  # 旅行团设置集合时间和地点
    # url(r'^tg/gather/end$', tourguidegroup_views.tg_group_gather_end_api, name='tg_group_gather_end_api'),  # 旅行团集合结束，清理数据
    url(r'^tg/token$', tourguidegroup_views.tg_group_token_api, name='tg_group_token_api'),  # 旅行团权限管理票据
    url(r'^tg/transfer$', tourguidegroup_views.tg_group_transfer_api, name='tg_group_transfer_api'),  # 旅行团权限管理转移

    url(r'^tg/admin/list$', tourguidegroupadmin_views.tg_group_admin_list_api, name='tg_group_admin_list_api'),  # 旅行团管理员列表
    url(r'^tg/admin/recovery$', tourguidegroupadmin_views.tg_group_admin_recovery_api, name='tg_group_admin_recovery_api'),  # 旅行团管理员权限回收，管理员主动，团成员被动
    url(r'^tg/admin/waiver$', tourguidegroupadmin_views.tg_group_admin_waiver_api, name='tg_group_admin_waiver_api'),  # 旅行团管理员权限放弃
]

# 旅行团成员相关
urlpatterns += [
    url(r'^tgu/is_joined$', tourguidegroupuser_views.tgu_group_user_is_joined_api, name='tgu_group_user_is_joined_api'),  # 旅行团成员是否已加团
    url(r'^tgu/join$', tourguidegroupuser_views.tgu_group_user_join_api, name='tgu_group_user_join_api'),  # 旅行团成员加团
    url(r'^tgu/remove$', tourguidegroupuser_views.tgu_group_user_remove_api, name='tgu_group_user_remove_api'),  # 旅行团成员移除，管理员主动，团成员被动
    url(r'^tgu/update$', tourguidegroupuser_views.tgu_group_user_update_api, name='tg_group_update_api'),  # 旅行团成员信息更新
    url(r'^tgu/locations$', tourguidegroupuser_views.tgu_group_user_locations_api, name='tgu_group_user_locations_api'),  # 旅行团所有成员位置信息
    url(r'^tgu/location$', tourguidegroupuser_views.tgu_group_user_location_api, name='tgu_group_user_location_api'),  # 旅行团单个成员位置信息
]

# 飞图相关
urlpatterns += [
    url(r'^f/upload$', group_views.flyimg_upload_api, name='flyimg_upload_api'),  # 飞图上传
    url(r'^f/list$', group_views.flyimg_list_api, name='flyimg_list_api'),  # 飞图列表
    url(r'^f/detail$', group_views.flyimg_detail_api, name='flyimg_detail_api'),  # 飞图详情
    url(r'^f/comment/submit$', group_views.comment_submit_api, name='comment_submit_api'),  # 飞图评论提交
    url(r'^f/comment/list$', group_views.comment_list_api, name='comment_list_api'),  # 飞图评论列表
    url(r'^f/thumbup/submit$', group_views.thumbup_submit_api, name='thumbup_submit_api'),  # 飞图点赞提交
    url(r'^f/thumbup/list$', group_views.thumbup_list_api, name='thumbup_list_api'),  # 飞图点赞列表
    url(r'^f/thumbup/cancel$', group_views.thumbup_cancel_api, name='thumbup_cancel_api'),  # 飞图点赞取消
    url(r'^f/price$', group_views.lensman_photo_price, name='lensman_photo_price'),  # 摄影师照片价格获取
    url(r'^f/bought$', group_views.lensman_photo_bought, name='lensman_photo_bought'),  # 摄影师照片已购买
]

# 消息相关
urlpatterns += [
    url(r'^msg/list$', message_views.message_list_api, name='message_list_api'),  # 消息列表
    url(r'^msg/(?P<msg_type>\w+)/list$', message_views.message_type_list_api, name='message_type_list_api'),  # 分类消息列表
    url(r'^msg/(?P<msg_type>\w+)/read$', message_views.message_type_read_api, name='message_type_read_api'),  # 消息读取
    url(r'^msg/(?P<msg_type>\w+)/delete$', message_views.message_type_delete_api, name='message_type_delete_api'),  # 消息删除
]

# 控制器相关
urlpatterns += [
    url(r'^uuid_init$', photo_views.uuid_init, name='uuid_init'),  # 生成唯一标识
    url(r'^uuid$', photo_views.uuid, name='uuid'),  # 获取唯一标识
    url(r'^photos/upload$', photo_views.upload_photo, name='upload_photo'),  # 摄影师照片上传
    # url(r'^photos/raw/upload$', photo_views.upload_raw_photo, name='upload_raw_photo'),  # 摄影师高清照片上传
]

# 二维码相关
urlpatterns += [
    url(r'^s/join$', photo_views.session_join_api, name='session_join_api'),  # Session 加群
    url(r'^p/(?P<photo>\w+)$', photo_views.photo_standard_api, name='photo_standard_api'),  # standard thumbnail, available for free
]

# 系统相关
urlpatterns += [
    url(r'^op/upgrade$', op_views.upgrade_api, name='upgrade_api'),  # APP 升级
    url(r'^op/patch$', op_views.patch_api, name='patch_api'),  # APP 补丁
    url(r'^op/online$', op_views.online_api, name='online_api'),  # 是否上线
    url(r'^op/guest$', op_views.guest_api, name='guest_api'),  # 游客状态(是否开启)
    url(r'^op/splash$', op_views.splash_api, name='splash_api'),  # 启动页面
    url(r'^op/feedback$', op_views.feedback_api, name='feedback_api'),  # 用户反馈
    url(r'^op/download$', op_views.download_api, name='download_api'),  # 下载接口
    url(r'^op/bpversion$', op_views.box_program_version_api, name='box_program_version_api'),  # BOX 程序版本信息
]

# 地理位置相关
urlpatterns += [
    url(r'^geo/submit$', geo_views.geo_submit_api, name='geo_submit_api'),  # 地理位置信息提交
]

# 支付相关
urlpatterns += [
    url(r'^wx/order_create$', pay_views.wx_order_create_api, name='wx_order_create_api'),  # 订单创建
    url(r'^wx/order_query$', pay_views.wx_order_query_api, name='wx_order_query_api'),  # 订单查询补单
    url(r'^wx/order_list$', pay_views.wx_order_list_api, name='wx_order_list_api'),  # 订单列表
    url(r'^wx/order_detail$', pay_views.wx_order_detail_api, name='wx_order_detail_api'),  # 订单详情
    url(r'^wx/notify_url$', pay_views.wx_notify_url_api, name='wx_notify_url_api'),  # 支付异步通知回调地址
]

# 提现相关
urlpatterns += [
    url(r'^wx/balance_withdraw$', pay_views.wx_balance_withdraw_api, name='wx_balance_withdraw_api'),  # 余额提现: 企业付款/现金红包
]

# 首页相关
urlpatterns += [
    url(r'^pai2/home$', group_views.pai2_home_api, name='pai2_home_api'),  # 首页照片信息
    url(r'^pai2/tginfo$', tourguidegroup_views.pai2_tginfo_api, name='pai2_tginfo_api'),  # 首页旅行团信息
]

# 服务器相关
urlpatterns += [
    url(r'^s/server_time$', server_views.get_server_time_api, name='get_server_time_api'),  # 获取服务器时间
]

# Mini App
urlpatterns += [
    url(r'^mini/userinfo$', mini_views.get_userinfo_api, name='get_userinfo_api'),  # 获取用户信息
]

urlpatterns += [
    url(r'^box/loginqr$', box_views.login_qrcode_api, name='login_qrcode_api'),  # 二维码登录
]
