SceneController.java
1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.glsx.smart.controller;
import java.util.List;
import com.glsx.smart.entity.SmartScense;
import com.glsx.smart.entity.SmartScenseExample;
import com.glsx.smart.service.SmartScenseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-15
*/
@RestController
@RequestMapping("/scene")
public class SceneController {
@Autowired
private SmartScenseService scenseService;
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public List<SmartScense> getList(SmartScense scense) {
return scenseService.selectByExample(new SmartScenseExample());
}
@RequestMapping(value = "/getById", method = {RequestMethod.GET, RequestMethod.POST})
public SmartScense getById(Long id) {
return scenseService.selectByPrimaryKey(id);
}
@RequestMapping(value = "/save", method = {RequestMethod.POST})
public void save(@RequestBody SmartScense scense) {
scenseService.insertOrUpdate(scense);
}
}