package com.muyu.test.controller;

import com.muyu.common.core.domain.Result;
import com.muyu.test.domain.User;
import com.muyu.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author：张腾
 * @Package：com.muyu.test.controller
 * @Project：cloud-server-8
 * @name：UserController
 * @Date：2024/9/20 19:14
 */
@RestController("/admin")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/selectAll")
    public Result<List<User>> selectAll(){
        List<User> list = userService.list();
        list.forEach(System.out::println);
        return Result.success(list);
    }

}
