当前位置:网站首页>Pet adoption system based on ssm+mysql+layui
Pet adoption system based on ssm+mysql+layui
2022-07-25 08:07:00 【two billion sixteen million eight hundred and fifty-five thousa】
User login registration

register

The pet market

Add adoption

Release operation

User management

Configuration page

Store management

Modify user information

Technical description
development tool : Idea/Eclipse
database : mysql
Jar Warehouse : Ordinary jar package
Front frame :jquery/layui
Back end framework : Spring+SpringMVC+Mybatis
Information note
be based on SSM+MySQL+Layui Our pet adoption system , Divided into administrators , Ordinary users , The overall function includes , User login registration , Pet market view , My pet information , User management , Store management , Pet management .
package com.java456.controller;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.UUID;
import javax.annotation.Resource;
import javax.naming.spi.ObjectFactoryBuilder;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.io.FileUtils;
import org.apache.shiro.SecurityUtils;
import org.aspectj.apache.bcel.classfile.Constant;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.converter.json.MappingJacksonValue;
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.RequestParam;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.java456.entity.Config;
import com.java456.entity.Result;
import com.java456.entity.Tree;
import com.java456.entity.User;
import com.java456.service.ConfigService;
import com.java456.service.PublicService;
import com.java456.service.TreeService;
import com.java456.service.UserService;
import com.java456.util.DateUtil;
import com.java456.util.MyUtil;
import com.java456.util.ResponseUtil;
import com.java456.util.StringUtil;
import com.java456.util.XMLUtil;
import com.mysql.fabric.xmlrpc.base.Data;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
/**
* Home page Contrller
* edition 2.10 to update Up
*/
@Controller
@RequestMapping("/")
public class IndexContrller {
@Resource
private TreeService treeService;
@Resource
private PublicService publicService;
/**
* /wap/laws/index
* Request home page
*/
@RequestMapping("/index")
public ModelAndView index(HttpServletResponse res,HttpServletRequest req) throws Exception {
ModelAndView mav = new ModelAndView();
String UserAgent = req.getHeader("User-Agent");
// Judge AppleWebKit and Firefox
if(MyUtil.checkUserAgent(UserAgent)){
mav.setViewName("/pc/login/login");
}else{
mav.setViewName("/admin/common/s_mode");
}
System.out.println("【UserAgent】【】【】【】】【"+UserAgent);
return mav;
}
/**
* Computer login
*/
@RequestMapping("/login")
public ModelAndView login(HttpServletResponse res,HttpServletRequest req) throws Exception {
ModelAndView mav = new ModelAndView();
String UserAgent = req.getHeader("User-Agent");
// Judge AppleWebKit and Firefox
if(MyUtil.checkUserAgent(UserAgent)){
mav.setViewName("/pc/login/login");
}else{
mav.setViewName("/admin/common/s_mode");
}
System.out.println("【UserAgent】【】【】【】】【"+UserAgent);
return mav;
}
/**
* Computer registration
*/
@RequestMapping("/reg")
public ModelAndView reg(HttpServletResponse res,HttpServletRequest req) throws Exception {
ModelAndView mav = new ModelAndView();
String UserAgent = req.getHeader("User-Agent");
// Judge AppleWebKit and Firefox
if(MyUtil.checkUserAgent(UserAgent)){
mav.setViewName("/pc/reg/reg");
}else{
mav.setViewName("/admin/common/s_mode");
}
System.out.println("【UserAgent】【】【】【】】【"+UserAgent);
return mav;
}
/**
* Background home page
*/
@RequestMapping("/admin/main")
public ModelAndView admin_main(HttpServletResponse res,HttpServletRequest req) throws Exception {
ModelAndView mav = new ModelAndView();
publicService.addLeftMenu(mav);
System.out.println(MyUtil.getRemoteAddress(req));
String UserAgent = req.getHeader("User-Agent");
if(MyUtil.checkUserAgent(UserAgent)){
mav.setViewName("/admin/main");
}else{
mav.setViewName("/admin/common/s_mode");
}
return mav;
}
}
package com.java456.controller;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Date;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.google.gson.Gson;
import com.java456.entity.Result;
import com.java456.util.DateUtil;
import com.java456.util.FileUtil;
import com.java456.util.QRcodeUtil;
import com.java456.util.ResponseUtil;
@Controller
@RequestMapping("/qrcode")
public class QRcodeController {
/**
* /qrcode/create
* @param content
* @param size
* @param requset
* @param response
* @return
* @throws Exception
*/
@RequestMapping("/create")
public String getQRCode(@RequestParam(value = "content", required = false) String content,
HttpServletRequest requset, HttpServletResponse response) throws Exception {
// User currentUser = (User) tv
// SecurityUtils.getSubject().getSession().getAttribute("currentUser");
// Generate qr code QRCode picture
BufferedImage bufImg = QRcodeUtil.qRCodeCommon(content, "jpg", QRcodeUtil.getSize(content));
// Save to PC
String fileName = DateUtil.formatDate(new Date(), "yyyyMMddHHmmssSSS");
String path = requset.getSession().getServletContext().getRealPath("");
String file_path = "/static/images/QRcode/";
path = path +file_path ;
FileUtil.makeDirs(path);
try {
// hold img Save it on the server . Return the address to the opposite
ImageIO.write(bufImg, "jpg", new File(path + fileName + ".jpg"));
} catch (Exception e) {
e.printStackTrace();
}
Result result = new Result();
result.setSuccess(true);
result.setMsg(file_path+fileName + ".jpg");
Gson gson = new Gson();
ResponseUtil.write(response, gson.toJson(result));
// ImageIO.write(bufImg, "jpg", response.getOutputStream());
return null;
}
}
边栏推荐
- Vscode remote connection server, switch to go version
- 7.24 simulation summary
- Learn when playing No 1 | can live classroom still be like this? Come and unlock "new posture"!
- Sqlserver has opened the CDC table. Why can we only pull the full amount of data and can't recognize the incremental data
- Learn no when playing 8 | the enterprise saves hundreds of thousands in an instant, just because it uses it
- [5g NR] UE registration rejection reason
- JS typewriter animation JS special effect plug-in autotyperjs
- Advanced C language (XII) - dynamic memory management
- Brush the title "sword finger offer" day02
- JS pop up picture Lightbox light box plug-in spotlight.js
猜你喜欢

Brush the title "sword finger offer" day02

JS cool rolling picture deformation animation JS special effects

In depth analysis of yolov7 network architecture

Native form submission data

Didi eta (estimate the travel time)

A review of nature: gender differences in anxiety and depression - circuits and mechanisms

File details

efcore在Saas系统下多租户零脚本分表分库读写分离解决方案

MVC mode three-tier architecture

第3章业务功能开发(实现全选按钮实时的响应)
随机推荐
Raspberry pie 4B parsing PWM
The 17th revitalization cup computer programmer (cloud computing platform operation and development) finals
475-82(230、43、78、79、213、198、1143)
交叉熵计算公式
Problems easily ignored by POM
Efcore's solution of multi tenant zero script, table and database read-write separation under SaaS system
A review of nature: gender differences in anxiety and depression - circuits and mechanisms
Raspberry Pie 3 connected to WiFi
Leetcode (Sword finger offer) - 04. search in two-dimensional array
ArcGIS Pro scripting tool (10) -- generate.Stylx style symbols from layers
Teach you to use cann to convert photos into cartoon style
Raspberry pie CM4 -- using metartc3.0 to integrate ffmpeg to realize webrtc push-pull streaming
Weblux default IO threads
机器学习理论及案例分析(part1)--机器学习基础
Learn no when playing 8 | the enterprise saves hundreds of thousands in an instant, just because it uses it
Use of toolbar
用一个栈实现另一个栈的排序
Vs2019 C MFC installation
Learn when playing No 4 | can you take an online exam in programming? Right here →
[5g NR] UE registration rejection reason