|
|
@@ -3,16 +3,8 @@ package com.seecoder.BlueWhale.Controller;
|
|
|
import com.seecoder.BlueWhale.Service.UserService;
|
|
|
import com.seecoder.BlueWhale.VO.ResultVO;
|
|
|
import com.seecoder.BlueWhale.VO.UserVO;
|
|
|
-
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
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.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/api/user")
|
|
|
@@ -27,9 +19,12 @@ public class UserController {
|
|
|
}
|
|
|
|
|
|
@PostMapping("/login")
|
|
|
- public ResultVO<Map<String, String>> login(@RequestParam("phone") String phone, @RequestParam("password") String password){
|
|
|
- Map<String, String> tokenMap = new HashMap<>();
|
|
|
- tokenMap.put("token", userService.login(phone, password));
|
|
|
- return ResultVO.buildSuccess(tokenMap);
|
|
|
+ public ResultVO<String> login(@RequestParam("phone") String phone, @RequestParam("password") String password){
|
|
|
+ return ResultVO.buildSuccess(userService.login(phone, password));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping
|
|
|
+ public ResultVO<UserVO> getInformation(){
|
|
|
+ return ResultVO.buildSuccess(userService.getInformation());
|
|
|
}
|
|
|
}
|