Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/prongbang/goclean

Go Clean Architecture
https://github.com/prongbang/goclean

clean clean-architecture clean-code echo-framework go golang unit-testing

Last synced: about 1 month ago
JSON representation

Go Clean Architecture

Awesome Lists containing this project

README

        

# Go Clean Architechture

[![Build Status](https://github.com/prongbang/goclean/workflows/Go/badge.svg)](https://github.com/prongbang/goclean/actions)
[![Codecov](https://img.shields.io/codecov/c/github/prongbang/goclean.svg)](https://codecov.io/gh/prongbang/goclean)
[![Go Report Card](https://goreportcard.com/badge/github.com/prongbang/goclean)](https://goreportcard.com/report/github.com/prongbang/goclean)


ภาพจาก blog.cleancoder.com

### Swagger Generate

```
$ make swaggen
```

- http://localhost:1323/swagger/index.html

### REST API

```
$ make run
```

#### ADD

- Request

```
POST http://localhost:1323/api/v1/promotion
```

Body

```
{
"id": 1,
"code": "sd-promo",
"name": "Sunday promotion",
"priority": 4,
"exclusive": false,
"used": 0,
"couponBased": false,
"rules": [],
"actions": [],
"createdAt": "2017-02-28T12:05:12+0100",
"updatedAt": "2017-02-28T12:05:13+0100",
"channels": [],
"_links": {
"self": {
"href": "\/api\/v1\/promotions\/sd-promo"
}
}
}
```

#### GET ALL

- Request

```
GET http://localhost:1323/api/v1/promotion

```

#### GET BY ID

- Request

```
GET http://localhost:1323/api/v1/promotion/1

```