package com.aiotagro.cattletrade.business.controller;


import com.aiotagro.cattletrade.business.dto.SysUserDto;
import com.aiotagro.cattletrade.business.entity.SysUser;
import com.aiotagro.cattletrade.business.service.ISysUserService;
import com.aiotagro.common.core.web.domain.AjaxResult;
import com.aiotagro.common.core.web.domain.PageResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工管理表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2024-12-26
 */
@RestController
@RequestMapping("/sysUser")
public class SysUserController {

    @Autowired
    private ISysUserService userService;

    /**
     * 查询分页列表
     */
    @PostMapping(value = "/queryList")
    public PageResultResponse queryList(@RequestBody SysUserDto dto) {
        return userService.queryList(dto);
    }

    /**
     * 新增、编辑
     **/
    @PostMapping("/save")
    public AjaxResult saveUser(@RequestBody SysUser user) {
        return userService.saveUser(user);
    }

    /**
     * 删除
     **/
    @GetMapping("/delete")
    public AjaxResult delete(@RequestParam Integer id) {
        return userService.delete(id);
    }

}
