-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_testdata.rb
102 lines (91 loc) · 2.02 KB
/
create_testdata.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
require './controllers/staff.rb'
require './controllers/student.rb'
require './controllers/onduty.rb'
test_passwd = 'jfiodsjfkdsFYufsdyf8hB'
# 管理者スタッフ
result = StaffController.create_admin({
email: '[email protected]',
user_name: '管理者A',
raw_passwd: test_passwd
})
puts "admin :#{result.to_json}"
result = StaffController.create_admin({
email: '[email protected]',
user_name: '管理者B',
raw_passwd: test_passwd
})
puts "admin :#{result.to_json}"
# 通常スタッフ
result = StaffController.create_normal({
email: '[email protected]',
user_name: 'スタッフA',
raw_passwd: test_passwd,
config_passwd: test_passwd
})
puts "staff :#{result.to_json}"
result = StaffController.create_normal({
email: '[email protected]',
user_name: 'スタッフB',
raw_passwd: test_passwd,
config_passwd: test_passwd
})
puts "staff :#{result.to_json}"
# 学生
# result = StudentController.create({
# student_id: '21101',
# user_name: '学生A',
# grade: 1,
# department_id: 1,
# room_num: '1101',
# raw_passwd: test_passwd,
# config_passwd: test_passwd
# })
# puts "student:#{result.to_json}"
# result = StudentController.create({
# student_id: '19201',
# user_name: '学生B',
# grade: 3,
# department_id: 2,
# room_num: '1201',
# raw_passwd: test_passwd,
# config_passwd: test_passwd
# })
# puts "student:#{result.to_json}"
# result = StudentController.create({
# student_id: '17301',
# user_name: '学生C',
# grade: 5,
# department_id: 3,
# room_num: '2101',
# raw_passwd: test_passwd,
# config_passwd: test_passwd
# })
# puts "student:#{result.to_json}"
# 当直
result = OndutyController.create({
staff_id: 1,
time: {
year: 2021,
month: 12,
date: 29
}
})
puts "onduty :#{result.to_json}"
result = OndutyController.create({
staff_id: 1,
time: {
year: 2021,
month: 12,
date: 30
}
})
puts "onduty :#{result.to_json}"
result = OndutyController.create({
staff_id: 2,
time: {
year: 2021,
month: 12,
date: 31
}
})
puts "onduty :#{result.to_json}"