package com.six.campuseventmanagementsystem.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.six.campuseventmanagementsystem.entity.*;
import com.six.campuseventmanagementsystem.mapper.*;
import com.six.campuseventmanagementsystem.service.LoginService;
import com.six.campuseventmanagementsystem.service.TimeService;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
@Service
public class LoginServiceImpl implements LoginService {
@Autowired
private UserMapper userMapper;
@Autowired
private SPAdminMapper spAdminMapper;
@Autowired
private AdminMapper adminMapper;
@Autowired
private VisitorMapper visitorMapper;
@Autowired
private HistoryMapper historyMapper;
@Autowired
private TimeService timeService;
//1天过期
private static int expire = 86400;
//32位密钥
private static String secret = "abcdfghiabcdfghiabcdfghiabcdfghi";
@Override
public String verify(String Account, String Password, String how, String ip){
QueryWrapper<User> UqueryWrapper = new QueryWrapper<>();
QueryWrapper<Admin> AqueryWrapper = new QueryWrapper<>();
QueryWrapper<SPAdmin> SqueryWrapper = new QueryWrapper<>();
QueryWrapper<Visitor> VqueryWrapper = new QueryWrapper<>();
UqueryWrapper.eq("Account",Account).eq("Password",Password);
AqueryWrapper.eq("Account",Account).eq("Password",Password);
SqueryWrapper.eq("Account",Account).eq("Password",Password);
VqueryWrapper.eq("Account", Account).eq("Password", Password);
History history = new History(Account, how, ip, timeService.getPresentlyTime());
User user = userMapper.selectOne(UqueryWrapper);
Admin admin = adminMapper.selectOne(AqueryWrapper);
SPAdmin spAdmin = spAdminMapper.selectOne(SqueryWrapper);
Visitor visitor = visitorMapper.selectOne(VqueryWrapper);
if(user != null&&user.getState().equals("Y")){
if(user.getUserType().equals("主办方")){
historyMapper.insert(history);
String organizer = "{\n" +
" \"code\": 20000,\n" +
" \"data\": {\n" +
" \"menu\": [\n" +
" {\n" +
" \"path\": \"/\",\n" +
" \"name\": \"home\",\n" +
" \"label\": \"首页\",\n" +
" \"icon\": \"s-home\",\n" +
" \"url\": \"home/index\"\n" +
" },\n" +
" {\n" +
" \"label\": \"赛事管理\",\n" +
" \"icon\": \"video-play\",\n" +
" \"path\": \"/match\",\n" +
" \"children\": [\n" +
" {\n" +
" \"path\": \"/activity\",\n" +
" \"name\": \"activity\",\n" +
" \"label\": \"赛事活动管理\",\n" +
" \"icon\": \"setting\",\n" +
" \"url\": \"match/activity.vue\"\n" +
" },\n" +
" {\n" +
" \"path\": \"/competitor\",\n" +
" \"name\": \"competitor\",\n" +
" \"label\": \"赛事选手管理\",\n" +
" \"icon\": \"setting\",\n" +
" \"url\": \"match/competitor.vue\"\n" +
" }\n" +
" ]\n" +
" }\n" +
" ],\n" +
" \"token\":" +"\""+generateToken(user.getID(), "主办方", user.getAccount())+"\""+","+
" \"message\": \"获取成功\"\n" +
" }\n" +
"}";
return organizer;
}
else if(user.getUserType().equals("赞助商")){
historyMapper.insert(history);
String sponsor = "{\n" +
" \"code\": 20000,\n" +
" \"data\": {\n" +
" \"menu\": [\n" +
" {\n" +
" \"path\": \"/\",\n" +
" \"name\": \"home\",\n" +
" \"label\": \"首页\",\n" +
" \"icon\": \"s-home\",\n" +
" \"url\": \"home/index\"\n" +
" },\n" +
" {\n" +
" \"label\": \"赞助管理\",\n" +
" \"icon\": \"location\",\n" +
" \"path\": \"/sponsor\",\n" +
" \"children\": [\n" +
" {\n" +
" \"path\": \"/ad\",\n" +
" \"name\": \"ad\",\n" +
" \"label\": \"广告信息管理\",\n" +
" \"icon\": \"setting\",\n" +
" \"url\": \"sponsor/ad.vue\"\n" +
" },\n" +
" {\n" +
" \"path\": \"/price\",\n" +
" \"name\": \"price\",\n" +
" \"label\": \"奖品信息管理\",\n" +
" \"icon\": \"setting\",\n" +
" \"url\": \"sponsor/price.vue\"\n" +
" }\n" +
" ]\n" +
" }\n" +
" ],\n" +
" \"token\":" +"\""+generateToken(user.getID(), "赞助商", user.getAccount()
)+"\""+","+
" \"message\": \"获取成功\"\n" +
" }\n" +
"}";
return sponsor;
}
else
return null;
}
else if(admin != null&&admin.getState().equals("Y")){
historyMapper.insert(history);
String ad = "{\n" +
" \"code\": 20000,\n" +
" \"data\": {\n" +
" \"menu\": [\n" +
" {\n" +
" \"path\": \"/home\",\n" +
" \"name\": \"home\",\n" +
" \"label\": \"首页\",\n" +
" \"icon\": \"s-home\",\n" +
" \"url\": \"home/index\"\n" +
" },\n" +
" {\n" +
" \"label\": \"赛事管理\",\n" +
" \"icon\": \"video-play\",\n" +
" \"path\": \"/match\",\n" +
" \"children\": [\n" +
" {\n" +
" \"path\": \"/activity\",\n" +
" \"name\": \"activity\",\n" +
" \"label\": \"赛事活动管理\",\n" +
" \"icon\": \"setting\",\n" +
"
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip 基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip 基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip 基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于Java开发的校园赛事活动管理系统源码+sql数据库(高分毕设).zip (313个子文件)
LoginServiceImpl.class 13KB
UserServiceImpl.class 11KB
VettingServiceImpl.class 10KB
SPAdminServiceImpl.class 10KB
AdsServiceImpl.class 9KB
PrizeServiceImpl.class 7KB
User.class 6KB
NoticeServiceImpl.class 6KB
Player.class 6KB
Admin.class 6KB
Prize.class 6KB
PrizeController.class 6KB
AdsController.class 6KB
MatchServiceImpl.class 5KB
Ads.class 5KB
CodeGenerator.class 5KB
VisitorServiceImpl.class 5KB
LoginController.class 4KB
UserController.class 4KB
SPAdminController.class 4KB
Match.class 4KB
PlayerServiceImpl.class 4KB
MatchController.class 4KB
PlayerController.class 4KB
Vetting.class 3KB
Notice.class 3KB
AdminController.class 3KB
Player2.class 3KB
StrNotice.class 3KB
SPAdmin.class 3KB
VettingController.class 2KB
Visitor.class 2KB
Swagger2Config.class 2KB
NoticeController.class 2KB
AdminServiceImpl.class 2KB
History.class 2KB
SPAdminService.class 2KB
VisitorController.class 2KB
PrizeMapper.class 2KB
AdsMapper.class 2KB
StrVetting.class 2KB
AdsService.class 1KB
MyBatisPlusConfig.class 1KB
WebMvcConfig.class 1KB
TimeServiceImpl.class 1KB
LoginService.class 1KB
PrizeService.class 1KB
UserService.class 1KB
VettingService.class 1KB
CampusEventManagementSystemApplication.class 920B
MatchService.class 809B
PlayerService.class 765B
NoticeService.class 751B
CampusEventManagementSystemApplicationTests.class 638B
VettingMapper.class 578B
NoticeMapper.class 574B
VisitorService.class 474B
HistoryMapper.class 430B
VisitorMapper.class 430B
SPAdminMapper.class 430B
Player2Mapper.class 430B
PlayerMapper.class 427B
AdminMapper.class 424B
MatchMapper.class 424B
UserMapper.class 421B
TimeService.class 307B
AdminService.class 262B
swagger-ui.css 142KB
swagger-ui.css 142KB
index.css 202B
index.css 202B
.gitignore 182B
oauth2-redirect.html 3KB
oauth2-redirect.html 3KB
index.html 734B
index.html 734B
CampusEventManagementSystem.iml 15KB
LoginServiceImpl.java 24KB
AdsServiceImpl.java 11KB
UserServiceImpl.java 11KB
PrizeServiceImpl.java 10KB
PrizeController.java 9KB
SPAdminServiceImpl.java 9KB
VettingServiceImpl.java 9KB
AdsController.java 8KB
User.java 6KB
Admin.java 5KB
NoticeServiceImpl.java 5KB
MatchServiceImpl.java 4KB
LoginController.java 4KB
StrNotice.java 4KB
PrizeService.java 4KB
UserController.java 4KB
Match.java 4KB
MatchController.java 3KB
SPAdminController.java 3KB
PlayerController.java 3KB
VisitorServiceImpl.java 3KB
PlayerServiceImpl.java 3KB
Vetting.java 3KB
共 313 条
- 1
- 2
- 3
- 4
资源评论
- ertyuighjkk2024-01-19总算找到了想要的资源,搞定遇到的大问题,赞赞赞!
- jvgbhjbvh2023-12-22资源和描述一致,质量不错,解决了我的问题,感谢资源主。onnx2024-01-19感谢您的认可和支持,谢谢好评
- 星珩2023-09-18资源是宝藏资源,实用也是真的实用,感谢大佬分享~onnx2024-01-19不客气
onnx
- 粉丝: 9584
- 资源: 5594
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- python005-基于Python爬虫的网络小说数据分析系统的设计与实现.zip
- vs2015 udp 广播 demo
- 创维42L20HW(8DA6)软件数据.rar
- gcc15交叉编译工具链windows版,用于编译龙芯应用,gcc version 15.0.0 20241119 (experimental) (GCC)
- python004-基于python的抑郁症患者看护系统.zip
- 基于TensorFlow2的图像分类模型训练预测项目(支持ResNet和MobileNet等主干网络,热力图生成、可视化模型).zip
- C语言程序设计-1-4章-课后习题答案(1).zip
- python003-python电影数据分析及可视化系统建设.zip
- gcc15交叉编译工具链windows版,支持32位和64位windows软件编译,gcc version 15.0.0 20241111 (experimental) (GCC)
- STM32汇编语言点亮led灯
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功