Example #1
0
 def put(self, args):
     """
     edit
     """
     record = None
     notice_contentDao = Notice_contentDao()
     try:
         record = notice_contentDao.edit(args)
     except Exception as e:
         abort(500, e)
     return record
Example #2
0
 def post(self, args):
     """
     add
     """
     record = None
     categoryDao = CategoryDao()
     try:
         record = categoryDao.add(args)
     except Exception as e:
         abort(500, e)
     return record
Example #3
0
 def put(self, args):
     """
     edit
     """
     record = None
     configsDao = ConfigsDao()            
     try:
         record = configsDao.edit(args)
     except Exception as e:
         abort(500, e)        
     return record
Example #4
0
 def put(self, args):
     """
     edit # 编辑
     """
     record = None
     adminDao = AdminDao()
     try:
         record = adminDao.edit(args)
     except Exception as e:
         abort(500, e)
     return record
Example #5
0
 def post(self, args):
     """
     add # 增加
     """
     admin = None
     adminDao = AdminDao()
     try:
         admin = adminDao.add(args)
     except Exception as e:
         abort(500, e)
     return admin
Example #6
0
 def put(self, args):
     """
     edit
     """
     record = None
     attachmentsDao = AttachmentsDao()
     try:
         record = attachmentsDao.edit(args)
     except Exception as e:
         abort(500, e)
     return record
Example #7
0
 def put(self, args):
     """
     edit
     """
     record = None
     profilesDao = ProfilesDao()
     try:
         record = profilesDao.edit(args)
     except Exception as e:
         abort(500, e)
     return record
Example #8
0
 def post(self, args):
     """
     add
     """
     configs = None
     configsDao = ConfigsDao()
     try:
         configs = configsDao.add(args)
     except Exception as e:
         abort(500, e)       
     return configs
Example #9
0
 def get(self):
     """
     view
     """
     record = None
     profilesDao = ProfilesDao()
     uid = request.uid
     record = profilesDao.getByUid(uid)
     if not record:
         abort(500, 'Profiles Info is Null')
     return record
Example #10
0
 def post(self, args):
     """
     add
     """
     record = None
     irisDao = IrisDao()
     try:
         record = irisDao.add(args)
     except Exception as e:
         abort(500, e)
     return record
Example #11
0
 def post(self, args):
     """
     add
     """
     profiles = None
     profilesDao = ProfilesDao()
     try:
         profiles = profilesDao.add(args)
     except Exception as e:
         abort(500, e)
     return profiles
Example #12
0
 def post(self, args):
     """
     add
     """
     attachments = None
     attachmentsDao = AttachmentsDao()
     try:
         attachments = attachmentsDao.add(args)
     except Exception as e:
         abort(500, e)
     return attachments
Example #13
0
 def post(self, args):
     """
     add
     """
     logs = None
     logsDao = LogsDao()
     try:
         logs = logsDao.add(args)
     except Exception as e:
         abort(500, e)
     return logs
Example #14
0
 def post(self, args):
     """
     add
     """
     roles = None
     rolesDao = RolesDao()
     try:
         roles = rolesDao.add(args)
     except Exception as e:
         abort(500, e)
     return roles
Example #15
0
 def get(self):
     """
     Sort by tree # 分类重新树形排序
     """
     result = True
     categoryDao = CategoryDao()
     try:
         categoryDao.setTreeInfoWithAllRecord()
     except Exception as e:
         abort(500, e)
     return {"status": result}
Example #16
0
 def post(self, args):
     """
     add
     """
     record = None
     notice_contentDao = Notice_contentDao()
     try:
         record = notice_contentDao.add(args)
     except Exception as e:
         abort(500, e)
     return record
Example #17
0
 def get(self):
     """
     Get Own RBAC with user token # 使用用户令牌得到RBAC信息
     """
     rbacDetail = {}
     uid = request.uid
     adminDao = AdminDao()
     try:
         rbacDetail = adminDao.getRBAC(uid)
     except Exception as e:
         abort(500, e)
     return rbacDetail
Example #18
0
 def post(self, args):
     """
     Get RBAC with user id # 用户ID获取RBAC信息
     """
     rbacDetail = {}
     uid = args.get('id')
     adminDao = AdminDao()
     try:
         rbacDetail = adminDao.getRBAC(uid)
     except Exception as e:
         abort(500, e)
     return rbacDetail
Example #19
0
 def delete(self, args):
     """
     delete
     """
     result = False
     ids = args.get('ids')
     configsDao = ConfigsDao()      
     try:
         result = configsDao.delete(ids)
     except Exception as e:
         abort(500, e)
     return {"status":result}
Example #20
0
 def delete(self, args):
     """
     del # 删除
     """
     result = False
     ids = args.get('ids')
     adminDao = AdminDao()
     try:
         result = adminDao.delete(ids)
     except Exception as e:
         abort(500, e)
     return {"status": result}
Example #21
0
 def delete(self, args):
     """
     delete
     """
     result = False
     ids = args.get('ids')
     notice_contentDao = Notice_contentDao()
     try:
         result = notice_contentDao.delete(ids)
     except Exception as e:
         abort(500, e)
     return {"status": result}
Example #22
0
 def delete(self, args):
     """
     delete
     """
     result = False
     ids = args.get('ids')
     attachmentsDao = AttachmentsDao()
     try:
         result = attachmentsDao.delete(ids)
     except Exception as e:
         abort(500, e)
     return {"status": result}
Example #23
0
 def post(self, args):
     """
     Add admin and roles relationships # 增加用户和角色关系
     """
     result = False
     rids = args.get('rids')
     uids = args.get('uids')
     adminDao = AdminDao()
     try:
         result = adminDao.addAdminRoles(uids, rids)
     except Exception as e:
         abort(500, e)
     return {"status": result}
Example #24
0
 def post(self, args):
     """
     add
     """
     record = None
     id = args.get('uid')
     ids = args.get('ids')
     notice_contentDao = Notice_contentDao()
     try:
         record = notice_contentDao.addAdmin(id, ids)
     except Exception as e:
         abort(500, e)
     return record
Example #25
0
 def delete(self, args):
     """
     del
     """
     result = False
     ids = args.get('ids')
     uid = request.uid
     logsDao = LogsDao()
     try:
         result = logsDao.deleteByUid(ids, uid)
     except Exception as e:
         abort(500, e)
     return {"status": result}
Example #26
0
 def post(self, args):
     """
     Retrieve the password # 找回密码
     """
     result = False
     receiver = args.get('email')
     adminDao = AdminDao()
     try:
         result = adminDao.findPass(receiver)
     except Exception as e:
         abort(500, e)
     if result:
         return Result.success()
     return Result.error()
Example #27
0
 def post(self):
     """
     upload avatar # 上传头像
     """
     uid = request.uid
     rfile = request.files.get('file')
     filesize = request.form['size']
     data = {}
     attachmentsDao = AttachmentsDao()
     try:
         data = attachmentsDao.upload_avatar(uid, rfile, filesize)
     except Exception as e:
         abort(500, e)
     return Result.success(data)
Example #28
0
 def post(self, args):
     """
     Login # 登录
     """
     data = {}
     username = args.pop('username')
     password = args.pop('password')
     adminDao = AdminDao()
     try:
         data = adminDao.login(username, password)
     except Exception as e:
         abort(500, e)
     if data:
         return Result.success(data)
     return Result.error(data, message="Account or Password Error")
Example #29
0
 def post(self, args):
     """
     Reflesh Token # 刷新令牌
     """
     data = {}
     rftoken = args.pop('rftoken')
     username = args.pop('username')
     adminDao = AdminDao()
     try:
         data = adminDao.reflesh_token(rftoken, username)
     except Exception as e:
         abort(500, e)
     if data:
         return Result.success(data)
     return Result.error(data, message="Reflesh Token Fail")
Example #30
0
    def get(self, args):
        """
        Download image data through the image URL and save it locally, and return the locally saved URL
        通过图像的URL下载图像数据并保存至本地,返回本地保存的URL

        """
        uid = request.uid
        args.setdefault('remote_img_url', '')
        remote_img_url = args.pop('remote_img_url')
        data = {}
        attachmentsDao = AttachmentsDao()
        try:
            data = attachmentsDao.getLocalImgURL(uid, remote_img_url)
        except Exception as e:
            abort(500, e)
        return data