|
@@ -0,0 +1,97 @@
|
|
|
+ package com.huimv.management.controller;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.huimv.management.entity.SleepStatusEntity;
|
|
|
+import com.huimv.management.service.SleepStatusService;
|
|
|
+import com.huimv.common.utils.PageUtils;
|
|
|
+import com.huimv.common.utils.R;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 睡眠状态表
|
|
|
+ *
|
|
|
+ * @author yinhao
|
|
|
+ * @email yinhao@163.com
|
|
|
+ * @date 2021-04-28 13:27:37
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("management/sleepstatus")
|
|
|
+public class SleepStatusController {
|
|
|
+ @Autowired
|
|
|
+ private SleepStatusService sleepStatusService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 列表
|
|
|
+ */
|
|
|
+ @RequestMapping("/list")
|
|
|
+ //@RequiresPermissions("management:sleepstatus:list")
|
|
|
+ public R list(@RequestParam Map<String, Object> params){
|
|
|
+ PageUtils page = sleepStatusService.queryPage(params);
|
|
|
+
|
|
|
+ return R.ok().put("page", page);
|
|
|
+ }
|
|
|
+ @RequestMapping("/findAll")
|
|
|
+ //@RequiresPermissions("management:sleepstatus:list")
|
|
|
+ public R findAll( ){
|
|
|
+ List<SleepStatusEntity> page = sleepStatusService.findAll();
|
|
|
+
|
|
|
+ return R.ok().put("page", page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 信息
|
|
|
+ */
|
|
|
+ @RequestMapping("/info/{id}")
|
|
|
+ //@RequiresPermissions("management:sleepstatus:info")
|
|
|
+ public R info(@PathVariable("id") Integer id){
|
|
|
+ SleepStatusEntity sleepStatus = sleepStatusService.getById(id);
|
|
|
+
|
|
|
+ return R.ok().put("sleepStatus", sleepStatus);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存
|
|
|
+ */
|
|
|
+ @RequestMapping("/save")
|
|
|
+ //@RequiresPermissions("management:sleepstatus:save")
|
|
|
+ public R save(@RequestBody SleepStatusEntity sleepStatus){
|
|
|
+ sleepStatusService.save(sleepStatus);
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ */
|
|
|
+ @RequestMapping("/update")
|
|
|
+ //@RequiresPermissions("management:sleepstatus:update")
|
|
|
+ public R update(@RequestBody SleepStatusEntity sleepStatus){
|
|
|
+ sleepStatusService.updateById(sleepStatus);
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ @RequestMapping("/delete")
|
|
|
+ //@RequiresPermissions("management:sleepstatus:delete")
|
|
|
+ public R delete(@RequestBody Integer[] ids){
|
|
|
+ sleepStatusService.removeByIds(Arrays.asList(ids));
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|