Beispiel #1
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     nickname = self.get_body_argument('nickname')
     (code, msg) = interface.set_friend_name(wxid, nickname)
     Obj = InitRtn(code, msg)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #2
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     text = self.get_body_argument('text')
     (code, msg) = interface.set_chatroom_announcement(wxid, text)
     Obj = InitRtn(code, msg)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #3
0
 def post(self):
     chatroomid = self.get_body_argument('chatroomid')
     nickname = self.get_body_argument('nickname')
     (code, msg) = interface.set_group_nick_name(chatroomid, nickname)
     Obj = InitRtn(code, msg)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #4
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     msgid = self.get_body_argument('msgid')
     (code, msg) = interface.revoke_msg(wxid, int(msgid))
     Obj = InitRtn(code, msg)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #5
0
 def post(self):
     wxidlist = self.get_body_argument('wxidlist')
     idlist = wxidlist.split(',')
     chatroomid = interface.create_chatroom(idlist)
     Obj = InitRtn(0, chatroomid)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #6
0
 def post(self):
     chatroomid = self.get_body_argument('chatroomid')
     memberlist = self.get_body_argument('memberlist')
     idlist = memberlist.split(',')
     interface.at_all_in_group(chatroomid, idlist)
     Obj = InitRtn(0, "成功")
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #7
0
 def post(self):
     chatroomid = self.get_body_argument('chatroomid')
     memberlist = self.get_body_argument('memberlist')
     idlist = memberlist.split(',')
     (code, msg) = interface.add_chatroom_member(chatroomid, idlist)
     Obj = InitRtn(code, msg)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #8
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     content = self.get_body_argument('content')
     (ret_code,
      svrid) = interface.new_send_msg(wxid,
                                      content.encode(encoding='utf-8'), [])
     Obj = InitRtn(ret_code, svrid)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #9
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     title = self.get_body_argument('title')
     desc = self.get_body_argument('desc')
     url = self.get_body_argument('url')
     thumburl = self.get_body_argument('thumburl')
     (ret_code, svrid) = interface.send_app_msg(wxid, title, desc, url,
                                                thumburl)
     Obj = InitRtn(ret_code, svrid)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #10
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     bantype = self.get_body_argument('bantype')
     ban = True
     if str(bantype) == "1":
         ban = True
     else:
         ban = False
     (code, msg) = interface.ban_friend(wxid, ban)
     Obj = InitRtn(code, msg)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #11
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     deltype = self.get_body_argument('deltype')
     delete = True
     if str(deltype) == "1":
         delete = True
     else:
         delete = False
     (code, msg) = interface.delete_friend(wxid, delete)
     Obj = InitRtn(code, msg)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #12
0
 def post(self):
     code = self.get_body_argument('code')
     wxid = self.get_body_argument('wxid')
     v1 = self.get_body_argument('v1')
     ticket = self.get_body_argument('ticket')
     antiticket = self.get_body_argument('antiticket')
     content = self.get_body_argument('content')
     wxid = interface.verify_user(code, wxid, v1, ticket, antiticket,
                                  content)
     Obj = InitRtn(0, wxid)
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #13
0
 def post(self):
     wxid = self.get_body_argument('wxid')
     array = interface.get_contact(wxid)
     if len(array) > 0:
         wx = array[0]
         Obj = ContactRtn(wx.wxid, wx.nickname, wx.remark_name, wx.alias,
                          wx.avatar_big, wx.v1_name, wx.type, wx.sex,
                          wx.country, wx.sheng, wx.shi, wx.qianming,
                          wx.register_body, wx.src)
         returnStr = JsonUtils.Obj2Json(Obj)
         self.write(returnStr)
     else:
         Obj = InitRtn(0, "执行错误")
         returnStr = JsonUtils.Obj2Json(Obj)
         self.write(returnStr)
Beispiel #14
0
 def post(self):
     interface.new_init()
     Obj = InitRtn(0, "好友列表加载成功")
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)
Beispiel #15
0
 def post(self):
     interface.init_all()
     Obj = InitRtn(0, "初始化成功")
     returnStr = JsonUtils.Obj2Json(Obj)
     self.write(returnStr)