Merge branch 'main' into personal/heshunme/news

# Conflicts:
#	src/main/java/org/cmh/backend/authentication/controller/UserController.java
This commit is contained in:
高子兴 2024-07-03 02:02:04 +08:00
commit 2505b63b88

View File

@ -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);
}
}