File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
src/main/java/lk/ijse/dep/note Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 11package lk .ijse .dep .note .api ;
22
3- import org .springframework .web . bind . annotation . RequestMapping ;
4- import org .springframework .web .bind .annotation .RestController ;
3+ import org .springframework .http . HttpStatus ;
4+ import org .springframework .web .bind .annotation .* ;
55
66@ RestController
77@ RequestMapping ("api/v1/users" )
88public class UserController {
9+
10+ @ ResponseStatus (HttpStatus .CREATED )
11+ @ PostMapping (consumes = "application/json" ,produces = "application/json" )
12+ public void registerUser (){
13+ System .out .println ("register" );
14+ }
15+ @ GetMapping (path = "{userId}" ,produces = "application/json" )
16+ public void getUserInfo (){
17+ System .out .println ("get" );
18+ }
19+ @ ResponseStatus (HttpStatus .NO_CONTENT )
20+ @ DeleteMapping ("{userId}" )
21+ public void deleteuser (){
22+ System .out .println ("delete" );
23+ }
24+ @ ResponseStatus (HttpStatus .NO_CONTENT )
25+ @ PatchMapping (path = "{userId}" ,consumes = "application/json" )
26+ public void updateUser (){
27+ System .out .println ("update" );
28+ }
29+
930}
Original file line number Diff line number Diff line change 1717
1818
1919@ Configuration
20- // @EnableWebMvc
20+ @ EnableWebMvc
2121@ ComponentScan (basePackageClasses = WebAppInitializer .class )
2222public class WebAppConfig {
2323
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ public T save(T entity) {
2424 return entityManager .merge (entity );
2525
2626 }
27-
2827 @ Override
2928 public void deleteById (ID pk ) {
3029
You can’t perform that action at this time.
0 commit comments