8000 Dev by GonarchX · Pull Request #4 · WebmiRU/slick · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Dev #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package db

import (
"fmt"
"log"

"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"log"
)

type User struct {
Expand Down Expand Up @@ -76,6 +77,14 @@ func GetMessageChannelList(userId int64, channelId int64) *[]MessageChannel {
return &messages
}

func SavePrivateMessage(senderId int64, receiverId int64, msg string) {
_, e = db.Exec(`INSERT INTO private_message (sender_id, receiver_id, "value") VALUES ($1, $2, $3)`, senderId, receiverId, msg)

if e != nil {
fmt.Println(e)
}
}

func checkError(e error) {
if e != nil {
log.Fatalln(e)
Expand Down
Loading
0