package com.base.controller;
import com.base.entitys.Device;
import com.base.entitys.DeviceType;
import com.base.entitys.DeviceTypePort;
import com.base.entitys.Gate;
import com.base.repositorys.DeviceDao;
import com.base.repositorys.DeviceTypePortDao;
import com.base.services.DeviceService;
import com.base.services.DeviceTypePortService;
import com.base.services.DeviceTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.*;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
/**
* Created by lx on 2016/11/25.
*/
@Controller
@CrossOrigin(origins = {}, methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.OPTIONS})
public class ProController {
@Autowired
DeviceService deviceService;
@Autowired
DeviceTypeService deviceTypeService;
@Autowired
DeviceTypePortService deviceTypePortService;
@Autowired
DeviceDao deviceDao;
@Autowired
DeviceTypePortDao deviceTypePortDao;
@RequestMapping("/devicetypeadd")
@ResponseBody
Object devicetypeadd(@RequestBody DeviceType deviceType){
Object result1=this.deviceTypeService.saveDeviceType(deviceType);
Map map = new HashMap();
if (result1==null) {
map.put("code", "0");
map.put("msg", "fail");
} else {
map.put("code", "1");
map.put("msg", "success");
}
return map;
}
@RequestMapping("/deviceadd")
@ResponseBody
Object deviceadd(String deviceID ,String chinatypename){
Object result1=this.deviceService.saveDevice(deviceID,chinatypename);
Map map = new HashMap();
if (result1 == null) {
map.put("code", "0");
map.put("msg", "fail");
} else {
map.put("code", "1");
map.put("msg", "success");
}
return map;
}
@RequestMapping("/devicetypeportadd")
@ResponseBody
Object devicetypeportadd(String port,String portmean,String portalarm,String message,long id){
Object result1=this.deviceTypePortService.saveDeviceTypePort(port,portmean,portalarm,message,id);
Map map = new HashMap();
if (result1 == null) {
map.put("code", "0");
map.put("msg", "fail");
} else {
map.put("code", "1");
map.put("msg", "success");
}
return map;
}
@RequestMapping("/selectdeviceport")
@ResponseBody
Object selectdeviceport(){
return this.deviceTypePortService.findAll();
}
@RequestMapping("/deviceport")
@ResponseBody
Object deviceport(Long devicetypeid){
return this.deviceTypePortService.devicePort(devicetypeid);
}
@RequestMapping(value = "/deviceparams")
@ResponseBody
public Object getEntryByParams(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "8") Integer size) {
Sort sort = new Sort(Sort.Direction.ASC, "id");
Pageable pageable = new PageRequest(page-1, size, sort);
Page<Device> Exams = deviceDao.findAll(pageable);
Map map=new HashMap();
map.put("Total",Exams.getTotalElements());
map.put("Content",Exams.getContent());
return map;
}
@RequestMapping(value = "/devicesearch")
@ResponseBody
public Object getEntryBySearch(@RequestParam(value = "page", defaultValue = "1") Integer page,
String info,
@RequestParam(value = "size", defaultValue = "8") Integer size) {
String info2="'%"+info+"%'";
Page<Map<String,Object>> Exams = deviceService.deviceSqlSearch(page,size,info2);
Map map=new HashMap();
map.put("Total",Exams.getTotalElements());
map.put("Content",Exams.getContent());
return map;
}
@RequestMapping(value = "/deviceportparams")
@ResponseBody
public Object getEntryByParams1(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "size", defaultValue = "8") Integer size) {
Sort sort = new Sort(Sort.Direction.ASC, "id");
Pageable pageable = new PageRequest(page-1, size, sort);
Page<DeviceTypePort> Exams = deviceTypePortDao.findAll(pageable);
Map map=new HashMap();
map.put("Total",Exams.getTotalElements());
map.put("Content",Exams.getContent());
return map;
}
@RequestMapping(value = "/deviceportsearch")
@ResponseBody
public Object getEntryBySearch1(@RequestParam(value = "page", defaultValue = "1") Integer page,
String info,
@RequestParam(value = "size", defaultValue = "8") Integer size) {
String info2="'%"+info+"%'";
Page<Map<String,Object>> Exams = deviceTypePortService.deviceportSqlSearch(page,size,info2);
Map map=new HashMap();
map.put("Total",Exams.getTotalElements());
map.put("Content",Exams.getContent());
return map;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
毕设&课程作业_物联网智能家居设备后台管理系统.zip
共559个文件
jar:107个
js:88个
xml:71个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 141 浏览量
2024-02-21
09:51:33
上传
评论 1
收藏 107.13MB ZIP 举报
温馨提示
计算机类毕业设计、课程作业,系统源码!!!
资源推荐
资源详情
资源评论
收起资源包目录
毕设&课程作业_物联网智能家居设备后台管理系统.zip (559个子文件)
ProController.class 7KB
ProController.class 7KB
RoomController.class 5KB
RoomController.class 5KB
GateController.class 4KB
GateController.class 4KB
RoomService.class 4KB
RoomService.class 4KB
DeviceTypePortService.class 4KB
DeviceTypePortService.class 4KB
GateService.class 4KB
GateService.class 4KB
DeviceService.class 3KB
DeviceService.class 3KB
QueryDaoImpl.class 3KB
QueryDaoImpl.class 3KB
MyInterceptorLoginLog.class 2KB
MyIntercepterLoginTest.class 2KB
DeviceTypePort.class 2KB
DeviceTypePort.class 2KB
DeviceTypeService.class 2KB
DeviceTypeService.class 2KB
Gate.class 2KB
Gate.class 2KB
DeviceType.class 2KB
DeviceType.class 2KB
Device.class 1KB
Device.class 1KB
MyWebAppConfigurer.class 1KB
GateDao.class 1KB
GateDao.class 1KB
Room.class 1KB
Room.class 1KB
RoomDao.class 1021B
RoomDao.class 1021B
QueryDaoImpl$1.class 912B
QueryDaoImpl$1.class 912B
DeviceTypePortDao.class 825B
DeviceTypePortDao.class 825B
Application.class 821B
Application.class 821B
DeviceDao.class 623B
DeviceDao.class 623B
QueryDao.class 514B
QueryDao.class 514B
DeviceTypeDao.class 494B
DeviceTypeDao.class 494B
bootstrap.css 134KB
bootstrap.css 134KB
pintuer.css 110KB
pintuer.css 110KB
bootstrap.min.css 93KB
bootstrap.min.css 93KB
style2.css 43KB
style2.css 43KB
style.css 43KB
style.css 43KB
font-awesome.css 37KB
font-awesome.css 37KB
font-awesome.min.css 30KB
font-awesome.min.css 30KB
common.css 17KB
common.css 17KB
style1.css 5KB
style1.css 5KB
fileinput.css 4KB
fileinput.css 4KB
jasmine.css 4KB
jasmine.css 4KB
admin.css 4KB
admin.css 4KB
supersized.css 2KB
supersized.css 2KB
blue.css 2KB
blue.css 2KB
brown.css 2KB
brown.css 2KB
default.css 2KB
default.css 2KB
jquery.page.css 1KB
jquery.page.css 1KB
reset.css 1KB
reset.css 1KB
bootstrapValidator.css 700B
bootstrapValidator.css 700B
bootstrapValidator.min.css 694B
bootstrapValidator.min.css 694B
fontawesome-webfont.eot 162KB
fontawesome-webfont.eot 162KB
progress.gif 3KB
progress.gif 3KB
roomquery.html 12KB
devicequery.html 11KB
roomquery.html 10KB
devicequery.html 10KB
index.html 7KB
index.html 7KB
Echart.html 7KB
Echart.html 7KB
deviceportquery.html 5KB
共 559 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
学术菜鸟小晨
- 粉丝: 1w+
- 资源: 4960
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功