Просмотр исходного кода

update:修改用户去除密码

wulianwei 1 год назад
Родитель
Сommit
b89af61ae2

+ 1 - 0
src/main/java/com/tuoren/forward/config/SaTokenConfigure.java

@@ -28,6 +28,7 @@ public class SaTokenConfigure {
 		"/user/login",  //登录
 		"/user/register",  //注册
 		"/user/editPassword",  //修改密码
+		"/device/bind",  //设备绑定
 		"/doc.html",  //api地址
 		"/webjars/**",  //api资源
 		"/swagger-ui/**",  //swagger

+ 9 - 1
src/main/java/com/tuoren/forward/controller/DeviceController.java

@@ -11,6 +11,7 @@ import com.alibaba.fastjson2.JSONObject;
 import com.github.pagehelper.util.StringUtil;
 import com.tuoren.forward.annotation.HandleLog;
 import com.tuoren.forward.constant.CommonConstant;
+import com.tuoren.forward.entity.Device;
 import com.tuoren.forward.entity.req.DeviceAddReq;
 import com.tuoren.forward.entity.req.DeviceBindReq;
 import com.tuoren.forward.entity.req.DeviceRecordSearchReq;
@@ -49,6 +50,14 @@ public class DeviceController {
 		return deviceService.search(req);
 	}
 	
+	@PostMapping("detail")
+    @ResponseBody
+    @Operation(summary = "设备详情")
+	public ResultData<Device> detail(@RequestBody IdReq req){
+		log.info("detail>>:{}",req);
+		return deviceService.detail(req.getId());
+	}
+	
 
 	@HandleLog
 	@PostMapping("add")
@@ -128,7 +137,6 @@ public class DeviceController {
 	@PostMapping("bind")
     @ResponseBody
     @Operation(summary = "设备用户绑定")
-	@Parameter(name="token",description = "token",required = true,in = ParameterIn.HEADER)
 	public Result bind(@RequestBody DeviceBindReq req){
 		log.info("bind>>:{}",req);
 		return deviceService.bind(req);

+ 0 - 2
src/main/java/com/tuoren/forward/entity/req/UserAddReq.java

@@ -15,8 +15,6 @@ public class UserAddReq {
 	@Schema(description = "用户名")
     private String username;
 	
-	@Schema(description = "密码")
-    private String password;
 
     @Schema(description = "电话")
     private String mobile;

+ 10 - 0
src/main/java/com/tuoren/forward/service/DeviceService.java

@@ -70,6 +70,16 @@ public class DeviceService {
 		return ResultPage.success(devices,page.getTotal());
 	}
 	
+	/**
+	 * @title 设备详情
+	 * @param req
+	 * @return ResultData<Device>
+	 */
+	public ResultData<Device> detail(String mac){
+		Device device = deviceMapper.selectByMac(mac);
+		return ResultData.success(device);
+	}
+	
 	/**
 	 * @title 添加设备
 	 * @param req

+ 2 - 2
src/main/resources/application.yml

@@ -2,7 +2,7 @@ server:
   port: 8585
 spring:
   profiles:
-      active: test
+      active: dev
   application:
     name: forward
   jackson:
@@ -203,7 +203,7 @@ aliyun2:
 #日志
 logging:
   config: classpath:log/logback.xml
-  path: D://logs/forward
+  path: /home/log/forward-service
   level: 
     com.tuoren.forward.mapper: debug
 handleLog: