lib/lhj/command/yapi.rb in lhj-tools-0.1.13 vs lib/lhj/command/yapi.rb in lhj-tools-0.1.16
- old
+ new
@@ -277,11 +277,11 @@
def print_models_for_java(models)
models.each do |model|
model_name = model[:name] || ''
model_properties = model[:properties]
- puts_h "public class #{model_name} extends BaseModel implements BusinessEvent.PorductDataCollect {"
+ puts_h "public class #{model_name} extends BaseModel implements BusinessEvent.ProductDataCollect {"
model_properties.each do |m|
print_model_for_java(m)
end
puts_h "}\n\n\n"
end
@@ -289,11 +289,11 @@
def print_models_impl(models)
models.each do |model|
puts_m "@implementation #{model[:name]}"
str = model[:properties].filter { |p| p[:type].eql?('array') && !p[:type_name].eql?('NSString') }.map { |p| "@\"#{p[:key]}\": #{p[:type_name]}.class" }.join(', ')
- if str && str.length.positive?
+ if str&.length&.positive?
puts_m '+(NSDictionary *)modelContainerPropertyGenericClass {'
puts_m " return @{#{str}};"
puts_m '}'
end
puts_m "@end\n"
@@ -362,10 +362,10 @@
when 'object'
puts_h "#{type_name} #{key};//#{des} #{default}"
when 'array'
puts_h "#{type_name}[] #{key};//#{des} #{default}"
else
- puts_h "@property (nonatomic, copy) NSString *#{key};//#{des} #{default}"
+ puts_h "String #{key};//#{des} #{default}"
end
end
# @param [Object] data
def print_req_query(data)