Refactored the code some more
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
package config
|
||||
|
||||
import "fmt"
|
||||
|
||||
const PORT = 8080
|
||||
|
||||
const APP_NAME = "textsender-api"
|
||||
|
||||
func PortString() string {
|
||||
portMessage := fmt.Sprintf(":%d", PORT)
|
||||
|
||||
return portMessage
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package handler
|
||||
|
||||
import "net/http"
|
||||
|
||||
import "git.kundeng.us/phoenix/textsender-api/internal/model"
|
||||
|
||||
func DraftMessageHandler(w http.ResponseWriter, r *http.Request) {
|
||||
da := MessageItem{
|
||||
da := model.MessageItem{
|
||||
Id: 1,
|
||||
Message: "The Word",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package model
|
||||
|
||||
type MessageItem struct {
|
||||
Id int `json:"id"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
Reference in New Issue
Block a user