您的位置:首页 > 数据库 > Redis

基于SpringBoot+Redis的系统JSP+MYSQL在线相册系统照片社区

2020-03-05 09:38 423 查看

基于SpringBoot+Redis的系统JSP+MYSQL在线相册系统照片社区
1.包含源程序,数据库脚本。代码和数据库脚本都有详细注释。
2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善

github,下载 https://github.com/21503882/net-photo
开发环境:
Eclipse ,MYSQL,JDK1.8,Tomcat 8.5
涉及技术点:
MVC模式、SpringBoot、Mybatis、Redis、HTML、log4j、druid、Bootstrap、
Semantic UI、Thymeleaf、JavaScript、CSS、JQUERY、Ajax等
适合学习J2EE的一段时间的熟手,代码思路清晰,注解详细,数据库用的是mysql5.1,服务器用的tomcat8.5,JDK版本1.8. 编程软件Eclispe J2EE版本。是典型MVC架构,并且前后台分离
主要功能:

 

 

 

/**
 * @FileName:        ExamineeController.java
 * @Description:    TODO
 *
 * @author             
 * @version            V1.0
 * @Date               2018年1月11日 下午11:15:29
 *
 */
package com.njfu.bysj.oerts.controller;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import com.aliyuncs.exceptions.ClientException;
import com.njfu.bysj.oerts.bean.IdentifyLogin;
import com.njfu.bysj.oerts.entity.ExamineeEntity;
import com.njfu.bysj.oerts.entity.JsonResult;
import com.njfu.bysj.oerts.service.ExamineeService;
import com.njfu.bysj.oerts.utils.JsonUtil;
import com.njfu.bysj.oerts.utils.SmsUtil;
 
/**
 * @ClassName: ExamineeController
 * @Description: TODO
 *
 * @author: 徐至彦
 * @date: 2018年1月11日 下午11:15:29
 *
 */
@RestController
public class ExamineeController {
 
    @Autowired
    private ExamineeService examineeService;
 
    @PostMapping("/loginbypassw")
    public JsonResult loginByPassw(@RequestBody ExamineeEntity userLogin) {
        if (examineeService.loginByPassw(userLogin)) {
            return JsonUtil.success(examineeService.getByUserPhone(userLogin.getUserPhone()));
        } else {
            return JsonUtil.failed("没有对应用户数据");
        }
    }
 
    @PostMapping("/registbypassw")
    public JsonResult registByPassw(@RequestBody ExamineeEntity userRegist) {
        if (examineeService.registByPassw(userRegist)) {
            return JsonUtil.success();
        } else {
            return JsonUtil.failed("注册失败");
        }
    }
 
    @PostMapping("/examinee/regist/identifycode")
    public JsonResult registByIdentifycode(@RequestBody ExamineeEntity userRegist) {
        if (examineeService.registByIdentifycode(userRegist)) {
            return JsonUtil.success();
        } else {
            return JsonUtil.failed("注册失败");
        }
    }
 
    @PostMapping("/updatebyuserphone")
    public JsonResult updateByUserPhone(@RequestBody ExamineeEntity userInfo) {
        if (examineeService.updateByUserPhone(userInfo)) {
            return JsonUtil.success();
        } else {
            return JsonUtil.failed("更新用户数据失败");
        }
    }
 
    @GetMapping("/countbyuserphone/{userPhone}")
    public JsonResult countByUserPhone(@PathVariable String userPhone) {
        return JsonUtil.success(examineeService.countByUserPhone(userPhone));
    }
 
    @GetMapping("/getbyuserphone/{userPhone}")
    public JsonResult getByUserPhone(@PathVariable String userPhone) {
        return JsonUtil.success(examineeService.getByUserPhone(userPhone));
    }
 
    @GetMapping("/examinee/list/all")
    public JsonResult getAllExaminee() {
        return JsonUtil.success(examineeService.getAllExaminee());
    }
 
    @PostMapping("/examinee/login/identifycode")
    public JsonResult loginByIdentifycode(@RequestBody ExamineeEntity userLogin) throws ClientException {
 
        String templateCode = SmsUtil.createIdentifycode();
        String templateParam = "{\"code\":\"" + templateCode + "\"}";
 
        // 发送短信
        SmsUtil.sendSms(userLogin.getUserPhone(), "SMS_134105056", templateParam);
 
        // 返回手机号和对应验证码
        IdentifyLogin identify = new IdentifyLogin();
        identify.setUserPhone(userLogin.getUserPhone());
        identify.setCode(templateCode);
 
        return JsonUtil.success(identify);
    }
 
    @PostMapping("/examinee/update/identifycode")
    public JsonResult updatePasswByIdentifycode(@RequestBody ExamineeEntity userLogin) throws ClientException {
 
        String templateCode = SmsUtil.createIdentifycode();
        String templateParam = "{\"code\":\"" + templateCode + "\"}";
 
        // 发送短信
        SmsUtil.sendSms(userLogin.getUserPhone(), "SMS_134105057", templateParam);
 
        // 返回手机号和对应验证码
        IdentifyLogin identify = new IdentifyLogin();
        identify.setUserPhone(userLogin.getUserPhone());
        identify.setCode(templateCode);
 
        return JsonUtil.success(identify);
    }
 
    @PostMapping("/examinee/update/password")
    public JsonResult updatePasswByUserPhone(@RequestBody ExamineeEntity userInfo) {
 
        examineeService.updatePasswByUserPhone(userInfo);
        return JsonUtil.success();
    }
 
    @GetMapping("/examinee/get/balance/{userPhone}")
    public JsonResult getBalanceByUserPhone(@PathVariable String userPhone) {
        return JsonUtil.success(examineeService.getBalanceByUserPhone(userPhone));
    }
}
package com.njfu.bysj.oerts.controller;
 
import java.io.IOException;
import java.util.List;
 
import javax.servlet.http.HttpServletRequest;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import com.njfu.bysj.oerts.bean.CompleteRegistExam;
import com.njfu.bysj.oerts.bean.ExamineeRegistInfo;
import com.njfu.bysj.oerts.entity.ExamRegistrationEntity;
import com.njfu.bysj.oerts.entity.JsonResult;
import com.njfu.bysj.oerts.service.ExamRegistrationService;
import com.njfu.bysj.oerts.utils.JsonUtil;
 
import freemarker.template.TemplateException;
 
 
@RestController
public class ExamRegistrationController {
 
    @Autowired
    private ExamRegistrationService examRegistrationService;
 
    @PostMapping("/exam/registration/regist")
    public JsonResult examRegistByIdCardAndExamID(@RequestBody ExamRegistrationEntity regist,
            HttpServletRequest request) {
        if (examRegistrationService.examRegistByIdCardAndExamID(regist, request)) {
            return JsonUtil.success();
        } else {
            return JsonUtil.failed("报名失败");
        }
    }
 
    @GetMapping("/countregist/{examId}/{idCard}")
    public JsonResult countByIdCardAndExamID(@PathVariable String examId, @PathVariable String idCard) {
        if (examRegistrationService.countByIdCardAndExamID(examId, idCard)) {
            return JsonUtil.success();
        } else {
            return JsonUtil.failed("不能重复报名");
        }
    }
 
    @GetMapping("/testcompletelist/{idCard}")
    public JsonResult completeResgistList(@PathVariable String idCard) {
        return JsonUtil.success(examRegistrationService.completeResgistList(idCard));
    }
 
    @GetMapping("/registration/payList/{idCard}/{status}")
    public JsonResult getPayList(@PathVariable String idCard, @PathVariable String status) {
        return JsonUtil.success(examRegistrationService.getPayList(idCard, status));
    }
 
    @PostMapping("/registration/delete")
    public JsonResult deleteByIdCardAndExamID(@RequestBody ExamRegistrationEntity delete) {
        if (examRegistrationService.deleteByIdCardAndExamID(delete)) {
            return JsonUtil.success();
        } else {
            return JsonUtil.failed("删除失败");
        }
    }
 
    @GetMapping("/registration/score/{admissionTicket}")
    public JsonResult getScoreByAdmissionTicket(@PathVariable String admissionTicket) {
        CompleteRegistExam scoreEntity = examRegistrationService.getScoreByAdmissionTicket(admissionTicket);
        if (scoreEntity == null) {
            return JsonUtil.failed("没有对应数据");
        } else {
            return JsonUtil.success(scoreEntity);
        }
    }
 
    @GetMapping("/registration/score/list/{examId}")
    public JsonResult getScoreEntryListById(@PathVariable String examId) {
        return JsonUtil.success(examRegistrationService.getScoreEntryListById(examId));
    }
 
    @PostMapping("/registration/score/entry")
    public JsonResult entryScore(@RequestBody List<ExamineeRegistInfo> scoreInfo, HttpServletRequest request)
            throws IOException, TemplateException {
        return JsonUtil.success(examRegistrationService.entryScore(scoreInfo, request));
    }
 
    @PostMapping("/registration/pay/update")
    public JsonResult updatePayRegistration(@RequestBody CompleteRegistExam payInfo, HttpServletRequest request)
            throws IOException, TemplateException {
        examRegistrationService.updatePayRegistration(payInfo, request);
        return JsonUtil.success();
    }
 
    @GetMapping("/registration/info/{idCard}/{examId}")
    public JsonResult getCompleteResgistInfo(@PathVariable String idCard, @PathVariable String examId) {
        return JsonUtil.success(examRegistrationService.getCompleteResgistInfo(idCard, examId));
    }
}
 

  • 点赞
  • 收藏
  • 分享
  • 文章举报
MYQQ79856539 发布了10 篇原创文章 · 获赞 0 · 访问量 235 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐