黄远 5 rokov pred
rodič
commit
9f91b57445

+ 2 - 1
.gitignore

@@ -52,7 +52,8 @@ yarn-error.log*
 */.settings
 */.project
 */.classpath
-/.factorypath
+/.factory-path
+*.log
 package-lock.json
 */node_modules/
 */dist/

+ 22 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/entity/User.java

@@ -0,0 +1,22 @@
+package cn.com.ty.lift.system.entity;
+
+import lombok.Data;
+
+/**
+ * @ClassName User
+ * @Description
+ * @Author huangyuan
+ * @Date 2019-11-26 15:54
+ **/
+@Data
+public class User {
+
+    private Long id;
+
+    private String name;
+
+    private String account;
+
+    private String password;
+
+}

+ 172 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/entity/UserInfo.java

@@ -0,0 +1,172 @@
+package cn.com.ty.lift.system.entity;
+
+import org.apache.ibatis.type.Alias;
+
+import java.math.BigDecimal;
+
+/**
+ * 实体类 - 表:user_info
+ * @since 2019-11-25 18:01:00
+ */
+@Alias("UserInfo")
+public class UserInfo {
+	private Long userId;
+
+	private String name;
+
+	private String mobile;
+
+	private Byte gender;
+
+	private Byte age;
+
+	private String remarks;
+
+	private String signature;
+
+	private Integer serviceTotal;
+
+	private Integer satisfactionTotal;
+
+	private Integer level;
+
+	private Integer maintenanceTotal;
+
+	private Integer emergencyTotal;
+
+	private Integer liftTotal;
+
+	private BigDecimal balance;
+
+	private String type;
+
+	private String avatarUrl;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getMobile() {
+		return mobile;
+	}
+
+	public void setMobile(String mobile) {
+		this.mobile = mobile;
+	}
+
+	public Byte getGender() {
+		return gender;
+	}
+
+	public void setGender(Byte gender) {
+		this.gender = gender;
+	}
+
+	public Byte getAge() {
+		return age;
+	}
+
+	public void setAge(Byte age) {
+		this.age = age;
+	}
+
+	public String getRemarks() {
+		return remarks;
+	}
+
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	public String getSignature() {
+		return signature;
+	}
+
+	public void setSignature(String signature) {
+		this.signature = signature;
+	}
+
+	public Integer getServiceTotal() {
+		return serviceTotal;
+	}
+
+	public void setServiceTotal(Integer serviceTotal) {
+		this.serviceTotal = serviceTotal;
+	}
+
+	public Integer getSatisfactionTotal() {
+		return satisfactionTotal;
+	}
+
+	public void setSatisfactionTotal(Integer satisfactionTotal) {
+		this.satisfactionTotal = satisfactionTotal;
+	}
+
+	public Integer getLevel() {
+		return level;
+	}
+
+	public void setLevel(Integer level) {
+		this.level = level;
+	}
+
+	public Integer getMaintenanceTotal() {
+		return maintenanceTotal;
+	}
+
+	public void setMaintenanceTotal(Integer maintenanceTotal) {
+		this.maintenanceTotal = maintenanceTotal;
+	}
+
+	public Integer getEmergencyTotal() {
+		return emergencyTotal;
+	}
+
+	public void setEmergencyTotal(Integer emergencyTotal) {
+		this.emergencyTotal = emergencyTotal;
+	}
+
+	public Integer getLiftTotal() {
+		return liftTotal;
+	}
+
+	public void setLiftTotal(Integer liftTotal) {
+		this.liftTotal = liftTotal;
+	}
+
+	public BigDecimal getBalance() {
+		return balance;
+	}
+
+	public void setBalance(BigDecimal balance) {
+		this.balance = balance;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getAvatarUrl() {
+		return avatarUrl;
+	}
+
+	public void setAvatarUrl(String avatarUrl) {
+		this.avatarUrl = avatarUrl;
+	}
+}

+ 21 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/controller/UserController.java

@@ -1,9 +1,30 @@
 package cn.com.ty.lift.system.user.controller;
 
+import cn.com.ty.lift.system.entity.User;
+import cn.com.ty.lift.system.user.service.impl.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping("/user")
 public class UserController {
 
+    @Autowired
+    private UserService userService;
+
+    /*
+     *@Author huangyuan
+     *@Description 用户登录
+     *@Date 15:56 2019-11-26
+     *@Param [userId]
+     *@return cn.com.ty.lift.system.entity.User
+     **/
+    @RequestMapping("/login")
+    @ResponseBody
+    public User getUser(String userId){
+        User user = userService.getUserById(userId);
+        return user;
+    }
+
 }

+ 10 - 1
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/IUserService.java

@@ -1,10 +1,19 @@
 package cn.com.ty.lift.system.user.service;
 
+import cn.com.ty.lift.system.entity.User;
+
 /**
  * <h1>.</h1><BR>
  * @author huangyuan - 2019-11-25 18:36:53
  */
 public interface IUserService{
 
-	
+    /*
+     *@Author huangyuan
+     *@Description 通过用户id获取用户信息
+     *@Date 15:57 2019-11-26
+     *@Param [userId]
+     *@return cn.com.ty.lift.system.entity.User
+     **/
+    User getUserById(String userId);
 }

+ 9 - 0
lift-system-service/src/main/java/cn/com/ty/lift/system/user/service/impl/UserService.java

@@ -1,5 +1,6 @@
 package cn.com.ty.lift.system.user.service.impl;
 
+import cn.com.ty.lift.system.entity.User;
 import cn.com.ty.lift.system.user.service.IUserService;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -12,4 +13,12 @@ import org.springframework.transaction.annotation.Transactional;
 @Transactional
 public class UserService implements IUserService {
 
+    public User getUserById(String userId) {
+        User user = new User();
+        user.setId(1L);
+        user.setAccount("huangyuan");
+        user.setName("黄远");
+        user.setPassword("123456");
+        return user;
+    }
 }