Repository for dapoint app API
- clone this repo
- run
go mod verify
- run
go mod tidy
- rename file
config.toml.example
toconfig.toml
in folder/config
- fill username, password, name (database name) in
config.toml
- move to
/app
folder in terminal - run
go run main.go
This repository using clean architecture known as hexagonal architecture
Credits:
https://github.com/bxcodec/go-clean-arch
method: POST
endpoint: "/user/register"
request form-data: {
name, email, password
}
response(200): {
"message":"Success"
}
method: GET
endpoint: "/user"
response(200): {
"message":"Success",
data: [
{entities.User}
]
}
method: GET
endpoint: "/user/{id}"
response(200): {
"message":"Success",
data: [
{entities.User}
]
}
method: POST
endpoint: "/user/{id}"
request form-data: {
email, password
}
response(200): {
"message":"Success"
}
method: PUT
endpoint: "/user/{id}"
request form-data: {
{entities.User}
}
response(200): {
"message":"Success",
data: [
{entities.User}
]
}
method: GET
endpoint: "/user/total"
response(200): {
"message":"Success",
data: [
{entities.User}
]
}
method: GET
endpoint: "/user_transaction/{:userID}"
response(200): {
"message":"Success",
data: [
{entities.Transaction}
]
}
method: GET
endpoint: "/redeem_history/{:userid}"
response(200): {
"message":"Success",
data: [
{entities.RedeemVoucher}
]
}
method: POST
endpoint: "/vouchers/create"
header: {
Authorization Token
}
request form-data: {
{entities.Voucher}
}
response(200): {
"message":"Success",
}
method: POST
endpoint: "/vouchers/getall"
header: {
Authorization Token
}
response(200): {
"message":"Success",
data: [
{entities.Voucher}
]
}
method: PUT
endpoint: "/vouchers/update/{:id}"
header: {
Authorization Token
}
request form-data: {
{entities.Voucher}
}
response(200): {
"message":"Success",
data: [
{entities.Voucher}
]
}
method: PUT
endpoint: "/vouchers/getbyid/{:id}"
header: {
Authorization Token
}
response(200): {
"message":"Success",
data: [
{entities.Voucher}
]
}
method: PUT
endpoint: "/vouchers/getbyid/:tipe"
header: {
Authorization Token
}
response(200): {
"message":"Success",
data: [
{entities.Voucher}
]
}
method: POST
endpoint: "user/redeem_voucher/"
header: {
Authorization Token
}
request form-data: {
{entities.RedeemVoucher}
}
response(200): {
"message":"Success",
data: [
{entities.RedeemVoucher}
]
}
method: POST
endpoint: "/admin/user_transaction/create"
header: {
Authorization Token
}
request form-data: {
{entities.Transactions}
}
response(200): {
"message":"Success",
data: [
{entities.Transactions}
]
}
method: GET
endpoint: "/admin/user_transaction/getall"
response(200): {
"message":"Success",
data: [
{entities.Transactions}
]
}