From 4c157090cbee7f94abcf37496b7df22b4725f3e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com>
Date: Thu, 21 Oct 2021 08:36:04 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=84=9A=E6=89=8B=E6=9E=B6v2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 40 ++--------------------------------------
1 file changed, 2 insertions(+), 38 deletions(-)
diff --git a/pom.xml b/pom.xml
index 31bcbf8..90ddf40 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
com.chinaunicom.ebtp
mall-ebtp-cloud-parent
- 0.0.1-SNAPSHOT
+ 2.0.0-SNAPSHOT
com.chinaunicom.mall.ebtp
@@ -20,52 +20,16 @@
com.chinaunicom.mall.ebtp
uboot-core
- 0.0.1-SNAPSHOT
+ 2.0.0-SNAPSHOT
-
- com.chinaunicom.ebtp
- mall-ebtp-cloud-attachment-sdk
-
-
-
- com.chinaunicom.ebtp
- mall-ebtp-cloud-apollo-starter
-
-
- mysql
- mysql-connector-java
-
-
-
- org.apache.shardingsphere
- sharding-jdbc-spring-boot-starter
-
-
com.deepoove
poi-tl
1.9.1
-
-
- org.apache.poi
- poi
- 4.1.2
-
-
- org.apache.poi
- poi-ooxml
- 4.1.2
-
-
-
- org.apache.poi
- poi-ooxml-schemas
- 4.1.2
-
commons-httpclient
commons-httpclient
From 8d22ec7ef075a7f6a715ea4207bb050e55f6676e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com>
Date: Mon, 25 Oct 2021 15:39:23 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=B9=E6=8D=AEtoken?=
=?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/UserInfoController.java | 39 +++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/userinfo/controller/UserInfoController.java
diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/userinfo/controller/UserInfoController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/userinfo/controller/UserInfoController.java
new file mode 100644
index 0000000..0489224
--- /dev/null
+++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/userinfo/controller/UserInfoController.java
@@ -0,0 +1,39 @@
+package com.chinaunicom.mall.ebtp.extend.userinfo.controller;
+
+import com.chinaunicom.mall.ebtp.cloud.userinfo.starter.service.UserInfoService;
+import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@RestController
+@RequestMapping("/v1/userinfo/")
+public class UserInfoController {
+
+ @Autowired
+ private UserInfoService service;
+
+ /**
+ * 获取用户信息
+ *
+ * @param token (认证token)
+ * @return
+ */
+ @GetMapping("get")
+ public ResponseEntity getUserInfo(
+ @RequestHeader(name = "Authorization", required = false) String token) {
+ if (StringUtils.isEmpty(token)) {
+ log.error("access token is empty");
+ return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
+ }
+ return ResponseEntity.ok(service.getUserInfo(token));
+ }
+
+}