package com.starry.admin.modules.personnel.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.starry.admin.modules.personnel.module.vo.PlayPersonnelUserInfoQueryVo;
import com.starry.admin.modules.personnel.module.vo.PlayPersonnelUserInfoReturnVo;
import com.starry.admin.modules.system.entity.SysUserEntity;
import com.starry.admin.modules.system.service.SysUserService;
import com.starry.common.result.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 管理员管理Controller
 *
 * @author admin
 * @since 2024-06-14
 */
@RestController
@RequestMapping("/personnel/user")
public class PlayPersonnelUserInfoController {

    @Resource
    private SysUserService sysUserService;


    /**
     * 分页查询账户信息列表
     */
    @PostMapping("/listByPage")
    public R listByPage(@Validated @RequestBody PlayPersonnelUserInfoQueryVo vo) {
        IPage<PlayPersonnelUserInfoReturnVo> list = sysUserService.selectByPage(vo);
        return R.ok(list);
    }


    /**
     * 查询所有账户信息列表
     */
    @GetMapping("/listAll")
    public R listAll() {
        List<SysUserEntity> list = sysUserService.selectAll();
        return R.ok(list);
    }


}
