Code Monkey home page Code Monkey logo

user-manager's Introduction

User manager

Installation and deployment

  • Obtain cassandra docker image docker pull cassandra

  • Run cassandra network docker run -p 9042:9042 -d --name nodeA --network cass-cluster-network cassandra

  • Create database docker exec -it nodeA cqlsh

CREATE  KEYSPACE IF NOT EXISTS user_manager
WITH REPLICATION = {'class':'SimpleStrategy','replication_factor':1};

USE user_manager;

create table if not exists user(
id uuid primary key,
email varchar,
password varchar,
first_name varchar,
last_name varchar,
avatar blob,
role int
);

create table if not exists user_email(
id uuid,
email varchar,
primary key (email, id)
);

begin batch 
insert into user (id, email, password, role) 
values (38752b70-a9c0-11eb-aab7-8903a043eed4, '[email protected]', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', 2); 
insert into user_email (id, email) values (38752b70-a9c0-11eb-aab7-8903a043eed4, '[email protected]'); 
apply batch;

QUIT;
  • Run app on localhost:8080 gradlew bootRun

API

Authorization

  • POST /login
  • Request {email: "[email protected]", password: "123456"}
  • Response {token: "string"}
  • Use token from response in Authorization header for next requests

List all users

  • GET /user

Get user by id

  • GET /user/{id}

Create user

  • POST /user

    Request body:

    {"email": "string", "password": "Base64 encoded string", "firstName": "string", "lastName": "string", "role": "user|admin", "avatar": "Base64 encoded string"}

Update user

  • PUT /user/{id}

    Request body:

    {"email": "string", "password": "Base64 encoded string", "firstName": "string", "lastName": "string", "role": "user|admin", "avatar": "Base64 encoded string"}

Delete user

  • DELETE /user/{id}

user-manager's People

Contributors

afomina avatar

Watchers

James Cloos avatar  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.