Merge branch 'main' into personal/heshunme/news
# Conflicts: # src/main/java/org/cmh/backend/authentication/controller/UserController.java
This commit is contained in:
commit
2505b63b88
@ -1,23 +0,0 @@
|
|||||||
package org.cmh.backend.authentication.controller;
|
|
||||||
|
|
||||||
import org.cmh.backend.authentication.model.UserHS;
|
|
||||||
import org.cmh.backend.authentication.service.UserService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/users")
|
|
||||||
public class UserController {
|
|
||||||
@Autowired
|
|
||||||
private UserService userService;
|
|
||||||
|
|
||||||
@GetMapping("/{username}")
|
|
||||||
public ResponseEntity<UserHS> getUser(@PathVariable String username) {
|
|
||||||
UserHS user = userService.getUserByUsername(username);
|
|
||||||
return ResponseEntity.ok(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user