This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import click | |
def copy_or_move_files_from_folder_to_folder(from_folder, to_folder, task='copy', recursive=True): | |
for current_file in os.listdir(from_folder): | |
path_to_source = os.path.join(from_folder, current_file) | |
path_to_destination = os.path.join(to_folder, current_file) | |
if os.path.isfile(path_to_source): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package entity | |
type Order struct { | |
ID string | |
UserID string | |
Sum float64 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
import ( | |
"dashboard/order/domain/entity" | |
) | |
type IOrderService interface { | |
GetOrder(id string) (entity.Order, error) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package infrastructure | |
import ( | |
"dashboard/order/domain/entity" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
type OrderService struct{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flamingo.me/dingo" | |
"flamingo.me/flamingo/v3" | |
"flamingo.me/flamingo/v3/core/requestlogger" | |
) | |
func main() { | |
flamingo.App( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ( | |
OrderController struct { | |
responder *web.Responder | |
orderService service.IOrderService | |
} | |
GetOrderResponse struct { | |
Order entity.Order | |
} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (orderController *OrderController) Inject( | |
responder *web.Responder, | |
orderService service.IOrderService, | |
) { | |
orderController.responder = responder | |
orderController.orderService = orderService | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (orderController *OrderController) Get(ctx context.Context, req *web.Request) web.Result { | |
orderID, err := req.Query1(orderIDKey) | |
if err != nil { | |
return orderController.responder.ServerError(err) | |
} | |
order, err := orderController.orderService.GetOrder(orderID) | |
if err != nil { | |
return orderController.responder.ServerError(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import ( | |
"dashboard/api/interfaces" | |
"flamingo.me/flamingo/v3/framework/web" | |
) | |
type Routes struct { | |
orderController application.OrderController | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import ( | |
"dashboard/order/domain/service" | |
"dashboard/order/infrastructure" | |
"flamingo.me/dingo" | |
"flamingo.me/flamingo/v3/framework/web" | |
"os" | |
) |
OlderNewer