auction-go

module
v0.0.0-...-e7e69c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: MIT

README

Translations:


🔨 Basic Auction System (auction-go)

Project Logo

Welcome to the basic auction system developed in Go! This project allows you to create and consult auctions, users, and bids, as well as determine the winner of an auction.

📑 Table of Contents

📖 Introduction

This basic auction system is a project developed in Go that allows the creation and consultation of auctions, users, and bids. It provides a simple and efficient way to manage auctions and determine the winner based on received bids.

🛠 Prerequisites

Make sure you have the following items installed before continuing:

⚙️ Installation

  1. Clone this repository:

    git clone git@github.com:rodrigoachilles/auction-go.git
    cd auction-go
    
  2. Run Docker Compose:

    docker-compose up -d
    

🚀 Usage

After starting Docker Compose, you can use the API to create and consult auctions, users, and bids.

🔧 Running Services
  1. Navigate to the main project folder:

    cd auction-go
    
  2. Run the Go server:

    go run cmd/auction/main.go
    
📚 Available Endpoints
Create User
POST /users
  • Body (JSON):
{
   "name": "John Doe"
}
Get User
GET /users/{id}
List Users
GET /users
Create Auction
POST /auctions
  • Body (JSON):
{
   "product_name": "Product Name",
   "category": "Category",
   "description": "Product Description",
   "condition": 0
}
Get Auction
GET /auctions/{id}
List Auctions
GET /auctions?status=0&category=""&productName=""
Determine Auction Winner
GET /auctions/{id}/winner
Get Auction Bids
GET /auctions/{id}/bids
Create Bid
POST /bids
  • Body (JSON):
{
  "user_id": 1,
  "auction_id": 1,
  "amount": 100.0
}

🔍 Examples

Here are some usage examples of the auction system endpoints:

  • Create a new user and consult their information.
  • Create a new auction and add bids.
  • Consult all bids of a specific auction and determine the winner.

🤝 Contribution

Feel free to open issues or submit pull requests for improvements and bug fixes.

📜 License

This project is licensed under the MIT License.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL