37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
package com.bwie.controller;
|
|
|
|
import com.bwie.common.domain.request.UserRequest;
|
|
import com.bwie.common.domain.response.JwtResponse;
|
|
import com.bwie.common.result.Result;
|
|
import com.bwie.service.AuthService;
|
|
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.RestController;
|
|
|
|
import javax.jws.Oneway;
|
|
|
|
/**
|
|
* @version: java version 1.8
|
|
* @author: liguangyao
|
|
* @date: 2023-12-10 上午 9:27
|
|
*/
|
|
|
|
@RestController
|
|
public class AuthController {
|
|
@Autowired
|
|
private AuthService authService;
|
|
|
|
@PostMapping("/userLogin")
|
|
public Result userLogin(@RequestBody UserRequest userRequest){
|
|
Result<JwtResponse> result = authService.userLogin(userRequest);
|
|
return result;
|
|
}
|
|
@PostMapping("/adminLogin")
|
|
public Result adminLogin(@RequestBody UserRequest userRequest){
|
|
Result<JwtResponse> result = authService.adminLogin(userRequest);
|
|
return result;
|
|
}
|
|
|
|
}
|