malleswar-reddy / Malleswar_arun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Malleswar_Arun study

Table of Contents

    1. @Rest Controller (#Rest Controller)
    1. @Request Mapping (#Request-Mapping)

Swagger2

https://www.programmersought.com/article/683793165/

  • @Apilgnore: Use this annotation to indicate that Swagger2 ignores this API
  • @ApiOperation : A method describing the class, or an interface

Spring

  • @configuration

    Spring @Configuration annotation helps in Spring annotation based configuration. @Configuration annotation indicates that a class declares one or more @Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime.

  • @EnableConfigurationProperties

    Spring EnableConfigurationProperties annotation is strictly connected to @ConfiguratonProperties. It enables support for @ConfigurationProperties annotated classes in our application. However, it's worth to point out that the Spring Boot documentation says, every project automatically includes @EnableConfigurationProperties

  • Spring Framework - @Async and @EnableAsync Examples

spring Boot

@currentuser

@ConfigurationProperties

In Spring Boot, the @ConfigurationProperties annotation allows us to map the resource files such as properties or YAML files to Java Bean object.

This annotation is applied to a class or a @Bean method in a @Configuration class to map or validate the external properties or YAML files.

application.properties

myapp.mail.to=sunil@example.com
myapp.mail.host=mail.example.com
myapp.mail.port=250

Example code

@ConfigurationProperties(prefix="myapp.mail")
public class MailProperties {

  private String to;
  private String host;
  private int port;

  //Setter and getter methods
}

https://www.boraji.com/spring-boot-configurationproperties-example

Spring Mvc

@controlleradvice

Rest-Controller

Create Rest api we can use

  • spring Mvc
    1. @Rest controller
    2. @ExceptionHandler annotation is used for handling exceptions in specific handler classes and/or handler methods.reference

SLF4J Simple Logging Facade for Java

Project Lombok

  • @Data - Project Lombok

    @Data is a convenient shortcut annotation that bundles the features of @ToString , @EqualsAndHashCode , @Getter / @Setter and @RequiredArgsConstructor together: In other words, @Data generates all the boilerplate that is normally associated with simple POJOs (Plain Old Java Objects) and beans: getters for all fields

  • @ToString

    @ToString annotation enables you to avoid having to manually write a toString() method while inspecting fields for your objects.

About

License:Apache License 2.0