'use strict';



/**
 * 生成方法名字与Types常量的前缀格式
 * 在page.vue中map关系中mapActions的方法名字
 * 格式: name + model.prefix + model.path（最后一段）或者 name + model.path（最后一段）
 *
 *  mapActions
 * 例如无model.prefix: mapActions('orders', ['ordersExpress']),
 * 例如有model.prefix: mapActions('orders', ['ordersAxxExpress']),  model.prefix=axx
 *
 * mapStates
 * 例如无model.prefix: mapStates('orders', ['ordersExpress']),
 * 例如有model.prefix: mapStates('orders', ['ordersAxxExpress']),  model.prefix=axx
 **/
module.exports = {
  name: 'orders', //必须是英文，生成文件作为文件名字
  title: '我的订单', //生成模块注释
  vuex: true,
  model:[
    {
      /**
       * @description 接口地址
       */
      path: '/api/order/express',

      /**
       * @description 是否符合规则
       * true (一对多) 建议使用，无需配置多个 ['setting', 'list', 'update', 'remove', 'add', download]
       * 例如：/api/order/list
       * false 不规则(一对一)
       * 例如: /api/order/express
       */
      isRule: false,

      /**
       * @description 访问该接口需要的权限值
       * 当isRule=true 此配置被忽略
       * 当isRule=false 此时生效，
       */
      role: 'SUPER_ADMIN_EXPRESS_ROLE',

      /**
       * @description 访问该接口需要的权限值
       * 当isRule=false 此配置被忽略
       * 当isRule=true 此时生效
       * 需要配置这些方法 //['setting', 'list', 'update', 'remove', 'add', download]
       */
      roles: {
        setting: 'SUPER_ADMIN_SETTING_ROLE',
        list: 'SUPER_ADMIN_LIST_ROLE',
        update: 'SUPER_ADMIN_UPDATE_ROLE',
        remove: 'SUPER_ADMIN_REMOVE_ROLE',
        add: 'SUPER_ADMIN_ADD_ROLE',
        download: 'SUPER_ADMIN_DOWNLOAD_ROLE',
      },


      /**
       * @description 接口生成注释使用名称
       * 当 isRule=true 不需要设置name名称
       */
      title: '上传快递单号',


      /**
       * @description  后台返回数据字段 默认：result
       */
      resultKey: 'result',

      /**
       * @description 在Vuex Actions 中是否进行打印数据
       */
      isConsole: true,

      /**
       * @description 生成方法名字与Types常量的前缀
       */
      prefix: null,

      /**
       * @description 调用Actions中的方法，启用回调函数模式并且设置回调按钮方法
       */
      isCallback: null,

      /**
       * @description 接口GET生成注释使用相关配置
       * 当isRule=true 此配置被忽略
       *
       * 当isRule=false 此时生效，表示使用GET方法请求，
       * @notice 当params与data同时存在，data会被忽略生成
       */
      params: {
        /**生成注释用的 [0]=>描述，[1]=>数据类型 [2]=>是否必填 [3]=>默认值**/
        expressId: ['快递号参数', 'String|Number', '选填', 22]
      },

      /**
       * @description 接口POST生成注释使用相关配置
       * 当isRule=true 此配置被忽略
       *
       * 当isRule=false 此时生效，表示使用POST方法请求，
       * @notice 当params与data同时存在，data会被忽略生成
       */
      data: {
        /**生成注释用的 [0]=>描述，[1]=>数据类型 [2]=>是否必填 [3]=>默认值**/
        expressId: ['快递号参数', 'String|Number', '选填', 2]
      },

      /**
       * @description 接口生成注释使用相关配置
       * 当isRule=false 此配置被忽略
       * 当params与data同时存在，data会被忽略生成
       * 支持的配置项['setting', 'list', 'update', 'remove', 'add', download]
       * 当支持的配置项为空对象时候，表示该配置接口不使用参数
       */
      query: {
        download: {},
        setting: {
          params: {
            expressId: ['快递号参数', 'String|Number', '选填', '默认值：111111']
          },
          data: {
            expressId: ['快递号参数', 'String|Number', '选填', '默认值：111111']
          },

        },
      },


      /**定义状态保存的名称**/
      state: null, //

      /**是否禁用该配置项， 设置为true，代码生成器将忽略该配置**/
      disabled: true,
    },
  ]
}
