add 用户中心 鉴权
parent
09e74b3069
commit
d39a00f4f0
@ -0,0 +1,40 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zhehekeji.common.util.HttpUtil;
|
||||
import com.zhehekeji.core.pojo.Result;
|
||||
import com.zhehekeji.core.util.Assert;
|
||||
import com.zhehekeji.web.pojo.IndexVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Api(value = "AppCenterController", tags = "用户中心")
|
||||
@RequestMapping(value = "/app")
|
||||
@RestController(value = "AppCenterController")
|
||||
@Slf4j
|
||||
public class AppCenterController {
|
||||
|
||||
@Value("${userUrl}")
|
||||
private String userUrl;
|
||||
|
||||
@GetMapping("/userCenter")
|
||||
@ApiOperation(value = "用户中心")
|
||||
public Result<IndexVO> userCenter() {
|
||||
Result result = null;
|
||||
try {
|
||||
String res = HttpUtil.doGet(userUrl+"/api/app/userCenter");
|
||||
result = JSONObject.parseObject(res,Result.class);
|
||||
} catch (IOException e) {
|
||||
log.error("请求用户中心地址失败:{}",e);
|
||||
Assert.isTrue(false,"请求用户中心地址失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package com.zhehekeji.web.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class controller {
|
||||
|
||||
@RequestMapping(value = "/web",method = RequestMethod.GET)
|
||||
public String get(){
|
||||
return "web";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.zhehekeji.web.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IndexVO {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String url;
|
||||
|
||||
//private String logo;
|
||||
}
|
||||
Loading…
Reference in New Issue