SOAP (XML) vs Restful (JSON)
Static Filtering vs Dynamic Filtering
H2 Console
Swagger
Versioning
===
Spring boot
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run"
=============
Dispatcher Servlet
====
RestController -> UserService (DAO) -> UserBean
=====
HATEOAS
在 REST 的 Level 3 模型中,客戶端可以從某個資源,知道還有哪些其他相關的資源
======
HttpMessageConverterAutoConfiguration
# Jackson to Object Mapping
# conversion from JSON to beans and beans to JSON
# Annotation
@RestController
@GetMapping
@RequestHeader(name="Accept-Language", required=false)
@RequestParam(value = "name", defaultValue = "World")
@RequestBody (Annotation indicating a method parameter should be bound to the body of the web request.)
@PostMapping
@RequestMapping(method=GET)
@Controller
@ResponseBody
@ ResponseStatus (Marks a method or exception class with the status ResponseStatus.code() and ResponseStatus.reason() that should be returned.)
@PathVariable (Annotation which indicates that a method parameter should be bound to a URI template variable)
==
@SpringBootApplication
====
@Component for @Autowired
@ComponentScan
=====
@ControllerAdvice
@ExceptionHandler (Annotation for handling exceptions in specific handler classes and/or handler methods.)
====
@Entity
@Id
@GeneratedValue
@Repository
public interface UserRepository extends JpaRepository<User, Integer>{
@ManyToOne(fetch=FetchType.LAZY)
@JsonIgnore
@OneToMany(mappedBy="user")
沒有留言:
張貼留言