Giter VIP home page Giter VIP logo

be-dapoint's Introduction

be-dapoint

Repository for dapoint app API

How to use

  1. clone this repo
  2. run go mod verify
  3. run go mod tidy
  4. rename file config.toml.example to config.toml in folder /config
  5. fill username, password, name (database name) in config.toml
  6. move to /app folder in terminal
  7. run go run main.go

Reference

This repository using clean architecture known as hexagonal architecture
image

Credits:
https://github.com/bxcodec/go-clean-arch

ERD

image

List API Dapoint

1. Register user

method: POST
endpoint: "/user/register"
request form-data: {
    name, email, password
}
response(200): {
    "message":"Success"
}

2. List All user

method: GET
endpoint: "/user"
response(200): {
    "message":"Success",
      data: [
              {entities.User}
          ]
}

3. List user by ID

method: GET
endpoint: "/user/{id}"
response(200): {
    "message":"Success",
      data: [
              {entities.User}
          ]
}

4. Login user

method: POST
endpoint: "/user/{id}"
request form-data: {
    email, password
}
response(200): {
    "message":"Success"
}

5. Update user

method: PUT
endpoint: "/user/{id}"
request form-data: {
      {entities.User}
}
response(200): {
    "message":"Success",
    data: [
        {entities.User}
    ]
}

6. Get Total User

method: GET
endpoint: "/user/total"
response(200): {
    "message":"Success",
    data: [
        {entities.User}
    ]
}

7. Get Transaction by UserID

method: GET
endpoint: "/user_transaction/{:userID}"
response(200): {
    "message":"Success",
    data: [
        {entities.Transaction}
    ]
}

8. Get All redeemed voucher by UserID

method: GET
endpoint: "/redeem_history/{:userid}"
response(200): {
    "message":"Success",
    data: [
        {entities.RedeemVoucher}
    ]
}

9. Create Voucher

method: POST
endpoint: "/vouchers/create"
header: {
    Authorization Token
}
request form-data: {
      {entities.Voucher}
}
response(200): {
    "message":"Success",
}

10. Get All Voucher

method: POST
endpoint: "/vouchers/getall"
header: {
    Authorization Token
}
response(200): {
    "message":"Success",
    data: [
        {entities.Voucher}
    ]
}

11. Update Voucher

method: PUT
endpoint: "/vouchers/update/{:id}"
header: {
    Authorization Token
}
request form-data: {
      {entities.Voucher}
}
response(200): {
    "message":"Success",
    data: [
        {entities.Voucher}
    ]
}

13. Get Voucher by ID

method: PUT
endpoint: "/vouchers/getbyid/{:id}"
header: {
    Authorization Token
}
response(200): {
    "message":"Success",
    data: [
        {entities.Voucher}
    ]
}

14. Get Voucher by Type

method: PUT
endpoint: "/vouchers/getbyid/:tipe"
header: {
    Authorization Token
}
response(200): {
    "message":"Success",
    data: [
        {entities.Voucher}
    ]
}

15. Redeem Voucher

method: POST
endpoint: "user/redeem_voucher/"
header: {
    Authorization Token
}
request form-data: {
      {entities.RedeemVoucher}
}
response(200): {
    "message":"Success",
    data: [
        {entities.RedeemVoucher}
    ]
}

16. Transaction Create

method: POST
endpoint: "/admin/user_transaction/create"
header: {
    Authorization Token
}
request form-data: {
      {entities.Transactions}
}
response(200): {
    "message":"Success",
    data: [
        {entities.Transactions}
    ]
}

17. Get All Transaction

method: GET
endpoint: "/admin/user_transaction/getall"
response(200): {
    "message":"Success",
    data: [
        {entities.Transactions}
    ]
}

be-dapoint's People

Contributors

iqbalabdi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.