def addMember(self, memberData): del memberData['confirm'] memberDB = db() memberDB.insertMember(memberData) return
def login(self, admin): adminId = admin['adminId'] password = admin['password'] adminDB = db() checkValidAdmin = adminDB.findAdmin({"adminId": adminId}) try: if checkValidAdmin['password'] == password: return True else: return False except: return False
def loginMember(self, memberData): id = memberData['id'] print(type(id)) pwd = memberData['password'] print(memberData) memberDB = db() dbData = memberDB.findMember({"id": id}) try: if dbData['password'] == pwd: return True else: return False except: return False
def deleteUser(self, userId): adminDB = db() return adminDB.deleteMember(userId)
def getUserList(self): adminDB = db() return adminDB.findAllMember()
def writeBoard(self, boardData): boardDB = db() boardDB.insertBoard(boardData) return
def viewBoardContent(self, sno): boardDB = db() contents = boardDB.findBoardContent({"sno": int(sno)}) return contents
def viewBoardList(self): boardDB = db() boardList = boardDB.findBoardTitle() return boardList