Forráskód Böngészése

Api 添加上传用户地址信息接口

limingming 1 éve
szülő
commit
976df5796b

+ 23 - 0
rouyi-api/src/main/java/com/info666/infraredRemote/controller/UserLoginController.java

@@ -5,8 +5,10 @@ import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.UserAddress;
 import com.ruoyi.system.domain.UserInfo;
 import com.ruoyi.system.domain.vo.SmsResponseVo;
+import com.ruoyi.system.service.UserAddressService;
 import com.ruoyi.system.service.UserInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -27,9 +29,16 @@ public class UserLoginController {
 
     @Autowired
     private UserInfoService userInfoService;
+
+    @Autowired
+    private UserAddressService userAddressService;
+
     @Autowired
     private RedisCache redisCache;
 
+    /**
+     * 登录接口
+     */
     @PostMapping("/login")
     public R<SmsResponseVo> sendSms(@RequestBody UserInfo param) {
         if (StringUtils.isEmpty(param.getUserPhone()) || Pattern.matches("^1[3-9]\\d{9}$\n",param.getUserPhone())){
@@ -48,4 +57,18 @@ public class UserLoginController {
         }
         return R.ok();
     }
+
+    /**
+     * 上传用户地址
+     */
+    @PostMapping("/uploadAddress")
+    public R<SmsResponseVo> sendSms(@RequestBody UserAddress param) {
+        param.setCreateTime(DateUtils.getNowDate());
+        userAddressService.save(param);
+        return R.ok();
+    }
+
+
+
+
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserAddress.java

@@ -25,6 +25,10 @@ public class UserAddress implements Serializable {
     @Excel(name = "关联用户id")
     private Long userId;
 
+    /** 关联用户id */
+    @Excel(name = "关联用户id")
+    private Long userPhone;
+
     /** 用户地址信息 */
     @Excel(name = "用户地址信息")
     private String address;