tsk-40: Get Contact bug (#46)
Closes #40 Reviewed-on: phoenix/textsender-api#46 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
@@ -3,7 +3,7 @@ module git.kundeng.us/phoenix/textsender-api
|
|||||||
go 1.25.4
|
go 1.25.4
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.kundeng.us/phoenix/textsender-models v0.0.9
|
git.kundeng.us/phoenix/textsender-models v0.0.10
|
||||||
github.com/go-chi/chi/v5 v5.2.3
|
github.com/go-chi/chi/v5 v5.2.3
|
||||||
github.com/golang-jwt/jwt/v5 v5.3.0
|
github.com/golang-jwt/jwt/v5 v5.3.0
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
git.kundeng.us/phoenix/textsender-models v0.0.9 h1:wHEbDLYzMpXQ8OaIf05xFY1V19iTpQogTJEuKInkjEQ=
|
git.kundeng.us/phoenix/textsender-models v0.0.9 h1:wHEbDLYzMpXQ8OaIf05xFY1V19iTpQogTJEuKInkjEQ=
|
||||||
git.kundeng.us/phoenix/textsender-models v0.0.9/go.mod h1:9iPDQJg1Tc6WMNoW5+f8YKmnosMwlWHJ++hmxNLDEe0=
|
git.kundeng.us/phoenix/textsender-models v0.0.9/go.mod h1:9iPDQJg1Tc6WMNoW5+f8YKmnosMwlWHJ++hmxNLDEe0=
|
||||||
|
git.kundeng.us/phoenix/textsender-models v0.0.10 h1:0AMe/zm4Xte2BcuqqhRP7+42m+4To+rUnHkR2a9eXlI=
|
||||||
|
git.kundeng.us/phoenix/textsender-models v0.0.10/go.mod h1:9iPDQJg1Tc6WMNoW5+f8YKmnosMwlWHJ++hmxNLDEe0=
|
||||||
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
|
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
|
||||||
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
|
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestAddContact struct {
|
type RequestAddContact struct {
|
||||||
@@ -20,11 +20,6 @@ type AddContactResponse struct {
|
|||||||
Data []contact.Contact `json:"data"`
|
Data []contact.Contact `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetContactResponse struct {
|
|
||||||
Message string `json:"message"`
|
|
||||||
Data []contact.Contact `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ContactHandler struct {
|
type ContactHandler struct {
|
||||||
ContactStore store.ContactStore
|
ContactStore store.ContactStore
|
||||||
}
|
}
|
||||||
@@ -88,6 +83,11 @@ func (c *ContactHandler) AddContact(w http.ResponseWriter, r *http.Request) {
|
|||||||
RespondWithJSON(w, statusCode, &resp)
|
RespondWithJSON(w, statusCode, &resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetContactResponse struct {
|
||||||
|
Message string `json:"message"`
|
||||||
|
Data []contact.Contact `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
// GetContact godoc
|
// GetContact godoc
|
||||||
// @Summary Get contact
|
// @Summary Get contact
|
||||||
// @Description Get a contact record to have a recipient to send a text to (requires JWT)
|
// @Description Get a contact record to have a recipient to send a text to (requires JWT)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
|
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestAddMessage struct {
|
type RequestAddMessage struct {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message"
|
"git.kundeng.us/phoenix/textsender-models/tx0/message"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ package handler
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestScheduledMessageStatus struct {
|
type RequestScheduledMessageStatus struct {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestAddScheduledMessage struct {
|
type RequestAddScheduledMessage struct {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
"git.kundeng.us/phoenix/textsender-api/internal/store"
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestAddScheduledMessageEvent struct {
|
type RequestAddScheduledMessageEvent struct {
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
|
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message"
|
"git.kundeng.us/phoenix/textsender-models/tx0/message"
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ package services
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
txtmodels_token "git.kundeng.us/phoenix/textsender-models/tx0/token"
|
||||||
|
txtmodels_user "git.kundeng.us/phoenix/textsender-models/tx0/user"
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
|
|
||||||
txtmodels_token "git.kundeng.us/phoenix/textsender-models/pkg/token"
|
|
||||||
txtmodels_user "git.kundeng.us/phoenix/textsender-models/pkg/user"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type JWTService struct {
|
type JWTService struct {
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
"github.com/jackc/pgx/v5/pgxpool"
|
"github.com/jackc/pgx/v5/pgxpool"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ContactStore interface {
|
type ContactStore interface {
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
"github.com/jackc/pgx/v5/pgxpool"
|
"github.com/jackc/pgx/v5/pgxpool"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type MessageStore interface {
|
type MessageStore interface {
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/contact"
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/contact"
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Key struct {
|
type Key struct {
|
||||||
|
|||||||
@@ -6,9 +6,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ScheduledMessageEventKey struct {
|
type ScheduledMessageEventKey struct {
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ScheduledMessageKey struct {
|
type ScheduledMessageKey struct {
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
"github.com/jackc/pgx/v5/pgxpool"
|
"github.com/jackc/pgx/v5/pgxpool"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ScheduledMessageEventStore interface {
|
type ScheduledMessageEventStore interface {
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/message/scheduling"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/jackc/pgx/v5"
|
"github.com/jackc/pgx/v5"
|
||||||
"github.com/jackc/pgx/v5/pgxpool"
|
"github.com/jackc/pgx/v5/pgxpool"
|
||||||
|
|
||||||
"git.kundeng.us/phoenix/textsender-models/pkg/message/scheduling"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ScheduledMessageStore interface {
|
type ScheduledMessageStore interface {
|
||||||
|
|||||||
Reference in New Issue
Block a user