package com.xy.service;

import com.xy.annotate.RestMappingController;
import com.xy.dto.SysWorkUser.*;
import com.xy.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/***
 * 业务用户服务类
 * @author 谭斌
 * @date 2022/12/13 19:06
 */

@RestMappingController("sysWorkUser")
public interface SysWorkUserService {

    @ApiOperation(value = "注册", notes = "注册")
    @PostMapping("register")
    R<Long> register(@Valid @RequestBody AddDto addDto);

    @ApiOperation(value = "修改", notes = "修改")
    @PostMapping("update")
    R<Boolean> update(@Valid @RequestBody UpdateDto updateDto);

    @ApiOperation(value = "删除", notes = "删除")
    @PostMapping("del")
    R del(@RequestBody @Validated DelDto delDto);

    @PostMapping("login")
    @ApiOperation("登录")
    R<String> login(@RequestBody @Validated LoginDto loginDto);

    @PostMapping("logout")
    @ApiOperation("登出")
    R logout();

    @PostMapping("list")
    @ApiOperation("集合查询")
    R<List<SysWorkVo>> list(@RequestBody ListDto listDto);
}
