#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
    demeter load
    author:rabin
"""
from demeter.web import *

# 这里做微信的登录认证
def auth(method):
	def wrapper(self, *args, **kwargs):
		return method(self, *args, **kwargs)
	return wrapper

class Weixin(object):

	def check(self):
		return

class Load(Base):
	KEYS = ('user', 'farm')

	def setting(self):
		uid = self.input('uid')
		farm = 1
		if uid:
			user = self.service('common').one('farm_user', id=uid)
			if user:
				farm = user['farm_id']
		Demeter.config['setting']['farm'] = farm
		return