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

from django.conf.urls import url

from account import views as account_views
from group import views as group_views
from message import views as message_views
from operation import views as op_views
from pay import views as pay_views
from photo import views as photo_views
from wechat import views as wechat_views


# 帐户相关
urlpatterns = [
    url(r'^login$', account_views.lensman_login_api, name='lensman_login_api'),  # 摄影师登录
    url(r'^u/is_registered$', account_views.user_is_registered_api, name='user_is_registered_api'),  # 用户是否已经注册
    url(r'^u/signup$', account_views.user_signup_api, name='user_signup_api'),  # 用户注册
    url(r'^u/login$', account_views.user_login_api, name='user_login_api'),  # 用户登录

    url(r'^u/wx/authorize$', account_views.wx_authorize_api, name='wx_authorize_api'),  # 微信用户授权

    url(r'^u/guest/status$', account_views.guest_status_api, name='guest_status_api'),  # 游客状态(是否开启)
    url(r'^u/guest/login$', account_views.guest_login_api, name='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/list$', group_views.group_list_api, name='group_list_api'),  # 群组列表
    url(r'^g/join$', group_views.group_join_api, name='group_join_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/remove$', group_views.group_remove_api, name='group_remove_api'),  # 成员移除, 管理员主动, 群成员被动
    url(r'^g/quit$', group_views.group_quit_api, name='group_quit_api'),  # 成员退出，群成员主动
    # url(r'^g/pass$', group_views.group_pass_api, name='group_pass_api'),  # 申请通过
    # url(r'^g/refuse$', group_views.group_refuse_api, name='group_refuse_api'),  # 申请拒绝
    url(r'^g/data$', group_views.group_data_api, name='group_data_api'),  # 群组数据, 评论数, 点赞数
]

# 飞图相关
urlpatterns += [
    url(r'^f/upload$', group_views.flyimg_upload_api, name='flyimg_upload_api'),  # 飞图上传
    url(r'^f/list$', group_views.flyimg_upload_api, name='flyimg_list_api'),  # 飞图列表
    url(r'^f/comment/submit$', group_views.comment_submit_api, name='comment_submit_api'),  # 飞图评论提交
    url(r'^f/comment/list$', group_views.comment_submit_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'),  # 上传图片
]

# 二维码相关
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/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'),  # 下载接口
]

# 支付相关
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/jsapi_signature$', wechat_views.wx_jsapi_signature_api, name='wx_jsapi_signature_api'),  # jsapi_signature
]

# 首页相关
urlpatterns += [
    url(r'^pai2/home$', group_views.pai2_home_api, name='pai2_home_api'),  # 首页信息
]
