Skip to content

Commit 5c5bbbf

Browse files
committed
Begin handling requests in api layer
1 parent c1a43a4 commit 5c5bbbf

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed
Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
package 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")
88
public 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
}

src/main/java/lk/ijse/dep/note/config/WebAppConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
@Configuration
20-
//@EnableWebMvc
20+
@EnableWebMvc
2121
@ComponentScan(basePackageClasses = WebAppInitializer.class)
2222
public class WebAppConfig {
2323

src/main/java/lk/ijse/dep/note/repository/CrudRepositoryImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)