up
lyfO_o
2022-06-27 7e7a275c0c4a07f5d27ec082538c25b838505998
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
package com.gkhy.safePlatform.accountController;
 
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.account.rpc.apimodel.UserAccountService;
import com.gkhy.safePlatform.account.rpc.apimodel.model.UserLoginRespDTO;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
@RequestMapping("/auth")
public class LoginController {
 
    @DubboReference(check = false)
    private UserAccountService userAccountService;
 
    @RequestMapping("/login")
    public ResultVO<UserLoginRespDTO> authLogin(@RequestBody JSONObject loginForm){
        String username = loginForm.getString("username");
        String password = loginForm.getString("password");
        return userAccountService.authLogin(username, password);
    }
}