|
@@ -0,0 +1,32 @@
|
|
|
+package cn.rankin.cmsweb.controller.user;
|
|
|
+
|
|
|
+import cn.rankin.cmsweb.service.user.TerminalDeviceService;
|
|
|
+import cn.rankin.cmsweb.service.user.TerminalUserService;
|
|
|
+import cn.rankin.common.utils.api.model.APIResult;
|
|
|
+import cn.rankin.common.utils.api.model.BaseCode;
|
|
|
+import cn.rankin.data.api.user.vo.TerminalUserVo;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping(value = "/device")
|
|
|
+public class TerminalDeviceController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TerminalUserService terminalUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TerminalDeviceService terminalDeviceService;
|
|
|
+
|
|
|
+ @RequestMapping(value = "/unbind/{userId}", method = RequestMethod.DELETE)
|
|
|
+ public APIResult<Boolean> deviceUnbind(@PathVariable String userId) {
|
|
|
+ APIResult<TerminalUserVo> userApiResult = terminalUserService.getUser(userId);
|
|
|
+ if (!userApiResult.getSuccess()) {
|
|
|
+ return APIResult.error(new BaseCode(userApiResult.getCode(), userApiResult.getMessage()));
|
|
|
+ }
|
|
|
+ return terminalDeviceService.deviceUnbind(userId);
|
|
|
+ }
|
|
|
+}
|