kongzy
2023-11-24 ebe94e19812a1b24257d60831ec932756855e94b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.gkhy.assess.admin.controller;
 
 
import com.gkhy.assess.common.api.CommonResult;
import com.gkhy.assess.common.domain.vo.LoginBody;
import com.gkhy.assess.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
 
import org.springframework.web.bind.annotation.RestController;
 
/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author kzy
 * @since 2023-10-17 14:26:29
 */
@RestController
@RequestMapping("/account")
public class SysLoginController {
    @Autowired
    private SysUserService sysUserService;
 
    @PostMapping("/login")
    public CommonResult login(@RequestBody LoginBody loginBody){
        return CommonResult.success(sysUserService.login(loginBody));
    }
 
    @PostMapping("/logout")
    public CommonResult logout(){
        sysUserService.logout();
        return CommonResult.success();
    }
 
}