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 repository | |
| import ( | |
| "database/sql" | |
| "github.com/nightsilvertech/cake/src/repository/cakeRepository" | |
| ) | |
| type Pool struct { | |
| CakeRepository cakeRepository.Repository | |
| } |
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 cakeRepository | |
| import ( | |
| "context" | |
| "database/sql" | |
| "github.com/nightsilvertech/cake/src/model/model" | |
| ) | |
| const ( | |
| WriteCakeSQLS = `INSERT INTO cakes(id, title, rating , image, description, created_at, updated_at) VALUES (?,?,?,?,?,?,?)` |
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 usecase | |
| import ( | |
| "github.com/nightsilvertech/cake/src/repository" | |
| "github.com/nightsilvertech/cake/src/usecase/cakeUsecase" | |
| ) | |
| type Pool struct { | |
| CakeUsecase cakeUsecase.Usecase | |
| } |
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
| program_id | merch_id | max_amount | max_usage | nik | max_amount_limit | max_usage_limit | |
|---|---|---|---|---|---|---|---|
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081235910912 | 1000000 | 100 | 1234285928958298 | 1000000 | 100 | |
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081219192920 | 1000000 | 100 | 1234512093928409 | 1000000 | 100 | |
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081290900921 | 1000000 | 100 | 1234293089389411 | 1000000 | 100 | |
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081298989128 | 1000000 | 100 | 1234984910988529 | 1000000 | 100 |
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
| program_id | cust_id | max_amount | max_usage | nik | max_amount_limit | max_usage_limit | |
|---|---|---|---|---|---|---|---|
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081299001199 | 1000000 | 100 | 1234285928191002 | 1000000 | 100 | |
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081228888118 | 1000000 | 100 | 1234567891231928 | 1000000 | 100 | |
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081211990022 | 1000000 | 100 | 1234567891182858 | 1000000 | 100 | |
| 26f9a933-db4a-4430-b1de-3be60cc49d97 | 081277338817 | 1000000 | 100 | 1234560291092083 | 1000000 | 100 |
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 ( | |
| "encoding/csv" | |
| "errors" | |
| "fmt" | |
| "net/http" | |
| "reflect" | |
| "strings" | |
| ) |
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 generator | |
| import ( | |
| "github.com/stretchr/testify/suite" | |
| "testing" | |
| ) | |
| // otpTestSuite embedding suite.Suite of testify | |
| type otpTestSuite struct { | |
| suite.Suite |
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 generator | |
| import ( | |
| "crypto/rand" | |
| "errors" | |
| "fmt" | |
| ) | |
| func OTP(length int) (string, error) { | |
| const otpChars = "1234567890" |
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 main() { | |
| databaseUrl := fmt.Sprintf( | |
| "%s:%s@tcp(%s:%s)/%s?parseTime=true", | |
| "root", | |
| "root", | |
| "localhost", | |
| "3306", | |
| "example", | |
| ) | |
| db, err := sql.Open("mysql", databaseUrl) |
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 repository | |
| func (r repo) WriteExample(example Example) error { | |
| const query = `INSERT INTO example(content) VALUES (?)` | |
| stmt, err := r.db.Prepare(query) | |
| if err != nil { | |
| return err | |
| } |
NewerOlder