Class: Api::V5::BranchController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- Api::V5::BranchController
- Includes:
- Concerns::GetRestaurantList
- Defined in:
- app/controllers/api/v5/branch_controller.rb
Overview
Branch
Constant Summary
Constants inherited from BaseController
Api::V5::BaseController::CACHE_NAMESPACE, Api::V5::BaseController::INTERNAL_SERVER_ERROR_MESSAGE, Api::V5::BaseController::ResponseSchema
Instance Method Summary collapse
Methods inherited from BaseController
Methods included from LogrageCustomLogger
Methods included from ResponseCacheConcern
Instance Method Details
#restaurants ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/controllers/api/v5/branch_controller.rb', line 10 def restaurants params[:branch_id_eq] = params.require(:branch_id) now = Time.use_zone('Asia/Bangkok') { Time.zone.now } hour = now.strftime('%H').to_i date = now.strftime('%Y-%m-%d') cache_key = "#{CACHE_NAMESPACE}:#{self.class}|#{CityHash.hash32(params)}|restaurants|#{I18n.locale}|#{date}|#{hour}" restaurant_list(cache_key) end |