rename
This commit is contained in:
parent
9856d04a20
commit
346e5b27b5
@ -3,7 +3,7 @@ services:
|
||||
cassandra:
|
||||
container_name: cassandra
|
||||
environment:
|
||||
- CASSANDRA_KEYSPACE=userprofileservice
|
||||
- CASSANDRA_KEYSPACE=userservice
|
||||
- TABLE_NAME=users
|
||||
build:
|
||||
context: .
|
||||
@ -16,7 +16,7 @@ services:
|
||||
environment:
|
||||
- CASSANDRA_HOST=cassandra
|
||||
- CASSANDRA_PORT=9042
|
||||
- CASSANDRA_KEYSPACE=userprofileservice
|
||||
- CASSANDRA_KEYSPACE=userservice
|
||||
- CASSANDRA_CONSISTANCY=LOCAL_QUORUM
|
||||
- TABLE_NAME=users
|
||||
- BIDN_SERVICE=:8080
|
||||
@ -25,7 +25,7 @@ services:
|
||||
- AWS_SECRET_ACCESS_KEY=fake-secret
|
||||
- BUCKET_NAME=fake-bucket
|
||||
- AWS_ACL=public-read
|
||||
build:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/api/Dockerfile
|
||||
ports:
|
||||
|
||||
@ -2,7 +2,7 @@ package aws
|
||||
|
||||
import (
|
||||
"io"
|
||||
"userprofileservice/src/utils"
|
||||
"userservice/src/utils"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"userprofileservice/src/model"
|
||||
"userprofileservice/src/structs"
|
||||
"userservice/src/model"
|
||||
"userservice/src/structs"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
|
||||
@ -6,7 +6,7 @@ package mock_controller
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
structs "userprofileservice/src/structs"
|
||||
structs "userservice/src/structs"
|
||||
|
||||
gocql "github.com/gocql/gocql"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"userprofileservice/src/model"
|
||||
"userprofileservice/src/structs"
|
||||
"userservice/src/model"
|
||||
"userservice/src/structs"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
|
||||
@ -3,10 +3,10 @@ package main
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"userprofileservice/src/controller"
|
||||
"userprofileservice/src/model"
|
||||
"userprofileservice/src/utils"
|
||||
"userprofileservice/src/view"
|
||||
"userservice/src/controller"
|
||||
"userservice/src/model"
|
||||
"userservice/src/utils"
|
||||
"userservice/src/view"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@ -3,9 +3,9 @@ package main
|
||||
import (
|
||||
"log"
|
||||
"testing"
|
||||
"userprofileservice/src/controller"
|
||||
mock_controller "userprofileservice/src/controller/mocks"
|
||||
"userprofileservice/src/structs"
|
||||
"userservice/src/controller"
|
||||
mock_controller "userservice/src/controller/mocks"
|
||||
"userservice/src/structs"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
@ -3,7 +3,7 @@ package model
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
"userprofileservice/src/utils"
|
||||
"userservice/src/utils"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
@ -11,7 +11,7 @@ import (
|
||||
func NewCassandra() *gocql.Session {
|
||||
conf := gocql.NewCluster(utils.GetEnv("CASSANDRA_HOST", "cassandra"))
|
||||
conf.Port = utils.ParsePort(utils.GetEnv("CASSANDRA_PORT", "9042"))
|
||||
conf.Keyspace = utils.GetEnv("CASSANDRA_KEYSPACE", "userprofileservice")
|
||||
conf.Keyspace = utils.GetEnv("CASSANDRA_KEYSPACE", "userservice")
|
||||
conf.Consistency = gocql.ParseConsistency(utils.GetEnv("CASSANDRA_CONSISTANCY", "LOCAL_QUORUM"))
|
||||
sess, err := conf.CreateSession()
|
||||
if err != nil {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"userprofileservice/src/structs"
|
||||
"userservice/src/structs"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"userprofileservice/src/structs"
|
||||
"userprofileservice/src/utils"
|
||||
"userservice/src/structs"
|
||||
"userservice/src/utils"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
@ -71,7 +71,7 @@ func (c *ModelCassandra) CreateUser(user *structs.USER) error {
|
||||
|
||||
// GetUser return user data by id
|
||||
func (c *ModelCassandra) GetUser(id gocql.UUID) (*structs.USER, error) {
|
||||
q := `SELECT id, firstname, lastname, currentlocation, birthday, userpicture, certificate
|
||||
q := `SELECT id, firstname, lastname, currentlocation, birthday, userpicture, certificate
|
||||
FROM ` + c.TableName + ` WHERE id = ? LIMIT 1`
|
||||
|
||||
user := &structs.USER{}
|
||||
|
||||
@ -5,7 +5,7 @@ import (
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"userprofileservice/src/structs"
|
||||
"userservice/src/structs"
|
||||
)
|
||||
|
||||
// GetEnv look up ENV settings
|
||||
|
||||
@ -4,12 +4,12 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
"userprofileservice/src/aws"
|
||||
"userprofileservice/src/controller"
|
||||
"userprofileservice/src/structs"
|
||||
"userprofileservice/src/utils"
|
||||
"userservice/src/aws"
|
||||
"userservice/src/controller"
|
||||
"userservice/src/structs"
|
||||
"userservice/src/utils"
|
||||
|
||||
_ "userprofileservice/src/docs"
|
||||
_ "userservice/src/docs"
|
||||
|
||||
"github.com/gocql/gocql"
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user