forked from tildetown/bbj2
stuff
parent
9d8bd4a2df
commit
b804ae9d32
|
@ -1,7 +1,31 @@
|
||||||
package db
|
package db
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
ID string
|
ID string
|
||||||
Username string
|
Username string
|
||||||
Hash string
|
Hash string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Thread struct {
|
||||||
|
ID string `json:"thread_id"`
|
||||||
|
Author string
|
||||||
|
Title string
|
||||||
|
LastMod time.Time `json:"last_mod"`
|
||||||
|
Created time.Time
|
||||||
|
ReplyCount int `json:"reply_count"`
|
||||||
|
Pinned int // TODO bool
|
||||||
|
LastAuthor string `json:"last_author"`
|
||||||
|
Messages []Message
|
||||||
|
}
|
||||||
|
|
||||||
|
type Message struct {
|
||||||
|
ThreadID string `json:"thread_id"`
|
||||||
|
PostID string `json:"post_id"`
|
||||||
|
Author string
|
||||||
|
Created time.Time
|
||||||
|
Edited int // TODO bool
|
||||||
|
Body string
|
||||||
|
SendRaw int `json:"send_raw"` // TODO bool
|
||||||
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"git.tilde.town/tildetown/bbj2/server/cmd/api"
|
"git.tilde.town/tildetown/bbj2/server/cmd/api"
|
||||||
"git.tilde.town/tildetown/bbj2/server/cmd/config"
|
"git.tilde.town/tildetown/bbj2/server/cmd/config"
|
||||||
|
@ -138,6 +137,8 @@ func handler(opts config.Options, f http.HandlerFunc) http.HandlerFunc {
|
||||||
// encryption, it doesn't really help anything. I'd rather have plaintext +
|
// encryption, it doesn't really help anything. I'd rather have plaintext +
|
||||||
// transport encryption and then, on the server side, proper salted hashing.
|
// transport encryption and then, on the server side, proper salted hashing.
|
||||||
|
|
||||||
|
// TODO get rid of these
|
||||||
|
|
||||||
func writeResponse(w http.ResponseWriter, resp api.BBJResponse) {
|
func writeResponse(w http.ResponseWriter, resp api.BBJResponse) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
@ -555,25 +556,3 @@ func setupAPI(opts config.Options) {
|
||||||
}))
|
}))
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
type Thread struct {
|
|
||||||
ID string `json:"thread_id"`
|
|
||||||
Author string
|
|
||||||
Title string
|
|
||||||
LastMod time.Time `json:"last_mod"`
|
|
||||||
Created time.Time
|
|
||||||
ReplyCount int `json:"reply_count"`
|
|
||||||
Pinned int // TODO bool
|
|
||||||
LastAuthor string `json:"last_author"`
|
|
||||||
Messages []Message
|
|
||||||
}
|
|
||||||
|
|
||||||
type Message struct {
|
|
||||||
ThreadID string `json:"thread_id"`
|
|
||||||
PostID string `json:"post_id"`
|
|
||||||
Author string
|
|
||||||
Created time.Time
|
|
||||||
Edited int // TODO bool
|
|
||||||
Body string
|
|
||||||
SendRaw int `json:"send_raw"` // TODO bool
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue