|
@@ -1,10 +1,12 @@
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
package cn.com.qmth.examcloud.service.core.api;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.service.core.entity.User;
|
|
import cn.com.qmth.examcloud.service.core.entity.User;
|
|
import cn.com.qmth.examcloud.service.core.enums.UserType;
|
|
import cn.com.qmth.examcloud.service.core.enums.UserType;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.UserRepo;
|
|
import cn.com.qmth.examcloud.service.core.service.UserService;
|
|
import cn.com.qmth.examcloud.service.core.service.UserService;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -12,6 +14,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 用户服务API
|
|
* 用户服务API
|
|
* Created by songyue on 17/1/13.
|
|
* Created by songyue on 17/1/13.
|
|
@@ -100,4 +104,12 @@ public class UserApi {
|
|
@RequestParam String password){
|
|
@RequestParam String password){
|
|
return userService.login(orgId,loginName,password);
|
|
return userService.login(orgId,loginName,password);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value="登出",notes="登出")
|
|
|
|
+ @PostMapping("/logout")
|
|
|
|
+ public ResponseEntity logout(HttpServletRequest request){
|
|
|
|
+ AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
|
+ userService.logout(accessUser);
|
|
|
|
+ return new ResponseEntity(HttpStatus.OK);
|
|
|
|
+ }
|
|
}
|
|
}
|