İçeriğe geç

HTTP Eylem Adlandırma (ARCH4004)

Anahtar java.naming.route-handler-naming · Önem info · Kategori naming

Web çatısı route handler / controller eylem adları HTTP fiil semantiğiyle eşleşmelidir (GET → get/list, POST → create) ki RESTful tutarlılık korunsun ve niyet okunsun.

@RestController
class UserController {
@PostMapping("/users")
public User getUser(@RequestBody UserDto dto) { ... } // POST ama "get"
}
@RestController
class UserController {
@PostMapping("/users")
public User createUser(@RequestBody UserDto dto) { ... }
}

Handler adını HTTP fiiliyle uyumlu hale getirin (POST → create, GET → get/list).