# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
#   movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
#   Character.create(name: 'Luke', movie: movies.first)

# 创建匿名用户
user_params = [
    {
        id: 1,
        login: 'educoder',
        hashed_password: '6763c9a6d5c201903feed5950a2c4459cef8d3ec',
        lastname: '指导老师',
        mail: '721773699@qq.com',
        admin: 1,
        status: 1,
        type: 'User',
        language: 'zh',
        nickname: 'Educoder',
        show_realname: '指导老师',
        professional_certification: 1,
        certification: 1,
        salt: '3dce3e3983227c40c48a25419d41de7e',
        profile_completed: 1
    },
    {
        id: 2,
        hashed_password: 'aaacd2fdabaaa3a54c4ada625a2611b5f0ffa437',
        status: 3,
        type: 'AnonymousUser',
        salt: '96a9104963f8f2f9d35f1f384f8e8bf7'
    }
]
user_extension_params = [
    {
        id: 1,
        user_id: 1,
        gender: 0,
        location: "湖南",
        occupation: "中国移动通信集团",
        technical_title: "副教授",
        identity: 0,
        location_city: "长沙",
        school_id: 1,
        department_id: 1
    },
    {
        id: 2,
        user_id: 2,
        gender: 1,
        identity: 1
    }
]
school_params = {
    id: 1,
    name: "中国移动通信集团",
    province: "湖南",
    pinyin: 'zhongguoyidongtongxinjiduan',
    school_type: 0,
    city: "长沙",
    address: "湖南省长沙市",
    auto_users_trial: 1,
    identifier: 'nudt'
}
department_params = {
    id: 1,
    name: '湖南有限公司',
    school_id: 1,
    is_auth: 1
}

User.create!(user_params)
UserExtension.create!(user_extension_params)
School.create!(school_params)
Department.create!(department_params)