import type { MockMethod } from 'vite-plugin-mock'

const dictData: any = {
  sys_normal_disable: [
    {
      createBy: 'admin',
      createTime: '2024-12-03 02:42:56',
      updateBy: null,
      updateTime: null,
      remark: '正常状态',
      params: {
        '@type': 'java.util.HashMap',
      },
      dictCode: 6,
      dictSort: 1,
      dictLabel: '正常',
      dictValue: '0',
      dictType: 'sys_normal_disable',
      cssClass: null,
      listClass: 'primary',
      isDefault: 'Y',
      status: '0',
      default: true,
    },
    {
      createBy: 'admin',
      createTime: '2024-12-03 02:42:56',
      updateBy: null,
      updateTime: null,
      remark: '停用状态',
      params: {
        '@type': 'java.util.HashMap',
      },
      dictCode: 7,
      dictSort: 2,
      dictLabel: '停用',
      dictValue: '1',
      dictType: 'sys_normal_disable',
      cssClass: null,
      listClass: 'danger',
      isDefault: 'N',
      status: '0',
      default: false,
    },
  ],
  sys_user_sex: [
    {
      createBy: 'admin',
      createTime: '2024-12-03 02:42:55',
      updateBy: null,
      updateTime: null,
      remark: '性别男',
      params: {
        '@type': 'java.util.HashMap',
      },
      dictCode: 1,
      dictSort: 1,
      dictLabel: '男',
      dictValue: '0',
      dictType: 'sys_user_sex',
      cssClass: null,
      listClass: null,
      isDefault: 'Y',
      status: '0',
      default: true,
    },
    {
      createBy: 'admin',
      createTime: '2024-12-03 02:42:55',
      updateBy: null,
      updateTime: null,
      remark: '性别女',
      params: {
        '@type': 'java.util.HashMap',
      },
      dictCode: 2,
      dictSort: 2,
      dictLabel: '女',
      dictValue: '1',
      dictType: 'sys_user_sex',
      cssClass: null,
      listClass: null,
      isDefault: 'N',
      status: '0',
      default: false,
    },
    {
      createBy: 'admin',
      createTime: '2024-12-03 02:42:55',
      updateBy: null,
      updateTime: null,
      remark: '性别未知',
      params: {
        '@type': 'java.util.HashMap',
      },
      dictCode: 3,
      dictSort: 3,
      dictLabel: '未知',
      dictValue: '2',
      dictType: 'sys_user_sex',
      cssClass: null,
      listClass: null,
      isDefault: 'N',
      status: '0',
      default: false,
    },
  ],
}

export default [
  {
    url: '/system/dict/data/type/:dictType',
    method: 'get',
    response({ query }) {
      return {
        code: 200,
        msg: 'success',
        data: dictData[query.dictType],
      }
    },
  },
] as MockMethod[]
