package xyz.ark.backstage_08.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
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;
import xyz.ark.backstage_08.entity.User;
@RestController
@RequestMapping("/user")
public class UserController {
ObjectMapper objectMapper = new ObjectMapper();
@GetMapping("/find")
public String findUserList() throws JsonProcessingException {
User user = new User();
user.setUsername("张三");
user.setPassword("123");
String string = objectMapper.writeValueAsString(user);
return string;
}
}