line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Recruit::AkasuguUchiiwai::Item; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
728
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
107
|
|
4
|
3
|
|
|
3
|
|
15
|
use base qw( WebService::Recruit::AkasuguUchiiwai::Base ); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
2374
|
|
5
|
3
|
|
|
3
|
|
19
|
use vars qw( $VERSION ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
101
|
|
6
|
3
|
|
|
3
|
|
14
|
use Class::Accessor::Fast; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
23
|
|
7
|
3
|
|
|
3
|
|
70
|
use Class::Accessor::Children::Fast; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
15
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.0.1'; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
1
|
0
|
sub http_method { 'GET'; } |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
1
|
0
|
sub url { 'http://webservice.recruit.co.jp/uchiiwai/item/v1/'; } |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
1
|
42
|
sub query_class { 'WebService::Recruit::AkasuguUchiiwai::Item::Query'; } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub query_fields { [ |
18
|
3
|
|
|
3
|
0
|
41
|
'key', 'code', 'name', 'category', 'price_min', 'price_max', 'keyword', 'target', 'feature', 'order', 'start', 'count' |
19
|
|
|
|
|
|
|
]; } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub default_param { { |
22
|
1
|
|
|
1
|
1
|
451
|
'format' => 'xml' |
23
|
|
|
|
|
|
|
}; } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub notnull_param { [ |
26
|
0
|
|
|
0
|
1
|
0
|
'key' |
27
|
|
|
|
|
|
|
]; } |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
0
|
sub elem_class { 'WebService::Recruit::AkasuguUchiiwai::Item::Element'; } |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
3
|
1
|
46
|
sub root_elem { 'results'; } |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub elem_fields { { |
34
|
3
|
|
|
3
|
0
|
91
|
'category' => ['code', 'name'], |
35
|
|
|
|
|
|
|
'error' => ['message'], |
36
|
|
|
|
|
|
|
'feature' => ['code', 'name'], |
37
|
|
|
|
|
|
|
'image' => ['pc_l', 'pc_m', 'pc_s', 'mobile_l', 'mobile_s'], |
38
|
|
|
|
|
|
|
'item' => ['code', 'brand', 'name', 'price', 'desc', 'spec', 'image', 'category', 'target', 'feature', 'start_date', 'end_date', 'urls'], |
39
|
|
|
|
|
|
|
'results' => ['api_version', 'results_available', 'results_returned', 'results_start', 'item', 'api_version', 'error'], |
40
|
|
|
|
|
|
|
'target' => ['code', 'name'], |
41
|
|
|
|
|
|
|
'urls' => ['mobile', 'pc', 'qr'], |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
}; } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub force_array { [ |
46
|
0
|
|
|
0
|
1
|
|
'item' |
47
|
|
|
|
|
|
|
]; } |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# __PACKAGE__->mk_query_accessors(); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
@WebService::Recruit::AkasuguUchiiwai::Item::Query::ISA = qw( Class::Accessor::Fast ); |
52
|
|
|
|
|
|
|
WebService::Recruit::AkasuguUchiiwai::Item::Query->mk_accessors( @{query_fields()} ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# __PACKAGE__->mk_elem_accessors(); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
@WebService::Recruit::AkasuguUchiiwai::Item::Element::ISA = qw( Class::Accessor::Children::Fast ); |
57
|
|
|
|
|
|
|
WebService::Recruit::AkasuguUchiiwai::Item::Element->mk_ro_accessors( root_elem() ); |
58
|
|
|
|
|
|
|
WebService::Recruit::AkasuguUchiiwai::Item::Element->mk_child_ro_accessors( %{elem_fields()} ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
WebService::Recruit::AkasuguUchiiwai::Item - AkasuguUchiiwai Web Service "item" API |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SYNOPSIS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
use WebService::Recruit::AkasuguUchiiwai; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $service = WebService::Recruit::AkasuguUchiiwai->new(); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my $param = { |
71
|
|
|
|
|
|
|
'key' => $ENV{'WEBSERVICE_RECRUIT_KEY'}, |
72
|
|
|
|
|
|
|
'target' => '1', |
73
|
|
|
|
|
|
|
}; |
74
|
|
|
|
|
|
|
my $res = $service->item( %$param ); |
75
|
|
|
|
|
|
|
my $data = $res->root; |
76
|
|
|
|
|
|
|
print "api_version: $data->api_version\n"; |
77
|
|
|
|
|
|
|
print "results_available: $data->results_available\n"; |
78
|
|
|
|
|
|
|
print "results_returned: $data->results_returned\n"; |
79
|
|
|
|
|
|
|
print "results_start: $data->results_start\n"; |
80
|
|
|
|
|
|
|
print "item: $data->item\n"; |
81
|
|
|
|
|
|
|
print "...\n"; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 DESCRIPTION |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This module is a interface for the C- API.
|
86
|
|
|
|
|
|
|
It accepts following query parameters to make an request. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
my $param = { |
89
|
|
|
|
|
|
|
'key' => 'XXXXXXXX', |
90
|
|
|
|
|
|
|
'code' => '9999-999', |
91
|
|
|
|
|
|
|
'name' => 'ガーゼケット りす', |
92
|
|
|
|
|
|
|
'category' => '3695', |
93
|
|
|
|
|
|
|
'price_min' => '2000', |
94
|
|
|
|
|
|
|
'price_max' => '5400', |
95
|
|
|
|
|
|
|
'keyword' => '赤すぐオリジナル', |
96
|
|
|
|
|
|
|
'target' => '1', |
97
|
|
|
|
|
|
|
'feature' => '1', |
98
|
|
|
|
|
|
|
'order' => 'XXXXXXXX', |
99
|
|
|
|
|
|
|
'start' => 'XXXXXXXX', |
100
|
|
|
|
|
|
|
'count' => 'XXXXXXXX', |
101
|
|
|
|
|
|
|
}; |
102
|
|
|
|
|
|
|
my $res = $service->item( %$param ); |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
C<$service> above is an instance of L. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 METHODS |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head2 root |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This returns the root element of the response. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
my $root = $res->root; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
You can retrieve each element by the following accessors. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
$root->api_version |
117
|
|
|
|
|
|
|
$root->results_available |
118
|
|
|
|
|
|
|
$root->results_returned |
119
|
|
|
|
|
|
|
$root->results_start |
120
|
|
|
|
|
|
|
$root->item |
121
|
|
|
|
|
|
|
$root->item->[0]->code |
122
|
|
|
|
|
|
|
$root->item->[0]->brand |
123
|
|
|
|
|
|
|
$root->item->[0]->name |
124
|
|
|
|
|
|
|
$root->item->[0]->price |
125
|
|
|
|
|
|
|
$root->item->[0]->desc |
126
|
|
|
|
|
|
|
$root->item->[0]->spec |
127
|
|
|
|
|
|
|
$root->item->[0]->image |
128
|
|
|
|
|
|
|
$root->item->[0]->category |
129
|
|
|
|
|
|
|
$root->item->[0]->target |
130
|
|
|
|
|
|
|
$root->item->[0]->feature |
131
|
|
|
|
|
|
|
$root->item->[0]->start_date |
132
|
|
|
|
|
|
|
$root->item->[0]->end_date |
133
|
|
|
|
|
|
|
$root->item->[0]->urls |
134
|
|
|
|
|
|
|
$root->item->[0]->image->pc_l |
135
|
|
|
|
|
|
|
$root->item->[0]->image->pc_m |
136
|
|
|
|
|
|
|
$root->item->[0]->image->pc_s |
137
|
|
|
|
|
|
|
$root->item->[0]->image->mobile_l |
138
|
|
|
|
|
|
|
$root->item->[0]->image->mobile_s |
139
|
|
|
|
|
|
|
$root->item->[0]->category->code |
140
|
|
|
|
|
|
|
$root->item->[0]->category->name |
141
|
|
|
|
|
|
|
$root->item->[0]->target->code |
142
|
|
|
|
|
|
|
$root->item->[0]->target->name |
143
|
|
|
|
|
|
|
$root->item->[0]->feature->code |
144
|
|
|
|
|
|
|
$root->item->[0]->feature->name |
145
|
|
|
|
|
|
|
$root->item->[0]->urls->mobile |
146
|
|
|
|
|
|
|
$root->item->[0]->urls->pc |
147
|
|
|
|
|
|
|
$root->item->[0]->urls->qr |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 xml |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
This returns the raw response context itself. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
print $res->xml, "\n"; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head2 code |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This returns the response status code. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
my $code = $res->code; # usually "200" when succeeded |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head2 is_error |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
This returns true value when the response has an error. |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
die 'error!' if $res->is_error; |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head1 SEE ALSO |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
L |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 AUTHOR |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
RECRUIT Media Technology Labs |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head1 COPYRIGHT |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
Copyright 2008 RECRUIT Media Technology Labs |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=cut |
181
|
|
|
|
|
|
|
1; |