Giter Club home page Giter Club logo

deanoffice-backend's Introduction

deanoffice-backend

university DEANOFFICE project for improving student's software development knowledge: backend part

  • Requirements: Java 8 and Postgres

Stack:

  • Spring Boot 1.5.7.RELEASE
  • Flyway

In order to work with IDEA Lombok plugin should be installed.

Run backend In console in backend project root folder run: gradle :api:aasemble After that the application file api.war is created in build folder. Change folder to build and run: java -jar api.war

Authorization:

To have information about user who make request in a controller use next annotation @CurrentUser with ApplicationUser class as a parameter. Example:

    @GetMapping("username")
    public ResponseEntity getCurrentUserName(@CurrentUser ApplicationUser applicationUser) {
     String userName = applicationUser.getUserName();
     return ResponseEntity.ok(userName);
    }

Also, the current application user could be accessed in controller using ApplicationUserService Example:

    @Autowired
    ApplicationUserService userService;

    @GetMapping("username")
    public ResponseEntity getCurrentUserName(@CurrentUser ApplicationUser applicationUser) {
      ApplicationUser applicationUser = userService.getApplicationUser()
    }


Swagger https://swagger.io/

To test API with Swagger. Follow next steps:**

Where jwt-token is valid token. To get valid token you can use next command:

curl -d "{"""username""":"""fitis""", """password""":"""test1"""}" -H "Content-Type: application/json" -X POST http://localhost:8080/login

deanoffice-backend's People

Contributors

gzaspa avatar tarch64 avatar vladmuz avatar alex222438 avatar valentyntulub avatar markinger avatar volodymyr-polishchuk avatar sashakononenko avatar yulyko avatar vasyachopovenko avatar olegsamardak avatar riabchych avatar wseng avatar arkaliuk avatar olexiytazetdinov avatar blackmaizegod avatar andriykonogray avatar serhiish avatar grap-anatoly avatar el-treshka avatar koctrx avatar oleksjuk avatar nfolzordo avatar allatell avatar alexocheretnyi avatar deand0n avatar vladyslavkharytonov avatar rumpe500 avatar makcsas avatar vladislavkravets 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.