123456789101112131415161718192021222324252627282930313233 |
- # -*- coding: utf-8 -*-
- """
- demeter service
- msg
- """
- from demeter.core import *
- class Msg(object):
- def push(self, farm_id, uid, type_id, content, push=''):
- model = Demeter.model('msg_type')
- model.key = type_id
- msg_type = model.select(type='fetchone')
- if msg_type:
- model = Demeter.model('msg')
- model.farm_id = farm_id
- model.uid = uid
- model.type_id = type_id
- model.content = content
- if not push:
- push = msg_type['push']
- model.push = push
- if 'sms' in model.push:
- self.sendSms(uid, content)
- if 'wechat' in model.push:
- self.sendWechat(uid, content)
- id = model.insert()
- def sendSms(self, uid, content):
- return
- def sendWechat(self, uid, content):
- return
-
|