危化品全生命周期管理后端
kongzy
2024-08-22 0c73654f55844e34772732914af8cc1e247aab63
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
package com.gkhy.hazmat.admin.controller.app;
 
import com.gkhy.hazmat.common.api.CommonResult;
import com.gkhy.hazmat.common.domain.model.LoginBody;
import com.gkhy.hazmat.framework.web.service.SysLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;
 
@Api(tags = "APP用户登录前端控制器")
@RestController
@RequestMapping("/app/account")
public class AppLoginController {
    @Autowired
    private SysLoginService sysLoginService;
 
    @ApiOperation(value = "用户登录")
    @PostMapping("/login")
    public CommonResult login(@RequestBody LoginBody loginBody){
        return CommonResult.success(sysLoginService.appLogin(loginBody));
    }
 
    @ApiOperation(value = "用户退出")
    @PostMapping("/logout")
    public CommonResult logout(){
        sysLoginService.logout();
        return CommonResult.success();
    }
}