import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import Settings from '../views/Settings.vue'
import Swagger from '../views/Swagger.vue'
import MySQLModel from '../views/MySQLModel.vue'
import UpdateCommon from '../views/UpdateCommon.vue'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: { title: '主页' }
  },
  {
    path: '/settings',
    name: 'Settings',
    component: Settings,
    meta: { title: '设置' }
  },
  {
    path: '/swagger',
    name: 'Swagger',
    component: Swagger,
    meta: { title: 'Swagger' }
  },
  {
    path: '/mysql-model',
    name: 'MySQLModel',
    component: MySQLModel,
    meta: { title: 'MySQL Model' }
  },
  {
    path: '/update-common',
    name: 'UpdateCommon',
    component: UpdateCommon,
    meta: { title: '更新 Common' }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
