• 大小: 1.24MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-09
  • 语言: 其他
  • 标签: 开发  

资源简介

基于maven的ssm项目,完成账户的登陆、注册、修改;设备激活以及传感器的添加、修改、删除;传感器动作以及触发条件的设置

资源截图

代码片段和文件信息

package com.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.dao.mapper.DeviceMapper;
import com.entity.Device;
import com.entity.DeviceAction;
import com.entity.User;
import com.entity.UserMessage;
import com.service.iface.DeviceServiceIface;
import com.service.iface.UserServiceIface;
@Controller
public class BeginController {

@Autowired
private UserServiceIface userService;
@Autowired
private DeviceServiceIface deviceService;
@Autowired
private DeviceMapper deviceMapper;
@RequestMapping(“/toIndex“)
public String index(){

return “index“;
}
@RequestMapping(“/toUser_profile“)
public String toUser_profile(){
return “user_profile“;
}
@RequestMapping(“/toLogin“)
public String toLogin(HttpServletRequest request){
String message = ““;
request.setAttribute(“codeErrMessage“ message);
return “login“;
}
@RequestMapping(“/toRegister“)
public String toRegister(){
return “register“;
}

@RequestMapping(“/toNotifications“)
public String toNotifications(HttpSession session){
userService.updateReadStatus();
User u = (User) session.getAttribute(“user“);
int receiverId = u.getUserId();
List UserMessageList = userService.selectAllMessage(receiverId);
session.setAttribute(“UserMessageList“ UserMessageList);
return “notifications“;
}
@RequestMapping(“/change_password“)
public String toChange_password(){
return “change_password“;
}
/*
 * 显示首页
 */
@RequestMapping(“/showIndex/{name}“)
public String showIndex(HttpSession session@PathVariable(value=“name“) String name){
User u = userService.selectActivationStatus(name);
int receiverId = u.getUserId();
List deviceActionList = deviceMapper.selectAllActions();
session.setAttribute(“deviceActionList“ deviceActionList);
List deviceList = deviceService.selectDeviceAndSensor(receiverId);
List UserMessageList = userService.selectAllMessage(receiverId);
session.setAttribute(“deviceList“ deviceList);
session.setAttribute(“user“ u);
session.setAttribute(“UserMessageList“ UserMessageList);


return “redirect:/toIndex“;
}
/*
 * 注销操作
 */
@RequestMapping(“/cancelUser“)
public String cancelUser(HttpSession session){
session.invalidate();
return

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1580  2018-10-03 15:09  geeklink\.classpath

     文件        548  2018-10-03 15:16  geeklink\.externalToolBuilders\org.eclipse.wst.jsdt.core.javascriptValidator.launch

     文件       1448  2018-10-03 15:16  geeklink\.project

     文件        503  2018-10-03 15:05  geeklink\.settings\.jsdtscope

     文件         57  2018-10-03 14:14  geeklink\.settings\org.eclipse.core.resources.prefs

     文件        430  2018-10-03 15:05  geeklink\.settings\org.eclipse.jdt.core.prefs

     文件         90  2018-10-03 14:14  geeklink\.settings\org.eclipse.m2e.core.prefs

     文件        660  2018-10-03 15:06  geeklink\.settings\org.eclipse.wst.common.component

     文件        292  2018-10-03 15:05  geeklink\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2018-10-03 15:05  geeklink\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2018-10-03 15:05  geeklink\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件        232  2018-10-03 15:16  geeklink\.settings\org.eclipse.wst.xsl.core.prefs

     文件       2602  2018-10-03 15:59  geeklink\generatorConfig.xml

     文件       4299  2018-10-07 19:47  geeklink\pom.xml

     文件       8232  2018-10-12 15:49  geeklink\src\main\java\com\controller\BeginController.java

     文件       1805  2018-10-03 22:05  geeklink\src\main\java\com\controller\CheckCodeController.java

     文件       9943  2018-10-11 10:04  geeklink\src\main\java\com\controller\DeviceController.java

     文件       6551  2018-10-11 22:18  geeklink\src\main\java\com\controller\SensorsController.java

     文件       1209  2018-10-09 10:03  geeklink\src\main\java\com\dao\mapper\DeviceMapper.java

     文件       1055  2018-10-11 18:41  geeklink\src\main\java\com\dao\mapper\SensorsMapper.java

     文件        833  2018-10-06 11:59  geeklink\src\main\java\com\dao\mapper\UserMapper.java

     文件       4167  2018-10-09 10:30  geeklink\src\main\java\com\entity\Device.java

     文件       1747  2018-10-08 13:44  geeklink\src\main\java\com\entity\DeviceAction.java

     文件       2441  2018-10-06 10:03  geeklink\src\main\java\com\entity\Sensor.java

     文件       2474  2018-10-11 18:22  geeklink\src\main\java\com\entity\SensorAction.java

     文件       2753  2018-10-05 14:45  geeklink\src\main\java\com\entity\User.java

     文件       2132  2018-10-05 14:17  geeklink\src\main\java\com\entity\UserMessage.java

     文件       3885  2018-10-10 22:45  geeklink\src\main\java\com\service\DeviceService.java

     文件       1159  2018-10-09 20:42  geeklink\src\main\java\com\service\iface\DeviceServiceIface.java

     文件        998  2018-10-11 18:41  geeklink\src\main\java\com\service\iface\SensorsServiceIface.java

............此处省略178个文件信息

评论

共有 条评论