juankis / registry

api to registry new users

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Registry

Requirements

  • go get github.com/go-sql-driver/mysql
  • go get github.com/gin-gonic/gin
  • go get github.com/jmoiron/sqlx

Install

  • go get github.com/juankis/registry

Run

  • In registry folder run in the console: go run api/src/main/main.go

Endpoints

Examples

Post registry

  • Request
{
	"data":{
		"nombre":"jun carlos", 
		"apellido":"jun carlos", 
		"correo":"juanki@mail", 
		"telefono": "783278234", 
		"type_customer":1
		}
}
  • Response
{
    "id": 1,
    "nombre": "jun carlos",
    "apellido": "jun carlos",
    "correo": "estilista@gmail.com",
    "telefono": "783278234",
    "type_customer": 1,
    "created_at": "2019-03-23 09:20:07"
}

Get all registry

  • Request
  • localhost:8080/registry
  • Response
[
    {
        "id": 1,
        "nombre": "jun carlos",
        "apellido": "jun carlos",
        "correo": "estilista@gmail.com",
        "telefono": "783278234",
        "type_customer": 1,
        "created_at": "2019-03-23 09:20:07"
    },
    {
        "id": 2,
        "nombre": "Ricardo Tapia",
        "correo": "estilista@gmail.com",
        "telefono": "78687698",
        "type_customer": 1,
        "created_at": "2019-03-23 09:20:13"
    }

Get registry

  • Request
  • localhost:8080/registry/1
  • Response
{
    "data": {
        "id": 5,
        "nombre": "Elver",
        "apellido": "Galarga",
        "correo": "elver@galarga.com",
        "telefono": "1234567890",
        "type_customer": 0,
        "created_at": "2019-04-27 09:58:00"
    }
}

Put registry

  • Request
  • localhost:8080/registry/1
{
	"data":{
		"nombre":"jun carlos", 
		"apellido":"jun carlos", 
		"correo":"juanki@mail", 
		"telefono": "783278234", 
		"type_customer":1
		}
}
  • Response
{
    "id": 1,
    "nombre": "jun carlos",
    "apellido": "jun carlos",
    "correo": "juanki@mail",
    "telefono": "783278234",
    "type_customer": 1
}

Delete registry

  • Request
  • localhost:8080/registry/1

About

api to registry new users


Languages

Language:Go 85.0%Language:HCL 14.0%Language:Shell 1.0%