def release_notice(user_dic): notice = models.Notice(name=user_dic['notice_name'], content=user_dic['notice_content'], user_id=user_dic['user_id']) notice.save() back_dic = {'flag': True, 'msg': '公告发布成功'} return back_dic
def release_notice(back_dic, conn): notice_obj = models.Notice(title=back_dic.get('title'), content=back_dic.get('content'), create_time=common.get_now_time(), user_id=back_dic.get('user_id')) notice_obj.insert() send_dic = {'flag': True, 'msg': '公告发布成功'} common.send_msg(send_dic, conn)
def send_notice_interface(back_dic,conn): notice_obj = models.Notice(title = back_dic.get('title'), content =back_dic.get('content'), create_time = datetime.datetime.now(), user_id = back_dic.get('user_id')) notice_obj.save() send_dic = {'flag':True,'msg':'公告发布成功!'} print(send_dic) common.send_msg(send_dic,conn)
def release_notice(user_dic, conn): notice = models.Notice(name=user_dic['name'], content=user_dic['content'], user_id=user_dic['user_id']) notice.save() back_dic = { 'flag': True, 'msg': 'notice:%s release successfully' % user_dic['name'] } common.send_back(back_dic, conn)
def release_notice(user_dic,conn): ''' 发布公告功能,取出字典中的公告名字,公告内容,用户id,存入数据库 :param user_dic: :param conn: :return: ''' notice = models.Notice(name=user_dic['notice_name'], content=user_dic['notice_content'], user_id=user_dic['user_id']) notice.save() back_dic = {'flag': True, 'msg': '公告发布成功'} common.send_back(back_dic, conn)
def issue_notice_interface(back_dic,conn): title = back_dic.get('title') content = back_dic.get('content') notice_obj = models.Notice( title=title, content=content, create_time=datetime.datetime.now(), u_id=back_dic.get('u_id') ) notice_obj.orm_insert() send_dic = {'flag':True,'msg':'公告发布成功'} common.send_data(send_dic,conn)
def release_notice(message, conn): name = message['name'] content = message['content'] create_time = message['create_time'] user_id = message['user_id'] notice = models.Notice(name=name, content=content, create_time=create_time, user_id=user_id) notice.save() send_dic = {'flag': True, 'msg': '公告发布成功!'} common.send_message(send_dic, conn)
def release_notice(recv_dic,conn): # 直接发布公告 # 哪个管理员发的记录user_id notice_obj = models.Notice(title=recv_dic['title'], content=recv_dic['content'], user_id=recv_dic['user_id'], create_time=common.get_time() ) notice_obj.save() send_dic = {'flag': True, 'msg': '发布公告成功'} common.send_msg(send_dic, conn)
def send_notice_interface(user_dic, conn): notice_obj = models.Notice( title=user_dic.get("title"), content=user_dic.get("content"), create_time=datetime.datetime.now(), user_id=user_dic.get("user_id"), ) notice_obj.instert_sql() send_dic = { "flag": True, "msg": "发布成功", } common.send_msg(send_dic, conn)
def put_notice_interface(client_back_dic, conn): title = client_back_dic.get('title') content = client_back_dic.get('content') user_id = client_back_dic.get('user_id') notice_obj = models.Notice(title=title, content=content, user_id=user_id, create_time=common.get_time()) notice_obj.save() send_dic = { 'msg': '公告发布成功!' } common.send_data(send_dic, conn)
def release_notice(user_dic): notice = models.Notice(user_dic['notice_name'], user_dic['notice_content'], user_dic['name'], common.get_time()) notice.save() back_dic = {'flag': True, 'msg': '发布公告成功'} return back_dic