-
Notifications
You must be signed in to change notification settings - Fork 0
comments #1
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
base: master
Are you sure you want to change the base?
comments #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,15 +7,16 @@ import ( | |
| "eCommerce/registry/internal/models" | ||
| "encoding/json" | ||
| "errors" | ||
| "io/ioutil" | ||
| "net/http" | ||
| "time" | ||
|
|
||
| "github.com/segmentio/kafka-go" | ||
| "go.mongodb.org/mongo-driver/bson" | ||
| "go.mongodb.org/mongo-driver/bson/primitive" | ||
| "go.mongodb.org/mongo-driver/mongo" | ||
| "go.mongodb.org/mongo-driver/mongo/options" | ||
| "go.uber.org/zap" | ||
| "io/ioutil" | ||
| "net/http" | ||
| "time" | ||
| ) | ||
|
|
||
| type RegistryController interface { | ||
|
|
@@ -183,6 +184,7 @@ func Identity(r *http.Request) (*models.Identity, error) { | |
| return identity, nil | ||
| } | ||
|
|
||
| // А можешь пояснить, зачем столько вариантов? | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Для GET запросов неполучится из тела запроса uid получить, и я добавил для параметров. |
||
| return nil, errors.New(`no identity`) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,18 +3,19 @@ package data | |
| import ( | ||
| "context" | ||
| "eCommerce/registry/internal/models" | ||
| "time" | ||
|
|
||
| "go.mongodb.org/mongo-driver/bson" | ||
| "go.mongodb.org/mongo-driver/bson/primitive" | ||
| "go.mongodb.org/mongo-driver/mongo" | ||
| "go.mongodb.org/mongo-driver/mongo/options" | ||
| "time" | ||
| ) | ||
|
|
||
| type RegistryRepository interface { | ||
| FindOrderId(id primitive.ObjectID) (*models.Order, error) | ||
| UpdateOrder(id primitive.ObjectID, updates []bson.E) (*models.Order, error) | ||
| UpdateOrderStatus(id primitive.ObjectID, status models.OrderStatus) (*models.Order, error) | ||
| Commit() error | ||
| Commit() error // Искал, куда ты хотел вставить этот метод, но не нашёл в коде) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Да, убрать надо |
||
| } | ||
|
|
||
| type MongoRegistryRepository struct { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не совсем очевидно.
Думаю проблема в том, что потом для пользователя надо будет преобразовывать значение к его временной зоне.
И возможно здесь Timestamp не отражает, что он в UTC и лучше было бы использовать название TimestampUTC.