import 'package:chat/middleware/auth_middleware.dart';
import 'package:chat/views/contact/index/index_page.dart';
import 'package:chat/views/user/info/avatar_page.dart';
import 'package:chat/views/user/info/index_page.dart';
import 'package:chat/views/user/info/nickname_page.dart';
import 'package:chat/views/user/qr_code/index_page.dart';
import 'package:chat/views/user/serve/google/index_page.dart';
import 'package:chat/views/user/serve/index_page.dart';
import 'package:chat/views/user/setting/about/index_page.dart';
import 'package:chat/views/user/setting/index_page.dart';
import 'package:chat/views/user/setting/privacy/index_page.dart';
import 'package:chat/views/user/setting/safe/email_page.dart';
import 'package:chat/views/user/setting/safe/index_page.dart';
import 'package:chat/views/user/setting/safe/mobile_page.dart';
import 'package:chat/views/user/setting/sugguest/index_page.dart';
import 'package:chat/views/user/share/index_page.dart';
import 'package:get/get.dart';

abstract class UserRoutes {
  /// 身份验证页面
  static const String index = '/user';
  static const String qrCode = '/user/qrCode';

  static const String setting = '/user/setting';
  static const String settingPrivacy = '/user/setting/privacy';
  static const String settingAbout = '/user/setting/about';
  static const String settingSafe = '/user/setting/safe';
  static const String settingSafeEmail = '/user/setting/safe/email';
  static const String settingSafeMobile = '/user/setting/safe/mobile';
  static const String settingSugguest = '/user/setting/sugguest';

  static const String share = '/user/share';

  static const String info = '/user/info';
  static const String infoAvatar = '/user/info/avatar';
  static const String infoNickname = '/user/info/nickname';

  static const String serve = '/user/serve';
  static const String serveGoogle = '/user/serve/google';

  static GetPage router = GetPage(
    name: UserRoutes.index,
    middlewares: [
      EnsureAuthMiddleware(),
    ],
    page: () => const ContactPage(),
    children: [
      GetPage(
        name: '/share',
        page: () => const UserSharePage(),
      ),
      GetPage(
        name: '/qrCode',
        page: () => const UserQrCodePage(),
      ),
      GetPage(
        name: '/setting',
        page: () => const UserSettingPage(),
        children: [
          GetPage(
            name: '/about',
            page: () => const UserSettingAboutPage(),
          ),
          GetPage(
            name: '/rivacy',
            page: () => const UserSettingPrivacyPage(),
          ),
          GetPage(
            name: '/safe',
            page: () => const UserSettingSafePage(),
            children: [
              GetPage(
                name: '/email',
                page: () => const UserSettingSafeEmailPage(),
              ),
              GetPage(
                name: '/mobile',
                page: () => const UserSettingSafeMobilePage(),
              ),
            ],
          ),
          GetPage(
            name: '/sugguest',
            page: () => const UserSettingSugguestPage(),
          ),
        ],
      ),
      GetPage(
        name: '/info',
        page: () => const UserInfoPage(),
        children: [
          GetPage(
            name: '/avatar',
            page: () => const UserInfoAvatarPage(),
          ),
          GetPage(
            name: '/nickname',
            page: () => const UserInfoNicknamePage(),
          ),
        ],
      ),
      GetPage(
        name: '/serve',
        page: () => const UserServePage(),
        children: [
          GetPage(
            name: '/google',
            page: () => const UserServeGooglePage(),
          ),
        ],
      ),
    ],
  );
}
