|
@@ -5,6 +5,8 @@ import io.renren.common.utils.R;
|
|
import io.renren.modules.app.annotation.Login;
|
|
import io.renren.modules.app.annotation.Login;
|
|
import io.renren.modules.app.annotation.LoginUser;
|
|
import io.renren.modules.app.annotation.LoginUser;
|
|
import io.renren.modules.app.entity.UserEntity;
|
|
import io.renren.modules.app.entity.UserEntity;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestAttribute;
|
|
import org.springframework.web.bind.annotation.RequestAttribute;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -19,30 +21,25 @@ import org.springframework.web.bind.annotation.RestController;
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/app")
|
|
@RequestMapping("/app")
|
|
|
|
+@Api("APP测试接口")
|
|
public class ApiTestController {
|
|
public class ApiTestController {
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取用户信息
|
|
|
|
- */
|
|
|
|
@Login
|
|
@Login
|
|
@GetMapping("userInfo")
|
|
@GetMapping("userInfo")
|
|
|
|
+ @ApiOperation("获取用户信息")
|
|
public R userInfo(@LoginUser UserEntity user){
|
|
public R userInfo(@LoginUser UserEntity user){
|
|
return R.ok().put("user", user);
|
|
return R.ok().put("user", user);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 获取用户ID
|
|
|
|
- */
|
|
|
|
@Login
|
|
@Login
|
|
@GetMapping("userId")
|
|
@GetMapping("userId")
|
|
|
|
+ @ApiOperation("获取用户ID")
|
|
public R userInfo(@RequestAttribute("userId") Integer userId){
|
|
public R userInfo(@RequestAttribute("userId") Integer userId){
|
|
return R.ok().put("userId", userId);
|
|
return R.ok().put("userId", userId);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 忽略Token验证测试
|
|
|
|
- */
|
|
|
|
@GetMapping("notToken")
|
|
@GetMapping("notToken")
|
|
|
|
+ @ApiOperation("忽略Token验证测试")
|
|
public R notToken(){
|
|
public R notToken(){
|
|
return R.ok().put("msg", "无需token也能访问。。。");
|
|
return R.ok().put("msg", "无需token也能访问。。。");
|
|
}
|
|
}
|