2023-08-11 11:51:09 +08:00
|
|
|
package com.jwl.driver.server.controller;
|
|
|
|
|
|
|
|
|
2023-08-12 01:56:25 +08:00
|
|
|
import com.jwl.driver.server.dto.LoginUserDto;
|
|
|
|
import com.jwl.driver.server.response.BaseResponse;
|
|
|
|
import com.jwl.driver.server.service.ITdSysUserService;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2023-08-12 14:42:57 +08:00
|
|
|
import org.springframework.web.bind.annotation.*;
|
2023-08-11 11:51:09 +08:00
|
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
2023-08-12 14:42:57 +08:00
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
2023-08-11 11:51:09 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* <p>
|
|
|
|
* 用户表; 前端控制器
|
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* @author Automated procedures
|
|
|
|
* @since 2023-08-10
|
|
|
|
*/
|
2023-08-12 01:56:25 +08:00
|
|
|
@RestController
|
|
|
|
@Api(tags = "用户管理")
|
|
|
|
@RequestMapping("/tdSysUser")
|
|
|
|
@Slf4j
|
2023-08-11 11:51:09 +08:00
|
|
|
public class TdSysUserController {
|
|
|
|
|
2023-08-12 01:56:25 +08:00
|
|
|
@Autowired
|
|
|
|
private ITdSysUserService userService;
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("用户登陆")
|
|
|
|
@PostMapping("/login")
|
2023-08-12 14:42:57 +08:00
|
|
|
public BaseResponse login(@RequestBody LoginUserDto loginUserDto) {
|
2023-08-12 01:56:25 +08:00
|
|
|
log.info("用户登录======>loginUserDto:{}", loginUserDto);
|
|
|
|
return BaseResponse.success(userService.login(loginUserDto));
|
|
|
|
}
|
|
|
|
|
2023-08-12 14:42:57 +08:00
|
|
|
|
|
|
|
@ApiOperation("用户登出")
|
|
|
|
@GetMapping("/loginOut")
|
|
|
|
public BaseResponse loginOut(){
|
|
|
|
log.info("用户登出======>{}", LocalDateTime.now());
|
|
|
|
return BaseResponse.success(userService.loginOut());
|
|
|
|
}
|
|
|
|
|
2023-08-11 11:51:09 +08:00
|
|
|
}
|