parent
							
								
									05bd1ca0c8
								
							
						
					
					
						commit
						5924a64239
					
				| @ -0,0 +1,20 @@ | ||||
| #coding=utf-8 | ||||
| 
 | ||||
| 
 | ||||
| module Mobile | ||||
|   module Middleware | ||||
|     class NotFoundHandler < Grape::Middleware::Base | ||||
|       def call!(env) | ||||
|         @env = env | ||||
|         begin | ||||
|           @app.call(@env) | ||||
|         rescue ActiveRecord::RecordNotFound => e | ||||
|           message = {status: 404, message: e.message }.to_json | ||||
|           status = 200 | ||||
|           headers = { 'Content-Type' => content_type } | ||||
|           Rack::Response.new([message], status, headers).finish | ||||
|         end | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end | ||||
| @ -0,0 +1,12 @@ | ||||
| class CheckProjectPackageDeadlineTask | ||||
|   def call | ||||
|     ProjectPackage.where(status: :published).where('deadline_at < ?', Time.now).find_each do |package| | ||||
|       begin | ||||
|         ProjectPackages::EndBiddingService.new(package).call | ||||
|       rescue => ex | ||||
|         Rails.logger.error ex.message | ||||
|         Rails.logger.error ex.backtrace.join('\n') | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end | ||||
| @ -0,0 +1,11 @@ | ||||
| zh: | ||||
|   project_package: | ||||
|     category: | ||||
|       front: 前端开发 | ||||
|       backend: 后端开发 | ||||
|       mobile: 移动开发 | ||||
|       database: 数据库 | ||||
|       cloud_compute_and_big_data: 云计算与大数据 | ||||
|       devops_and_test: 运维与测试 | ||||
|       ai: 人工智能 | ||||
|       other: 其它 | ||||
					Loading…
					
					
				
		Reference in new issue