This file contains hidden or 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
| using System; | |
| using System.Threading.Tasks; | |
| using Customer.Domain.Commands; | |
| using Customer.Domain.Dtos; | |
| using Customer.Domain.Queries; | |
| using MediatR; | |
| using Microsoft.AspNetCore.Mvc; | |
| namespace Customer.API.Controllers | |
| { |
This file contains hidden or 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
| "ConnectionStrings": { | |
| "DefaultConnection": "Data Source=localhost;Initial Catalog=CustomerDB;User Id=sa;Password=Demo123456@;" | |
| } |
This file contains hidden or 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
| FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env | |
| WORKDIR /app | |
| COPY . ./ | |
| RUN dotnet restore | |
| RUN dotnet publish -c Release -o out | |
| FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 | |
| WORKDIR /app | |
| COPY --from=build-env /app/Customer.API/out . |
This file contains hidden or 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
| version: '2' | |
| services: | |
| customer-api: | |
| container_name: customer-api | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| depends_on: | |
| - mssql |
This file contains hidden or 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 cmd | |
| import ( | |
| "fmt" | |
| "github.com/spf13/cobra" | |
| "os" | |
| ) | |
| var rootCmd = &cobra.Command{ | |
| Use: "zmp3", |
This file contains hidden or 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 "github.com/ducmeit1/zmp3/cmd" | |
| func main() { | |
| cmd.Execute() | |
| } |
This file contains hidden or 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 cmd | |
| import ( | |
| "fmt" | |
| "github.com/spf13/cobra" | |
| ) | |
| var downloadSongCmd = &cobra.Command{ | |
| Use: "song", | |
| Short: "Download MP3 song from Zing MP3", |
This file contains hidden or 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 pkg | |
| import ( | |
| "github.com/ducmeit1/zmp3/pkg/common" | |
| "github.com/ducmeit1/zmp3/pkg/zingmp3" | |
| "github.com/mitchellh/go-homedir" | |
| "github.com/spf13/viper" | |
| "os" | |
| "path" | |
| ) |
This file contains hidden or 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 common | |
| import ( | |
| "github.com/manifoldco/promptui" | |
| "strconv" | |
| ) | |
| func PromptString(name string) (string, error) { | |
| prompt := promptui.Prompt{ | |
| Label: name, |
This file contains hidden or 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 setNewConfig() error { | |
| cfg, err := promptSetNewConfig() | |
| if err != nil { | |
| return err | |
| } | |
| err = pkg.WriteConfigFile(cfg) | |
| if err != nil { | |
| return err | |
| } |