Exemple #1
0
def AddNotificationInAutoReturn(user_id,borrower_id,book_id):
    book_info = GetBookById(book_id)
    name = ChangeFriendlistToFriendData(borrower_id)[2]
    message = str(name) + "さんが「" + str(book_info[0]) + "」を自動返却しました。"
    AddNotification(user_id,message) # 貸してくれた人に通知がいく
    # 返却しましたの通知の追加
    lender_name = ChangeFriendlistToFriendData(user_id)[2]
    message_lend = "「" + str(book_info[0]) + "」を"+ str(lender_name) +"さんに自動返却しました。"
    AddNotification(borrower_id,message_lend)
Exemple #2
0
def ChangeBooksFromLendInfo(booklist):
    res = []
    for book in booklist:
        own_book = GetOwnBookById(book.own_book_id)
        if own_book != []:
            b = GetBookById(own_book[0].book_id)
            if b != []:
                res.append({"book": b[0], "deadline": book.deadline})
            #res.extend( GetBookById( own_book[0].book_id ) )
    return res
Exemple #3
0
def AddNotificationInReturn(user_id,borrower_id,book_id,return_message):
    book_info = GetBookById(book_id)
    name = ChangeFriendlistToFriendData(borrower_id)[2]
    message = str(name) + "さんが「" + str(book_info[0]) + "」を返却しました。"
    if return_message != None:
        message = message + "\n(コメント)" + return_message # 返却時にメッセージを追加する
    print(user_id,message)
    AddNotification(user_id,message) # 貸してくれた人に通知がいく
    # 返却しましたの通知の追加
    lender_name = ChangeFriendlistToFriendData(user_id)[2]
    message_lend = "「" + str(book_info[0]) + "」を"+ str(lender_name) +"さんに返却しました。"
    AddNotification(borrower_id,message_lend)
Exemple #4
0
def ChangeBooksFromOwnBook(booklist):
    res = []
    for book in booklist:
        res.extend(GetBookById(book.book_id))
    return res
Exemple #5
0
def AddNotificationInLendBuy(user_id,borrower_id,book_id,addpoint):
    book_info = GetBookById(book_id)
    name = ChangeFriendlistToFriendData(borrower_id)[2]
    message = str(name) + "さんが「" + str(book_info[0]) + "」を購入しました。" + str(addpoint) +"ポイントが追加されました。"
    print(user_id,message)
    AddNotification(user_id,message) # 貸してくれた人に通知がいく
Exemple #6
0
def AddNotificationInBorrow(user_id,borrower_id,book_id):
    book_info = GetBookById(book_id)
    name = ChangeFriendlistToFriendData(user_id)[2]
    message = str(name) + "さんが「" + str(book_info[0]) + "」を貸してくれました。"
    AddNotification(borrower_id,message) # 借りた側に通知がいく
Exemple #7
0
def AddNotificationInLend(user_id,borrower_id,book_id):
    book_info = GetBookById(book_id)
    name = ChangeFriendlistToFriendData(borrower_id)[2]
    message = str(name) + "さんに「" + str(book_info[0]) + "」を貸しました。"
    AddNotification(user_id,message)
Exemple #8
0
def AddNotificationInBuy(user_id,book_id):
    book_info = GetBookById(book_id)
    message = "「"+str(book_info[0]) + "」を購入しました"
    AddNotification(user_id,message)