Commit 493a3309 by 111-PC\111

[+]代码修改

1 parent a6a686c9
......@@ -2,10 +2,12 @@ package com.glsx.smart.controller;
import com.alibaba.fastjson.JSON;
import com.glsx.smart.dao.entity.SmartScene;
import com.glsx.smart.dao.entity.SmartUserRelation;
import com.glsx.smart.pojo.OrderResponse;
import com.glsx.smart.service.SmartSceneDataService;
import com.glsx.smart.service.SmartSceneLogService;
import com.glsx.smart.service.SmartSceneService;
import com.glsx.smart.service.SmartUserRelationService;
import com.glsx.smart.service.UserKafkaService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
......@@ -43,12 +45,28 @@ public class SceneController {
@Autowired
private UserKafkaService userKafkaService;
@Autowired
private SmartUserRelationService userRelationService;
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public List<SmartScene> getList(@RequestBody SmartScene scene) {
log.info("/scene/getList param: {}", JSON.toJSONString(scene));
return sceneService.getList(scene);
}
@RequestMapping(value = "/getScenList", method = {RequestMethod.GET, RequestMethod.POST})
public List<SmartScene> getScenList(@RequestBody SmartScene scene) {
log.info("/scene/getList param: {}", JSON.toJSONString(scene));
SmartUserRelation smartUserRelation=new SmartUserRelation();
smartUserRelation.setId(scene.getUserId());
SmartUserRelation user = userRelationService.getSingle(smartUserRelation);
if(user == null){
return null;
}
scene.setUserId(user.getUserId());
return sceneService.getList(scene);
}
@RequestMapping(value = "/getById", method = {RequestMethod.GET, RequestMethod.POST})
public SmartScene getById(Long id) {
log.info("/scene/getById param: {}", id);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!