代码编织梦想

源码获取:博客首页 "资源" 里下载!

项目介绍

流浪猫狗救助管理系统。该项目分为前后台;

前台主要功能包括:会员的注册登陆,流浪猫狗知识,领养中心,团队活动,流浪宠物详情,申请领养等;

后台主要功能包括:管理员的用户信息管理,流浪猫狗信息管理,管理员信息管理,领养管理,评论管理,团队活动管理,志愿者申请信息管理,同意/不同意领养信息列表等

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可

4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目

6.数据库:MySql 8.0版本;

技术栈

1. 后端:Spring SpringMVC MyBatis

2. 前端:JSP+bootstrap+jQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

2. 将项目中db.properties配置文件中的数据库配置改为自己的配置

3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;

4. 运行项目,

前台地址 http://localhost:8080/web/animal/index.jsp

后台地址 http://localhost:8080/web/animal/admin/login.jsp

588f8fb0374d4196bd318e93797655e3.jpeg
44602504301a4b54916c2e236cc89689.jpeg
a192a5ba9b64440593e75af249127358.jpeg
b3b6e072ccae4ed5aa05d2663e9093e5.jpeg
e56b8d3da3aa4ef28c93aee335806d0f.jpeg
2cb776599e7340678c456491db8b60ff.jpeg

后台管理员控制层:

@Controller@RequestMapping("admin/user")publicclassadminUserController {
    @Autowired
    UserService userService;
    @Autowired
    PostMapper postMapper;
    @Autowired
    ShareMapper shareMapper;
    @Autowired
    SponsorMapper sponsorMapper;

    @GetMapping("")public String write(Model model, HttpSession session,
                        @RequestParam(value = "page", defaultValue = "1")int page,
                        @RequestParam(value = "limit", defaultValue = "12")int limit){
        model.addAttribute("info",userService.queryUserAll(page,limit));
        return"admin/admin_user";
    }

    @GetMapping("delete")public String deleteUser(@RequestParam("userId")int userId){
        User user=userService.queryUserById(userId);
        if(user.getUserPhone().equals("1111")){
            return"redirect:/admin/user";
        }
        postMapper.deletePostByPhone(user.getUserPhone());
        shareMapper.deleteShareByPhone(user.getUserPhone());
        sponsorMapper.deleteSponsorByPhone(user.getUserPhone());
        userService.deleteUser(userId);
        return"redirect:/admin/user";
    }


}

详情管理控制层:

@Controller@RequestMapping("details")publicclassdetailsController {

    @Autowired
    IndexService indexService;
    @Autowired
    NoticeService noticeService;
    @Autowired
    DetailsService detailsService;
    @Autowired
    PostService postService;
    @Autowired
    SponsorService sponsorService;
    @Autowired
    ShareService shareService;
    @Autowired
    CommentMapper commentMapper;
    @Autowired
    HttpSession session;
    @Autowired
    ReportService reportService;
    @Autowired
    SentenceService sentenceService;


    @GetMappingpublic String index(Model model,Integer id,String status){
        int i=-1;
        if(status.equals(IndexFrom.Post.getDesc())){
            i=0;
        }elseif(status.equals(IndexFrom.Share.getDesc())){
            i=1;
        } elseif(status.equals(IndexFrom.Sponsor.getDesc())){
            i=2;
        }
        session.setAttribute(CatConst.USER_DETAILS_STATUS,i);
        session.setAttribute(CatConst.USER_DETAILS_CODE,id);
        model.addAttribute("comments",detailsService.findComment(i,id));
        detailsService.addCount(id,i);
        model.addAttribute("count",commentMapper.queryCount1(id,i));
        model.addAttribute("recommends",detailsService.findRecommends(i));
        IndexVo info=detailsService.findDetails(id,i);
        model.addAttribute("info",info);
        model.addAttribute("url",TitleUtil.getUrl());
        List<IndexVo> indexMax=indexService.findMaxCount();
        List<Notice> notices=noticeService.queryNotice();
        model.addAttribute("notices",notices);
        model.addAttribute("indexMax",indexMax);
        Sentence sentence=sentenceService.findSentence();
        model.addAttribute("sentence",sentence);
        return"details";
    }

    @PostMapping("interceptor/addComment")public String comment(String comment,Model model){
        int i= (int) session.getAttribute(CatConst.USER_DETAILS_STATUS);
        int id= (int) session.getAttribute(CatConst.USER_DETAILS_CODE);
        User user= (User) session.getAttribute("user_session");
        Comment comment1=newComment();
        comment1.setCommentContent(comment);
        comment1.setCommentPhone(user.getUserPhone());
        comment1.setCommentCreatetime(newDate());
        comment1.setCommentPsId(id);
        comment1.setCommentSource(i);
        commentMapper.addComment(comment1);
        model.addAttribute("comments",detailsService.findComment(i,id));
        detailsService.addCount(id,i);
        model.addAttribute("count",commentMapper.queryCount1(id,i));
        model.addAttribute("recommends",detailsService.findRecommends(i));
        IndexVo info=detailsService.findDetails(id,i);
        model.addAttribute("info",info);
        List<IndexVo> indexMax=indexService.findMaxCount();
        List<Notice> notices=noticeService.queryNotice();
        model.addAttribute("notices",notices);
        model.addAttribute("indexMax",indexMax);
        Sentence sentence=sentenceService.findSentence();
        model.addAttribute("sentence",sentence);
        model.addAttribute("url",TitleUtil.getUrl());
        return"details";
    }

    @PostMapping("interceptor/report")public String report(String reason,Model model){
        int i= (int) session.getAttribute(CatConst.USER_DETAILS_STATUS);
        int id= (int) session.getAttribute(CatConst.USER_DETAILS_CODE);
        User user= (User) session.getAttribute("user_session");
        if(reason.equals("")==false){
            Report report=newReport();
            report.setReportUser(user.getUserNickname());
            report.setReportCreatetime(newDate());
            report.setReportContent(reason);
            if(i==0){
                report.setReportFrom("启示");
            }if(i==1){
                report.setReportFrom("分享");
            }if(i==2){
                report.setReportFrom("赞助");
            }
            report.setReportFromId(id);
            reportService.addReport(report);
        }
        model.addAttribute("comments",detailsService.findComment(i,id));
        detailsService.addCount(id,i);
        model.addAttribute("recommends",detailsService.findRecommends(i));
        IndexVo info=detailsService.findDetails(id,i);
        model.addAttribute("info",info);
        List<IndexVo> indexMax=indexService.findMaxCount();
        List<Notice> notices=noticeService.queryNotice();
        model.addAttribute("notices",notices);
        model.addAttribute("indexMax",indexMax);
        Sentence sentence=sentenceService.findSentence();
        model.addAttribute("sentence",sentence);
        model.addAttribute("url",TitleUtil.getUrl());
        return"details";
    }
}

登录管理控制层:

@Controller@RequestMapping("")publicclassloginController {
    @Autowired
    UserService userService;

    @GetMapping(value = {"/login"})public String login(){
        return"login";
    }

    @GetMapping("reBack")public String reBack(HttpSession session){
        String url= (String) session.getAttribute("user_old_url");
        if(url==null){
            url="/";
        }
        return"redirect:"+url;
    }

    @GetMapping(value = {"login1"})public String login1(@RequestParam(value ="userUrl") String userUrl,HttpSession session){
        if(userUrl!=null){
            session.setAttribute(CatConst.USER_SESSION_URL,userUrl);
        }
        return"login";
    }

    @PostMapping("login/getLogin")@ResponseBodypublic LoginResult getLogin(@RequestParam(value ="phone") String phone,
                                @RequestParam(value ="password") String password, HttpSession session) {
        Useruser= userService.queryByPhone(phone);
        if(user!=null){
            if(user.getUserPassword().equals(MD5Util.getMD5(password))){
                session.setAttribute(CatConst.USER_SESSION_KEY, user);
                if(user.getUserPhone().equals("1111")){
                    session.setAttribute(CatConst.USER_SESSION_administrators, user.getUserPhone());
                }
                returnnewLoginResult(true, "登录成功");
            }else {
                returnnewLoginResult(false, "密码错误");
            }
        }else {
            returnnewLoginResult(false, "用户名错误");
        }
    }

    @PostMapping("/login/register")@ResponseBodypublic JsonResult register(User user,@RequestParam(value ="userCode") String userCode,HttpSession session){
        String code=session.getAttribute(CatConst.USER_SESSION_CODE).toString();
        if(code.equals(userCode)){
            if(userService.queryByPhone(user.getUserPhone())!=null){
                returnnewJsonResult(false, "电话号码已经注册!");
            }else {
                user.setUserPassword(MD5Util.getMD5(user.getUserPassword()));
                user.setUserCreatetime(newDate());
                user.setUserUrl(TitleUtil.getUrl());
                int i=userService.addUser(user);
                if(i==1){
                    session.removeAttribute(CatConst.USER_SESSION_CODE);
                    returnnewJsonResult(true, "注册成功!");
                }else {
                    returnnewJsonResult(false, "注册失败!");
                }
            }
        }else {
            returnnewJsonResult(false, "验证码错误!");
        }
    }

    @PostMapping("login/updatePassword")@ResponseBodypublic JsonResult updatePassword(@RequestParam(value ="userPhone") String userPhone,
                                     @RequestParam(value ="userCode") String userCode,
                                     @RequestParam(value ="userPassword") String userPassword,HttpSession session){
        String code=session.getAttribute(CatConst.USER_SESSION_CODE).toString();
        if(code.equals(userCode)){
            int i=userService.updateUserPhone(MD5Util.getMD5(userPassword),userPhone);
            if(i==1){
                session.removeAttribute(CatConst.USER_SESSION_CODE);
                returnnewJsonResult(true, "密码更新成功!");
            }else {
                returnnewJsonResult(false, "密码更新失败!");
            }
        }else {
            returnnewJsonResult(false, "验证码错误!");
        }
    }

    @PostMapping("login/getCode")@ResponseBodypublic JsonResult getCode(@RequestParam(value ="userPhone") String userPhone,HttpSession session){
        DuanxinService duanxinService=newDuanxinService();
//       int code=duanxinService.duanXin(userPhone);
       session.setAttribute(CatConst.USER_SESSION_CODE,"1234");
       returnnewJsonResult(true,"发送成功");
    }



//    有时,一些网站的部分操作需要登录才能访问。如果跳转到登录界面登录成功后,怎样才能返回到登录之前的界面呢?//    很简单,我们在代码部分中添加一部分很少的代码即可。在从一个页面跳转到登录界面之前的代码,我们用session保//    存当前界面的url信息,在跳转到登录界面,登录成功后的代码中,判读是否有这个session信息,如果有,则跳转到//    session所存的url,记住跳转前清空这个session,否则在未关闭浏览器重新登录时可能又会跳到session中所存储url的界面。

}

源码获取:博客首页 "资源" 里下载!

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/2301_76223934/article/details/129646983

基于javaweb+ssm的流浪猫狗救助管理系统(java+ssm+jsp+bootstrap+jquery+mysql)_m0_71016350的博客-爱代码爱编程

项目介绍 流浪猫狗救助管理系统。该项目分为前后台; 前台主要功能包括:会员的注册登陆,流浪猫狗知识,领养中心,团队活动,流浪宠物详情,申请领养等; 后台主要功能包括:管理员的用户信息管理,流浪猫狗信息管理,管理员信息管理,领养管理,评论管理,团队活动管理,志愿者申请信息管理,同意/不同意领养信息列表等 环境需要 1.运行环境:最好是java jdk 1.

基于javaweb+mysql的流浪猫狗救助管理系统(java+ssm+jsp+bootstrap+jquery+mysql)_m0_71327920的博客-爱代码爱编程

项目介绍 流浪猫狗救助管理系统。该项目分为前后台; 前台主要功能包括:会员的注册登陆,流浪猫狗知识,领养中心,团队活动,流浪宠物详情,申请领养等; 后台主要功能包括:管理员的用户信息管理,流浪猫狗信息管理,管理员信息管理,领养管理,评论管理,团队活动管理,志愿者申请信息管理,同意/不同意领养信息列表等 环境需要 1.运行环境:最好是java jdk 1.

基于java毕业设计在线学习系统源码+系统+mysql+lw文档+部署软件_妮维网络的博客-爱代码爱编程

基于Java毕业设计在线学习系统源码+系统+mysql+lw文档+部署软件 基于Java毕业设计在线学习系统源码+系统+mysql+lw文档+部署软件 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery等技术 后端技术:JA

java计算机毕业设计理发店会员管理系统源码+系统+mysql数据库+lw文档_双双科技的博客-爱代码爱编程

java计算机毕业设计理发店会员管理系统源码+系统+mysql数据库+lw文档 java计算机毕业设计理发店会员管理系统源码+系统+mysql数据库+lw文档 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery等技术 后端技

基于javaweb的流浪猫狗救助管理系统(java+ssm+jsp+bootstrap+jquery+mysql)_m0_68551656的博客-爱代码爱编程

基于javaweb的流浪猫狗救助管理系统(java+ssm+jsp+bootstrap+jquery+mysql) 运行环境 Java≥8、MySQL≥5.7、Tomcat≥8 开发工具 eclipse/idea/m

java计算机毕业设计苗木购销系统源程序+mysql+系统+lw文档+远程调试_你眼里的星星的博客-爱代码爱编程

java计算机毕业设计苗木购销系统源程序+mysql+系统+lw文档+远程调试 java计算机毕业设计苗木购销系统源程序+mysql+系统+lw文档+远程调试 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery等技术 后端技术:

基于java贫困助学管理系统计算机毕业设计源码+系统+mysql数据库+lw文档+部署_沪港的博客-爱代码爱编程

基于JAVA贫困助学管理系统计算机毕业设计源码+系统+mysql数据库+lw文档+部署 基于JAVA贫困助学管理系统计算机毕业设计源码+系统+mysql数据库+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery

java计算机毕业设计家教管理系统源码+mysql数据库+系统+lw文档+部署_卓远1991的博客-爱代码爱编程

java计算机毕业设计家教管理系统源码+mysql数据库+系统+lw文档+部署 java计算机毕业设计家教管理系统源码+mysql数据库+系统+lw文档+部署 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery等技术 后端技术:

java毕业生设计员工信息管理计算机源码+系统+mysql+调试部署+lw_媛来sn的博客-爱代码爱编程

java毕业生设计员工信息管理计算机源码+系统+mysql+调试部署+lw java毕业生设计员工信息管理计算机源码+系统+mysql+调试部署+lw 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery等技术 后端技术:JA

java计算机毕业设计的洗衣店订单管理系统源程序+mysql+系统+lw文档+远程调试-爱代码爱编程

java计算机毕业设计的洗衣店订单管理系统源程序+mysql+系统+lw文档+远程调试 java计算机毕业设计的洗衣店订单管理系统源程序+mysql+系统+lw文档+远程调试 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery

pthread-爱代码爱编程

问题描述: 从业务抽离出来大概是这样:大概是如下的场景,这个程序跑了40分钟后,pthread_create返回11,创建失败。 int i=0; void play_handle(){     i=0;     for(;i<5;i++){         sleep(1);         printf("i=%d\n",i);    

有图解有案例,我终于把 condition 的原理讲透彻了-爱代码爱编程

哈喽大家好,我是阿Q! 20张图图解ReentrantLock加锁解锁原理文章一发,便引发了大家激烈的讨论,更有小伙伴前来弹窗:平时加解锁都是直接使用Synchronized关键字来实现的,简单好用,为啥还要引用Reent

如何优雅的用poi导入excel文件-爱代码爱编程

在企业级项目开发中,要经常涉及excel文件和程序之间导入导出的业务要求,那么今天来讲一讲excel文件导入的实现。java实现对excel的操作有很多种方式,例如EasyExcel等,今天我们使用的是POI技术实现excel文件的导入。 POI技术简介 1.POI概念 Apache POI 是用Java编写的免费开源的跨平台的Java AP

jvm监控搭建-爱代码爱编程

文章目录 JVM监控搭建整体架构JolokiaTelegrafInfluxdbGrafana JVM监控搭建 整体架构 JVM 的各种内存信息,会通过 JMX 接口进行暴露。 Jolokia

java项目:ssm流浪猫狗救助管理系统_流浪猫管理系统-爱代码爱编程

作者主页:夜未央5788  简介:Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 项目介绍 流浪猫狗救助管理系统。该项目分为前后台; 前台主要功能包括:会员的注册登陆,流浪猫狗知识,领养中心,团队活动,流浪宠物详情,申请领养等; 后台主要功能包括:管理员的用户信息管理,流浪猫狗信息管理,管理员信息管理,领养

计算机毕业设计java诊所信息管理系统(源码+系统+mysql数据库+lw文档)-爱代码爱编程

计算机毕业设计Java诊所信息管理系统(源码+系统+mysql数据库+Lw文档) 计算机毕业设计Java诊所信息管理系统(源码+系统+mysql数据库+Lw文档) 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery等技术

java毕业生设计扶贫信息管理系统计算机源码+系统+mysql+调试部署+lw-爱代码爱编程

java毕业生设计扶贫信息管理系统计算机源码+系统+mysql+调试部署+lw java毕业生设计扶贫信息管理系统计算机源码+系统+mysql+调试部署+lw 本源码技术栈: 项目架构:B/S架构 开发语言:Java语言 开发软件:idea eclipse 前端技术:Layui、HTML、CSS、JS、JQuery等技术

biginteger 和bigdecimal-爱代码爱编程

出处:为什么会想到大数呢?是因为最近在写leetcode刷题的时候钻牛角尖非要实现数组加1的问题导致的。(leetcode 66 加1问题)不过ps自己对大数还是用的少了,导致害怕用,然后leetcode用了还报错。(