Compare commits

..

1 Commits
master ... zsb

Author SHA1 Message Date
fdzcxy212107135 e914bbda24 zsb
1 year ago

@ -9,9 +9,6 @@
<module name="CinemaManagerApi" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="springboot" target="21" />
</bytecodeTargetLevel>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="GrUnresolvedAccess" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
</profile>
</component>

@ -4,12 +4,12 @@
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="public" />

@ -4,7 +4,6 @@
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/springboot/pom.xml" />
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>

@ -1,8 +0,0 @@
package com.rabbiter.cm.common.config;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ApplicationConfiguration {
}

@ -1,40 +0,0 @@
package com.rabbiter.cm.common.config;
import com.rabbiter.cm.common.utils.PathUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.Collections;
@Configuration
public class CorsConfig implements WebMvcConfigurer {
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.setAllowedOriginPatterns(Collections.singletonList("*"));
config.addAllowedMethod("*");
config.addAllowedHeader("*");
config.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
return new CorsFilter(source);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
String path = PathUtils.getClassLoadRootPath() + "/images/";
//第一个方法设置访问路径前缀,第二个方法设置资源路径
registry.addResourceHandler("/images/**").
addResourceLocations("file:" + path);
WebMvcConfigurer.super.addResourceHandlers(registry);
}
}

@ -1,69 +0,0 @@
package com.rabbiter.cm.common.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.ExceptionSorter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.sql.SQLException;
import java.util.Properties;
/**
* Description
* Author:
* Date: 2024/2/26 23:39
**/
@Configuration
// 配置mybatis的扫描路径
@MapperScan("com.rabbiter.sms.dao")
public class DataSourceConfiguration {
@Value("${spring.datasource.driver-class-name}")
private String jdbcDriver;
@Value("${spring.datasource.druid.url}")
private String jdbcUrl;
@Value("${spring.datasource.druid.username}")
private String jdbcUsername;
@Value("${spring.datasource.druid.password}")
private String jdbcPassword;
@Bean(name="dataSource")
public DruidDataSource createDataSource() throws Exception {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setDriverClassName(jdbcDriver);
dataSource.setUrl(jdbcUrl);
dataSource.setUsername(jdbcUsername);
dataSource.setPassword(jdbcPassword);
// 关闭连接后不自动commit
dataSource.setDefaultAutoCommit(false);
// 设置连接异常处理
dataSource.setBreakAfterAcquireFailure(true);
// 将SQLException抛出重要配置
dataSource.setFailFast(true);
dataSource.setConnectionErrorRetryAttempts(0);
// 配置自定义的异常处理器
dataSource.setExceptionSorter(new CustomExceptionSorter());
// 关闭Druid连接池内部的异常处理
// dataSource.setFilters("stat");
return dataSource;
}
}
class CustomExceptionSorter implements ExceptionSorter {
@Override
public boolean isExceptionFatal(SQLException e) {
// 将所有异常视为致命异常,即抛出到上层
// 打印异常堆栈信息
e.printStackTrace();
return true;
}
@Override
public void configFromProperties(Properties properties) {
// 配置信息可以为空
}
}

@ -1,46 +0,0 @@
package com.rabbiter.cm.common.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;
import javax.servlet.ServletContext;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@Component
public class ProcessContextAware implements ServletContextAware {
@Value("${server.port}")
private String port;
@Override
public void setServletContext(ServletContext servletContext) {
try {
String os = System.getProperty("os.name").toLowerCase();
if (os.contains("win")) {
// Windows系统关闭占用指定端口的逻辑
ProcessBuilder processBuilder = new ProcessBuilder("cmd.exe", "/c", "netstat -ano | findstr " + port);
Process process = processBuilder.start();
InputStream inputStream = process.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = reader.readLine()) != null) {
String[] tokens = line.trim().split("\\s+");
String pid = tokens[tokens.length - 1];
ProcessBuilder killProcess = new ProcessBuilder("cmd.exe", "/c", "taskkill /F /PID " + pid);
killProcess.start();
}
} else if (os.contains("nix") || os.contains("nux") || os.contains("mac")) {
// Linux或Mac OS系统关闭占用指定端口的逻辑
ProcessBuilder processBuilder = new ProcessBuilder("/bin/bash", "-c", "lsof -ti:" + port + " | xargs kill -9");
processBuilder.start();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

@ -1,51 +0,0 @@
package com.rabbiter.cm.common.config;
import com.rabbiter.cm.common.utils.ApplicationContextUtils;
import com.rabbiter.cm.service.impl.SysBillServiceImpl;
import com.rabbiter.cm.service.impl.SysSessionServiceImpl;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.QuartzJobBean;
import java.text.SimpleDateFormat;
import java.util.Date;
@Configuration
public class QuartzConfig {
@Autowired
private SysBillServiceImpl sysBillService;
@Autowired
private SysSessionServiceImpl sysSessionService;
@Bean
public JobDetail jobDetail() {
QuartzJobBean quartzJob = new QuartzJobBean() {
@Override
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("执行取消超时订单处理" + sdf.format(new Date()));
// 取消所有超时订单并释放占座资源
ApplicationContextUtils.getBean("cancelTimeoutBill");
}
};
return JobBuilder.newJob(quartzJob.getClass()).storeDurably().build();
}
@Bean
public SimpleTrigger trigger() {
//每5分钟执行一次一直重复执行
SimpleScheduleBuilder scheduleBuilder =
SimpleScheduleBuilder.simpleSchedule()
.withIntervalInSeconds(5 * 60)
.repeatForever();
return TriggerBuilder.newTrigger()
.forJob(jobDetail())
.withSchedule(scheduleBuilder).build();
}
}

@ -1,87 +0,0 @@
package com.rabbiter.cm.common.config;
import com.rabbiter.cm.shiro.JwtFilter;
import com.rabbiter.cm.shiro.realms.CustomerRealm;
import org.apache.shiro.mgt.DefaultSessionStorageEvaluator;
import org.apache.shiro.mgt.DefaultSubjectDAO;
import org.apache.shiro.realm.Realm;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Filter;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* shiro
*/
@Configuration
public class ShiroConfig {
// 创建shiroFilter
@Bean("shiroFilter")
public ShiroFilterFactoryBean getShiroFilterFactoryBean(DefaultWebSecurityManager defaultWebSecurityManager) {
ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
// 给shiroFilter设置安全管理器
shiroFilterFactoryBean.setSecurityManager(defaultWebSecurityManager);
// 配置受限资源
Map<String, String> map = new LinkedHashMap<>();
// 放行注册和登录
map.put("/sysUser/register", "anon");
map.put("/sysUser/login", "anon");
// 放行图片查询
map.put("/images/**", "anon");
// 请求这个资源需要认证与授权
map.put("/sysCinema/update", "jwt");
// 放行影院查询请求
map.put("/sysCinema/**", "anon");
// 放行电影查找相关请求
map.put("/sysMovie/find/**", "anon");
// 放行电影类别查找相关请求
map.put("/sysMovieCategory/find/**", "anon");
// 放行电影场次查找相关请求
map.put("/sysSession/find/**", "anon");
// 请求这个资源需要认证与授权
map.put("/**", "jwt");
// 添加自己的过滤器并且取名为jwt
Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
filterMap.put("jwt", new JwtFilter());
shiroFilterFactoryBean.setFilters(filterMap);
//设置认证规则
shiroFilterFactoryBean.setFilterChainDefinitionMap(map);
return shiroFilterFactoryBean;
}
//创建安全管理器
@Bean
public DefaultWebSecurityManager getDefaultWebSecurityManager(Realm realm) {
DefaultWebSecurityManager defaultWebSecurityManager = new DefaultWebSecurityManager();
//给安全管理器设置realm
defaultWebSecurityManager.setRealm(realm);
//关闭shiro自带的session使得不保存登录状态每次使用token进行验证
DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO();
DefaultSessionStorageEvaluator defaultSessionStorageEvaluator = new DefaultSessionStorageEvaluator();
defaultSessionStorageEvaluator.setSessionStorageEnabled(false);
subjectDAO.setSessionStorageEvaluator(defaultSessionStorageEvaluator);
defaultWebSecurityManager.setSubjectDAO(subjectDAO);
return defaultWebSecurityManager;
}
//创建自定义realm
@Bean(name = "realm")
public Realm getRealm() {
CustomerRealm realm = new CustomerRealm();
return realm;
}
}

@ -1,28 +0,0 @@
package com.rabbiter.cm.common.constant;
/**
* Http
*/
public class HttpStatus {
/**
*
*/
public static final int SUCCESS = 200;
public static final int BAD_REQUEST = 400;
/**
* 访
*/
public static final int FORBIDDEN = 403;
/**
*
*/
public static final int NOT_FOUND = 404;
/**
*
*/
public static final int ERROR = 500;
}

@ -1,14 +0,0 @@
package com.rabbiter.cm.common.constant;
public class MovieRankingList {
public static final String[] listNames = new String[3];
static {
listNames[0] = "totalBoxOfficeList";
listNames[1] = "domesticBoxOfficeList";
listNames[2] = "foreignBoxOfficeList";
}
}

@ -1,15 +0,0 @@
package com.rabbiter.cm.common.exception;
public class DataNotFoundException extends RuntimeException {
static final long serialVersionUID = -7034897190745456227L;
public DataNotFoundException() {
super();
}
public DataNotFoundException(String message) {
super(message);
}
}

@ -1,17 +0,0 @@
package com.rabbiter.cm.common.exception;
/**
*
*/
public class FileNameLengthLimitExceededException extends RuntimeException {
private static final long serialVersionUID = 1L;
public FileNameLengthLimitExceededException() {
}
public FileNameLengthLimitExceededException(String message) {
super(message);
}
}

@ -1,17 +0,0 @@
package com.rabbiter.cm.common.exception;
/**
*
*/
public class FileSizeLimitExceededException extends RuntimeException {
private static final long serialVersionUID = 1L;
public FileSizeLimitExceededException() {
}
public FileSizeLimitExceededException(String message) {
super(message);
}
}

@ -1,37 +0,0 @@
package com.rabbiter.cm.common.exception;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
@ControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler(value = Exception.class)
@ResponseBody
public ResponseEntity<String> handleException(Exception e) {
// 自定义异常处理逻辑
String message = e.getMessage();
e.printStackTrace();
if (message.contains("(using password: YES)")) {
if (!message.contains("'root'@'")) {
message = "PU Request failed with status code 500";
} else if (message.contains("'root'@'localhost'")) {
message = "P Request failed with status code 500";
}
} else if(message.contains("Table") && message.contains("doesn't exist")) {
message = "T Request failed with status code 500";
} else if (message.contains("Unknown database")) {
message = "U Request failed with status code 500";
} else if (message.contains("edis")) {
message = "R Request failed with status code 500";
} else if (message.contains("Failed to obtain JDBC Connection")) {
message = "C Request failed with status code 500";
} else if (message.contains("SQLSyntaxErrorException")) {
message = "S Request failed with status code 500";
}
return new ResponseEntity<>(message, HttpStatus.INTERNAL_SERVER_ERROR);
}
}

@ -1,17 +0,0 @@
package com.rabbiter.cm.common.exception;
/**
*
*/
public class InvalidExtensionException extends RuntimeException {
private static final long serialVersionUID = 1L;
public InvalidExtensionException() {
}
public InvalidExtensionException(String message) {
super(message);
}
}

@ -1,206 +0,0 @@
package com.rabbiter.cm.common.file;
import com.rabbiter.cm.common.exception.FileNameLengthLimitExceededException;
import com.rabbiter.cm.common.exception.FileSizeLimitExceededException;
import com.rabbiter.cm.common.exception.InvalidExtensionException;
import com.rabbiter.cm.common.utils.PathUtils;
import com.rabbiter.cm.common.utils.StringUtil;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.UUID;
/**
*
*/
public class FileUploadUtils {
/**
* 50M
*/
public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
/**
* 100
*/
public static final int DEFAULT_FILE_NAME_LENGTH = 100;
/**
*
*/
private static final String parentPath = PathUtils.getClassLoadRootPath() + "/images";
public static final String actorPath = "/actor";
public static final String cinemaPath = "/cinema";
public static final String moviePath = "/movie";
public static final String userPath = "/user";
/**
*
*/
private static String defaultBaseDir = userPath;
public static void setDefaultBaseDir(String defaultBaseDir) {
FileUploadUtils.defaultBaseDir = defaultBaseDir;
}
public static String getDefaultBaseDir() {
return defaultBaseDir;
}
public static String getParentPath() {
return parentPath;
}
/**
*
*
* @param file
* @return
* @throws Exception
*/
public static final String upload(MultipartFile file) throws IOException {
try {
return upload(getParentPath() + getDefaultBaseDir(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
} catch (Exception e) {
throw new IOException(e.getMessage(), e);
}
}
/**
*
*
* @param baseDir
* @param file
* @param allowedExtension
* @return
* @throws FileSizeLimitExceededException
* @throws FileNameLengthLimitExceededException
* @throws IOException
* @throws InvalidExtensionException
*/
public static final String upload(String baseDir, MultipartFile file, String[] allowedExtension)
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
InvalidExtensionException {
int fileNamelength = file.getOriginalFilename().length();
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH) {
throw new FileNameLengthLimitExceededException("文件名称长度不能超过" + FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
}
assertAllowed(file, allowedExtension);
String fileName = extractFilename(file);
File desc = getAbsoluteFile(baseDir, fileName);
file.transferTo(desc);
String pathFileName = getPathFileName(baseDir, fileName);
return pathFileName;
}
/**
* : images/user/2021/3/4/***.png
*/
public static final String extractFilename(MultipartFile file) {
String fileName = file.getOriginalFilename();
String extension = getExtension(file);
fileName = DateFormatUtils.format(new Date(), "yyyy/MM/dd") + "/" + UUID.randomUUID().toString().replaceAll("-", "") + "." + extension;
return fileName;
}
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException {
File desc = new File(uploadDir + File.separator + fileName);
if (!desc.getParentFile().exists()) {
desc.getParentFile().mkdirs();
}
if (!desc.exists()) {
desc.createNewFile();
}
return desc;
}
private static final String getPathFileName(String uploadDir, String fileName) throws IOException {
int dirLastIndex = parentPath.length() + 1;
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
String pathFileName = "/images/" + currentDir + "/" + fileName;
return pathFileName;
}
/**
*
*
* @param file
* @return
* @throws FileSizeLimitExceededException
* @throws InvalidExtensionException
*/
public static final void assertAllowed(MultipartFile file, String[] allowedExtension)
throws FileSizeLimitExceededException, InvalidExtensionException {
long size = file.getSize();
if (DEFAULT_MAX_SIZE != -1 && size > DEFAULT_MAX_SIZE) {
throw new FileSizeLimitExceededException("文件大小不能超过" + DEFAULT_MAX_SIZE / 1024 / 1024 + "MB");
}
String fileName = file.getOriginalFilename();
String extension = getExtension(file);
if (allowedExtension != null && !isAllowedExtension(extension, allowedExtension)) {
if (allowedExtension == MimeTypeUtils.IMAGE_EXTENSION) {
throw new InvalidExtensionException("图片格式不支持" + extension + "格式");
}
}
}
/**
* MIMEMIME
*
* @param extension
* @param allowedExtension
* @return
*/
public static final boolean isAllowedExtension(String extension, String[] allowedExtension) {
for (String str : allowedExtension) {
if (str.equalsIgnoreCase(extension)) {
return true;
}
}
return false;
}
/**
*
*
* @param file
* @return
*/
public static final String getExtension(MultipartFile file) {
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
if (!StringUtil.isNotEmpty(extension)) {
extension = MimeTypeUtils.getExtension(file.getContentType());
}
return extension;
}
/**
*
*
* @param filePath
* @return
*/
public static boolean deleteFile(String filePath) {
boolean flag = false;
File file = new File(filePath);
// 路径为文件且不为空则进行删除
if (file.isFile() && file.exists()) {
file.delete();
flag = true;
}
return flag;
}
}

@ -1,39 +0,0 @@
package com.rabbiter.cm.common.file;
/**
*
*/
public class MimeTypeUtils {
public static final String IMAGE_PNG = "image/png";
public static final String IMAGE_JPG = "image/jpg";
public static final String IMAGE_JPEG = "image/jpeg";
public static final String IMAGE_BMP = "image/bmp";
public static final String IMAGE_GIF = "image/gif";
public static final String[] IMAGE_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
public static final String[] DEFAULT_ALLOWED_EXTENSION = {"bmp", "gif", "jpg", "jpeg", "png"};
public static String getExtension(String prefix) {
switch (prefix) {
case IMAGE_PNG:
return "png";
case IMAGE_JPG:
return "jpg";
case IMAGE_JPEG:
return "jpeg";
case IMAGE_BMP:
return "bmp";
case IMAGE_GIF:
return "gif";
default:
return "";
}
}
}

@ -1,64 +0,0 @@
package com.rabbiter.cm.common.page;
import com.rabbiter.cm.common.utils.StringUtil;
/**
*
*/
public class Page {
//页码
private Integer pageNum = 1;
//页大小
private Integer pageSize = 1000;
//按列排序
private String orderByColumn;
//升序还是降序,"asc"表示升序(默认)、"desc"表示降序
private String isAsc = "asc";
public Integer getPageNum() {
return pageNum;
}
public void setPageNum(Integer pageNum) {
this.pageNum = pageNum;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
/**
* isAscorderby
*
* @return
*/
public String getOrderByColumn() {
if (!StringUtil.isNotEmpty(orderByColumn)) {
return "";
}
return orderByColumn + " " + isAsc;
}
public void setOrderByColumn(String orderByColumn) {
this.orderByColumn = orderByColumn;
}
public String getIsAsc() {
return isAsc;
}
public void setIsAsc(String isAsc) {
if (StringUtil.isNotEmpty(isAsc)) {
this.isAsc = isAsc;
}
}
}

@ -1,47 +0,0 @@
package com.rabbiter.cm.common.page;
import com.rabbiter.cm.common.utils.ServletUtil;
import com.rabbiter.cm.common.utils.StringUtil;
import javax.servlet.http.HttpServletRequest;
/**
* ServletUtilController
*/
public class PageBuilder {
//当前页码
public static final String PAGE_NUM = "pageNum";
//页大小
public static final String PAGE_SIZE = "pageSize";
//总记录数
public static final String TOTAL = "total";
//按列排序
public static final String ORDER_BY_COLUMN = "orderByColumn";
//升序还是降序
public static final String IS_ASC = "isAsc";
public static Page buildPage() {
Page page = new Page();
HttpServletRequest request = ServletUtil.getRequest();
String pageNum = request.getParameter(PAGE_NUM);
if (StringUtil.isNotEmpty(pageNum)) {
page.setPageNum(Integer.parseInt(pageNum));
}
String pageSize = request.getParameter(PAGE_SIZE);
if (StringUtil.isNotEmpty(pageSize)) {
page.setPageSize(Integer.parseInt(pageSize));
}
page.setIsAsc(request.getParameter(IS_ASC));
page.setOrderByColumn(StringUtil.toUnderScoreCase(request.getParameter(ORDER_BY_COLUMN)));
return page;
}
}

@ -1,111 +0,0 @@
package com.rabbiter.cm.common.response;
import com.rabbiter.cm.common.constant.HttpStatus;
import java.util.HashMap;
/**
* 使Map
*/
public class ResponseResult extends HashMap<String, Object> {
private static final long serialVersionUID = 1L;
//状态码的key
private static final String CODE = "code";
//操作结果信息key
private static final String MESSAGE = "msg";
//返回数据的key
private static final String DATA = "data";
/**
*
*/
public ResponseResult() {
}
/**
*
*
* @param code
* @param msg
*/
public ResponseResult(int code, String msg) {
super.put(CODE, code);
super.put(MESSAGE, msg);
}
/**
*
*
* @param code
* @param msg
* @param data
*/
public ResponseResult(int code, String msg, Object data) {
super.put(CODE, code);
super.put(MESSAGE, msg);
if (data != null) {
super.put(DATA, data);
}
}
/* 返回成功消息 */
public static ResponseResult success() {
return success("操作成功");
}
public static ResponseResult success(String msg) {
return success(msg, null);
}
public static ResponseResult success(Object data) {
return success("操作成功", data);
}
/**
*
*
* @param msg
* @param data
* @return
*/
public static ResponseResult success(String msg, Object data) {
return new ResponseResult(HttpStatus.SUCCESS, msg, data);
}
/* 返回错误消息 */
public static ResponseResult error() {
return error("操作失败");
}
public static ResponseResult error(String msg) {
return error(msg, null);
}
/**
*
*
* @param code
* @param msg
* @return
*/
public static ResponseResult error(int code, String msg) {
return new ResponseResult(code, msg, null);
}
/**
* (500)
*
* @param msg
* @param data
* @return
*/
public static ResponseResult error(String msg, Object data) {
return new ResponseResult(HttpStatus.ERROR, msg, data);
}
}

@ -1,25 +0,0 @@
package com.rabbiter.cm.common.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* SpringgetBean
*/
@Component
public class ApplicationContextUtils implements ApplicationContextAware {
private static ApplicationContext context;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
context = applicationContext;
}
public static Object getBean(String beanName) {
return context.getBean(beanName);
}
}

@ -1,97 +0,0 @@
package com.rabbiter.cm.common.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.rabbiter.cm.common.exception.DataNotFoundException;
import com.rabbiter.cm.domain.SysBill;
import com.rabbiter.cm.domain.SysSession;
import com.rabbiter.cm.service.impl.SysBillServiceImpl;
import com.rabbiter.cm.service.impl.SysSessionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@Component
public class CancelTimeoutBillUtil {
@Autowired
private SysBillServiceImpl sysBillService;
@Autowired
private SysSessionServiceImpl sysSessionService;
/**
*
*/
@Bean(name = "cancelTimeoutBill")
public void canelTimeoutBill() {
// 查询所有未支付且超时的订单
List<SysBill> timeoutBillList = null;
try {
timeoutBillList = sysBillService.findTimeoutBill();
} catch (Exception e) {
e.printStackTrace();
timeoutBillList = new ArrayList<>();
}
// Lamda循环遍历、处理超时订单
timeoutBillList.forEach((timeoutBill) -> {
// 更新订单取消状态
timeoutBill.setCancelState(true);
// 更新订单信息
sysBillService.updateBill(timeoutBill);
SysSession curSession = timeoutBill.getSysSession();
if (curSession == null) {
throw new DataNotFoundException("场次不存在");
}
System.out.println(curSession.getSessionSeats());
// 获取当前超时订单座位信息
String[] selectSeats = timeoutBill.getSeats().split(",");
// 取消的订单座位数
int cancelSallNums = selectSeats.length;
curSession.setSallNums(curSession.getSallNums() - cancelSallNums);
System.out.println(selectSeats.length);
// 超时订单已选座位
Map<String, Integer> selectedSeatsMap = new LinkedHashMap<>();
for (int i = 0; i < selectSeats.length; i++) {
String row = selectSeats[i].substring(selectSeats[i].indexOf("\"") + 1, selectSeats[i].indexOf("排"));
Integer col = Integer.parseInt(selectSeats[i].substring(selectSeats[i].indexOf("排") + 1, selectSeats[i].indexOf("座")));
selectedSeatsMap.put(row, col);
}
// 显示已选座位坐标
selectedSeatsMap.forEach((key, value) -> {
System.out.println("key = " + key + " value=" + value);
});
// 取消场次座位占座
String newSessionSeats = cancelTimeoutBillSessionSeats(curSession.getSessionSeats(), selectedSeatsMap);
curSession.setSessionSeats(newSessionSeats);
sysSessionService.updateSession(curSession);
});
}
/**
*
*
* @param curSessionSeats
* @param selectedSeatsMap
* @return
*/
public static String cancelTimeoutBillSessionSeats(String curSessionSeats, Map<String, Integer> selectedSeatsMap) {
JSONObject curSessionSeatsJSON = JSONObject.parseObject(curSessionSeats);
Map<String, Object> valueMap = new LinkedHashMap<>();
valueMap.putAll(curSessionSeatsJSON);
valueMap.forEach((key, value) -> System.out.println("\"" + key + "\":" + " " + value));
// 取消选座
selectedSeatsMap.forEach((index, value) -> {
((JSONArray) valueMap.get(index)).set(value - 1, 0);
});
JSONObject newSessionSeatsJSON = new JSONObject(valueMap);
return JSONObject.toJSONString(newSessionSeatsJSON);
}
}

@ -1,88 +0,0 @@
package com.rabbiter.cm.common.utils;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.exceptions.JWTDecodeException;
import com.auth0.jwt.interfaces.DecodedJWT;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
/**
* token
*/
public class JwtUtil {
static Logger log = LoggerFactory.getLogger(JwtUtil.class);
/**
* JWT EXPIRE_TIME
*/
private static final long EXPIRE_TIME = 60 * 60 * 1000;
/**
* token
*
* @param token
* @param secret
* @return
*/
public static boolean verify(String token, String username, String secret) {
try {
//根据密码生成JWT效验器
Algorithm algorithm = Algorithm.HMAC256(secret);
JWTVerifier verifier = JWT.require(algorithm)
.withClaim("username", username)
.build();
//效验TOKEN
DecodedJWT jwt = verifier.verify(token);
log.info("登录验证成功!");
return true;
} catch (Exception exception) {
log.error("JwtUtil登录验证失败!");
return false;
}
}
/**
* tokensecret
*
* @return token
*/
public static String getUsername(String token) {
try {
DecodedJWT jwt = JWT.decode(token);
return jwt.getClaim("username").asString();
} catch (JWTDecodeException e) {
return null;
}
}
/**
* tokenEXPIRE_TIME
*
* @param username
* @param secret
* @return token
*/
public static String sign(String username, String secret) {
Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME);
Algorithm algorithm = Algorithm.HMAC256(secret);
// 附带username信息
return JWT.create()
.withClaim("username", username)
.withExpiresAt(date)
.sign(algorithm);
}
public static void main(String[] args) {
/**
* token
* eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MDc0ODI5OTYsInVzZXJuYW1lIjoi5ZGo5YWrIn0.UP6kFC0BofuX7FLoPDMWCQno-NhVuYA0NlQG8xgt2Rc
*/
String sign = sign("周八", "f93643c0eacc54a5ee1783744466ab9e");
log.warn("测试生成一个token\n" + sign);
}
}

@ -1,30 +0,0 @@
package com.rabbiter.cm.common.utils;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
public class PathUtils {
public static String getClassLoadRootPath() {
String path = "";
try {
String prePath = URLDecoder.decode(PathUtils.class.getClassLoader().getResource("").getPath(),"utf-8").replace("/target/classes", "");
String osName = System.getProperty("os.name");
if (osName.toLowerCase().startsWith("mac")) {
// 苹果
path = prePath.substring(0, prePath.length() - 1);
} else if (osName.toLowerCase().startsWith("windows")) {
// windows
path = prePath.substring(1, prePath.length() - 1);
} else if(osName.toLowerCase().startsWith("linux") || osName.toLowerCase().startsWith("unix")) {
// unix or linux
path = prePath.substring(0, prePath.length() - 1);
} else {
path = prePath.substring(1, prePath.length() - 1);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return path;
}
}

@ -1,25 +0,0 @@
package com.rabbiter.cm.common.utils;
import java.util.Random;
/**
*
*/
public class SaltUtils {
public static String getSalt(int n) {
//返回长度为n的随机盐
StringBuilder sb = new StringBuilder();
char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()".toCharArray();
for (int i = 0; i < n; i++) {
char c = chars[new Random().nextInt(chars.length)];
sb.append(c);
}
return sb.toString();
}
public static void main(String[] args) {
System.out.println(getSalt(8));
}
}

@ -1,51 +0,0 @@
package com.rabbiter.cm.common.utils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* 线
*/
public class ServletUtil {
/**
*
*
* @return
*/
public static ServletRequestAttributes getAttributes() {
return (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
}
/**
* request
*
* @return
*/
public static HttpServletRequest getRequest() {
return getAttributes().getRequest();
}
/**
* response
*
* @return
*/
public static HttpServletResponse getResponse() {
return getAttributes().getResponse();
}
/**
* session
*
* @return
*/
public static HttpSession getSession() {
return getRequest().getSession();
}
}

@ -1,47 +0,0 @@
package com.rabbiter.cm.common.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @description:
* @author:
* @create: 2024-06-02 15:59
*/
public class SessionSeatsUtil {
/**
* @param curSessionSeats
* @param selectSeats
* @return
*/
public static String changeSessionSeats(String curSessionSeats, String selectSeats) {
JSONObject curSessionSeatsJSON = JSONObject.parseObject(curSessionSeats);
// 超时订单已选座位
Map<String, Integer> selectedSeatsMap = new LinkedHashMap<>();
// 获取当前超时订单座位信息
String[] selectedSeats = selectSeats.split(",");
for (int i = 0; i < selectedSeats.length; i++) {
String row = selectedSeats[i].substring(selectedSeats[i].indexOf("\"") + 1, selectedSeats[i].indexOf("排"));
Integer col = Integer.parseInt(selectedSeats[i].substring(selectedSeats[i].indexOf("排") + 1, selectedSeats[i].indexOf("座")));
selectedSeatsMap.put(row, col);
}
// 显示已选座位坐标
selectedSeatsMap.forEach((key, value) -> {
System.out.println("key = " + key + " value=" + value);
});
Map<String, Object> valueMap = new LinkedHashMap<>();
valueMap.putAll(curSessionSeatsJSON);
valueMap.forEach((key, value) -> System.out.println("\"" + key + "\":" + " " + value));
// 取消选座
selectedSeatsMap.forEach((index, value) -> {
((JSONArray) valueMap.get(index)).set(value - 1, 0);
});
JSONObject newSessionSeatsJSON = new JSONObject(valueMap);
return JSONObject.toJSONString(newSessionSeatsJSON);
}
}

@ -1,38 +0,0 @@
package com.rabbiter.cm.common.utils;
/**
*
*/
public class StringUtil {
/**
* val(null/"")
*
* @param val
* @return
*/
public static boolean isNotEmpty(String val) {
return val != null && !"".equals(val);
}
/**
* 线
*
* @param val
* @return
*/
public static String toUnderScoreCase(String val) {
if (!isNotEmpty(val)) {
return val;
}
StringBuilder sb = new StringBuilder(val);
for (int i = 0; i < sb.length(); i++) {
if (sb.charAt(i) >= 'A' && sb.charAt(i) <= 'Z') {
//将大写字母 "A" 替换为 "_a"
sb.replace(i, i + 1, "_" + (char) (sb.charAt(i) + 32));
}
}
return sb.toString();
}
}

@ -1,84 +0,0 @@
package com.rabbiter.cm.domain;
import java.io.Serializable;
import java.util.Objects;
/**
*
*/
public class LoginUser implements Serializable {
//登录的用户信息
private SysUser sysUser;
//用户管理的影院id
private Long cinemaId;
//用户管理的影院名称
private String cinemaName;
//系统颁发的token
private String token;
public LoginUser() {
}
public LoginUser(SysUser sysUser, Long cinemaId, String cinemaName, String token) {
this.sysUser = sysUser;
this.cinemaId = cinemaId;
this.cinemaName = cinemaName;
this.token = token;
}
@Override
public String toString() {
return "LoginUser{" +
"sysUser=" + sysUser +
", cinemaId=" + cinemaId +
", cinemaName='" + cinemaName + '\'' +
", token='" + token + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
LoginUser loginUser = (LoginUser) o;
return Objects.equals(sysUser, loginUser.sysUser) && Objects.equals(cinemaId, loginUser.cinemaId) && Objects.equals(cinemaName, loginUser.cinemaName) && Objects.equals(token, loginUser.token);
}
@Override
public int hashCode() {
return Objects.hash(sysUser, cinemaId, cinemaName, token);
}
public SysUser getSysUser() {
return sysUser;
}
public void setSysUser(SysUser sysUser) {
this.sysUser = sysUser;
}
public Long getCinemaId() {
return cinemaId;
}
public void setCinemaId(Long cinemaId) {
this.cinemaId = cinemaId;
}
public String getCinemaName() {
return cinemaName;
}
public void setCinemaName(String cinemaName) {
this.cinemaName = cinemaName;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}

@ -1,230 +0,0 @@
package com.rabbiter.cm.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
/**
*
*/
public class SysBill implements Serializable {
private static final Long serialVersionUID = 1L;
private Long billId;
//订单状态0表示未支付1表示已完成
private Boolean payState;
//下订单的用户id
@NotNull(message = "下订单用户不能为空")
private Long userId;
//订单所属的场次
@NotNull(message = "订单所属场次不能为空")
private Long sessionId;
//订单的座位1排10号、A排5号
@NotBlank(message = "订单所选座位不能为空")
private String seats;
private Boolean cancelState;
private Boolean cancelRole;
private Date createTime;
private Date deadline;
private Date cancelTime;
// 用户名作模糊查询条件
private String queryByUserName;
// 管理员操作识别,及备注内容。管理员操作点单,或添加或修改,必须要填写备注信息,购票子系统不需要填写,并清空
private String remark;
// 删除状态1删除0未删除
private Boolean delState;
//多表连接
private SysSession sysSession;
private SysUser sysUser;
public SysBill() {
}
public SysBill(Long billId, Boolean payState, Long userId, Long sessionId, String seats, Boolean cancelState, Boolean cancelRole, Date createTime, Date deadline, Date cancelTime, String queryByUserName, String remark, Boolean delState, SysSession sysSession, SysUser sysUser) {
this.billId = billId;
this.payState = payState;
this.userId = userId;
this.sessionId = sessionId;
this.seats = seats;
this.cancelState = cancelState;
this.cancelRole = cancelRole;
this.createTime = createTime;
this.deadline = deadline;
this.cancelTime = cancelTime;
this.queryByUserName = queryByUserName;
this.remark = remark;
this.delState = delState;
this.sysSession = sysSession;
this.sysUser = sysUser;
}
public Long getBillId() {
return billId;
}
public void setBillId(Long billId) {
this.billId = billId;
}
public Boolean getPayState() {
return payState;
}
public void setPayState(Boolean payState) {
this.payState = payState;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getSessionId() {
return sessionId;
}
public void setSessionId(Long sessionId) {
this.sessionId = sessionId;
}
public String getSeats() {
return seats;
}
public void setSeats(String seats) {
this.seats = seats;
}
public Boolean getCancelState() {
return cancelState;
}
public void setCancelState(Boolean cancelState) {
this.cancelState = cancelState;
}
public Boolean getCancelRole() {
return cancelRole;
}
public void setCancelRole(Boolean cancelRole) {
this.cancelRole = cancelRole;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getDeadline() {
return deadline;
}
public void setDeadline(Date deadline) {
this.deadline = deadline;
}
public Date getCancelTime() {
return cancelTime;
}
public void setCancelTime(Date cancelTime) {
this.cancelTime = cancelTime;
}
public String getQueryByUserName() {
return queryByUserName;
}
public void setQueryByUserName(String queryByUserName) {
this.queryByUserName = queryByUserName;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Boolean getDelState() {
return delState;
}
public void setDelState(Boolean delState) {
this.delState = delState;
}
public SysSession getSysSession() {
return sysSession;
}
public void setSysSession(SysSession sysSession) {
this.sysSession = sysSession;
}
public SysUser getSysUser() {
return sysUser;
}
public void setSysUser(SysUser sysUser) {
this.sysUser = sysUser;
}
@Override
public String toString() {
return "SysBill{" +
"billId=" + billId +
", payState=" + payState +
", userId=" + userId +
", sessionId=" + sessionId +
", seats='" + seats + '\'' +
", cancelState=" + cancelState +
", cancelRole=" + cancelRole +
", createTime=" + createTime +
", deadline=" + deadline +
", cancelTime=" + cancelTime +
", queryByUserName='" + queryByUserName + '\'' +
", remark='" + remark + '\'' +
", delState=" + delState +
", sysSession=" + sysSession +
", sysUser=" + sysUser +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysBill sysBill = (SysBill) o;
return Objects.equals(billId, sysBill.billId) && Objects.equals(payState, sysBill.payState) && Objects.equals(userId, sysBill.userId) && Objects.equals(sessionId, sysBill.sessionId) && Objects.equals(seats, sysBill.seats) && Objects.equals(cancelState, sysBill.cancelState) && Objects.equals(cancelRole, sysBill.cancelRole) && Objects.equals(createTime, sysBill.createTime) && Objects.equals(deadline, sysBill.deadline) && Objects.equals(cancelTime, sysBill.cancelTime) && Objects.equals(queryByUserName, sysBill.queryByUserName) && Objects.equals(remark, sysBill.remark) && Objects.equals(delState, sysBill.delState) && Objects.equals(sysSession, sysBill.sysSession) && Objects.equals(sysUser, sysBill.sysUser);
}
@Override
public int hashCode() {
return Objects.hash(billId, payState, userId, sessionId, seats, cancelState, cancelRole, createTime, deadline, cancelTime, queryByUserName, remark, delState, sysSession, sysUser);
}
}

@ -1,149 +0,0 @@
package com.rabbiter.cm.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
public class SysCinema implements Serializable {
private final static Long serialVersionUID = 1L;
private Long cinemaId;
@NotBlank(message = "影院名称不能为空")
private String cinemaName;
private String hallCategoryList;
private String cinemaPicture;
private String cinemaAddress;
private String cinemaPhone;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "HH:mm")
private String workStartTime;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "HH:mm")
private String workEndTime;
//当前影院上映的所有电影规则上映的电影指包括今天在内未来5天有安排目标影片的场次
private List<SysMovie> sysMovieList;
public SysCinema() {
}
public SysCinema(Long cinemaId, String cinemaName, String hallCategoryList, String cinemaPicture, String cinemaAddress, String cinemaPhone, String workStartTime, String workEndTime, List<SysMovie> sysMovieList) {
this.cinemaId = cinemaId;
this.cinemaName = cinemaName;
this.hallCategoryList = hallCategoryList;
this.cinemaPicture = cinemaPicture;
this.cinemaAddress = cinemaAddress;
this.cinemaPhone = cinemaPhone;
this.workStartTime = workStartTime;
this.workEndTime = workEndTime;
this.sysMovieList = sysMovieList;
}
public Long getCinemaId() {
return cinemaId;
}
public void setCinemaId(Long cinemaId) {
this.cinemaId = cinemaId;
}
public String getCinemaName() {
return cinemaName;
}
public void setCinemaName(String cinemaName) {
this.cinemaName = cinemaName;
}
public String getHallCategoryList() {
return hallCategoryList;
}
public void setHallCategoryList(String hallCategoryList) {
this.hallCategoryList = hallCategoryList;
}
public String getCinemaPicture() {
return cinemaPicture;
}
public void setCinemaPicture(String cinemaPicture) {
this.cinemaPicture = cinemaPicture;
}
public String getCinemaAddress() {
return cinemaAddress;
}
public void setCinemaAddress(String cinemaAddress) {
this.cinemaAddress = cinemaAddress;
}
public String getCinemaPhone() {
return cinemaPhone;
}
public void setCinemaPhone(String cinemaPhone) {
this.cinemaPhone = cinemaPhone;
}
public String getWorkStartTime() {
return workStartTime;
}
public void setWorkStartTime(String workStartTime) {
this.workStartTime = workStartTime;
}
public String getWorkEndTime() {
return workEndTime;
}
public void setWorkEndTime(String workEndTime) {
this.workEndTime = workEndTime;
}
public List<SysMovie> getSysMovieList() {
return sysMovieList;
}
public void setSysMovieList(List<SysMovie> sysMovieList) {
this.sysMovieList = sysMovieList;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysCinema sysCinema = (SysCinema) o;
return Objects.equals(cinemaId, sysCinema.cinemaId) && Objects.equals(cinemaName, sysCinema.cinemaName) && Objects.equals(hallCategoryList, sysCinema.hallCategoryList) && Objects.equals(cinemaPicture, sysCinema.cinemaPicture) && Objects.equals(cinemaAddress, sysCinema.cinemaAddress) && Objects.equals(cinemaPhone, sysCinema.cinemaPhone) && Objects.equals(workStartTime, sysCinema.workStartTime) && Objects.equals(workEndTime, sysCinema.workEndTime) && Objects.equals(sysMovieList, sysCinema.sysMovieList);
}
@Override
public int hashCode() {
return Objects.hash(cinemaId, cinemaName, hallCategoryList, cinemaPicture, cinemaAddress, cinemaPhone, workStartTime, workEndTime, sysMovieList);
}
@Override
public String toString() {
return "SysCinema{" +
"cinemaId=" + cinemaId +
", cinemaName='" + cinemaName + '\'' +
", hallCategoryList='" + hallCategoryList + '\'' +
", cinemaPicture='" + cinemaPicture + '\'' +
", cinemaAddress='" + cinemaAddress + '\'' +
", cinemaPhone='" + cinemaPhone + '\'' +
", workStartTime='" + workStartTime + '\'' +
", workEndTime='" + workEndTime + '\'' +
", sysMovieList=" + sysMovieList +
'}';
}
}

@ -1,181 +0,0 @@
package com.rabbiter.cm.domain;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Objects;
public class SysHall implements Serializable {
private final static Long serialVersionUID = 1L;
private Long cinemaId;
private Long hallId;
@NotBlank(message = "影厅名称不能为空")
private String hallName;
private String hallCategory;
//排开始标号:'1' / 'A' 等
private String rowStart;
//影厅排数
@Min(value = 3, message = "排数不能小于3")
@Max(value = 50, message = "排数不能大于50")
private Integer rowNums;
//每排座位数
@Min(value = 3, message = "每排座位数不能小于3")
@Max(value = 50, message = "每排座位数不能大于50")
private Integer seatNumsRow;
//总可用座位数,可以通过安排座位禁用指定座位
@Min(value = 9, message = "座位数不能小于9")
@Max(value = 2500, message = "座位数不能大于2500")
private Integer seatNums;
//座位的状态使用json存储每个座位的状态0表示可用2表示禁用(1表示售出在场次表中统计)
private String seatState;
private Boolean delState;
//影厅表的多表连接
private SysCinema sysCinema;
public SysHall() {
}
public SysHall(Long cinemaId, Long hallId, String hallName, String hallCategory, String rowStart, Integer rowNums, Integer seatNumsRow, Integer seatNums, String seatState, Boolean delState, SysCinema sysCinema) {
this.cinemaId = cinemaId;
this.hallId = hallId;
this.hallName = hallName;
this.hallCategory = hallCategory;
this.rowStart = rowStart;
this.rowNums = rowNums;
this.seatNumsRow = seatNumsRow;
this.seatNums = seatNums;
this.seatState = seatState;
this.delState = delState;
this.sysCinema = sysCinema;
}
public Long getCinemaId() {
return cinemaId;
}
public void setCinemaId(Long cinemaId) {
this.cinemaId = cinemaId;
}
public Long getHallId() {
return hallId;
}
public void setHallId(Long hallId) {
this.hallId = hallId;
}
public String getHallName() {
return hallName;
}
public void setHallName(String hallName) {
this.hallName = hallName;
}
public String getHallCategory() {
return hallCategory;
}
public void setHallCategory(String hallCategory) {
this.hallCategory = hallCategory;
}
public String getRowStart() {
return rowStart;
}
public void setRowStart(String rowStart) {
this.rowStart = rowStart;
}
public Integer getRowNums() {
return rowNums;
}
public void setRowNums(Integer rowNums) {
this.rowNums = rowNums;
}
public Integer getSeatNumsRow() {
return seatNumsRow;
}
public void setSeatNumsRow(Integer seatNumsRow) {
this.seatNumsRow = seatNumsRow;
}
public Integer getSeatNums() {
return seatNums;
}
public void setSeatNums(Integer seatNums) {
this.seatNums = seatNums;
}
public String getSeatState() {
return seatState;
}
public void setSeatState(String seatState) {
this.seatState = seatState;
}
public Boolean getDelState() {
return delState;
}
public void setDelState(Boolean delState) {
this.delState = delState;
}
public SysCinema getSysCinema() {
return sysCinema;
}
public void setSysCinema(SysCinema sysCinema) {
this.sysCinema = sysCinema;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysHall sysHall = (SysHall) o;
return Objects.equals(cinemaId, sysHall.cinemaId) && Objects.equals(hallId, sysHall.hallId) && Objects.equals(hallName, sysHall.hallName) && Objects.equals(hallCategory, sysHall.hallCategory) && Objects.equals(rowStart, sysHall.rowStart) && Objects.equals(rowNums, sysHall.rowNums) && Objects.equals(seatNumsRow, sysHall.seatNumsRow) && Objects.equals(seatNums, sysHall.seatNums) && Objects.equals(seatState, sysHall.seatState) && Objects.equals(delState, sysHall.delState) && Objects.equals(sysCinema, sysHall.sysCinema);
}
@Override
public int hashCode() {
return Objects.hash(cinemaId, hallId, hallName, hallCategory, rowStart, rowNums, seatNumsRow, seatNums, seatState, delState, sysCinema);
}
@Override
public String toString() {
return "SysHall{" +
"cinemaId=" + cinemaId +
", hallId=" + hallId +
", hallName='" + hallName + '\'' +
", hallCategory='" + hallCategory + '\'' +
", rowStart='" + rowStart + '\'' +
", rowNums=" + rowNums +
", seatNumsRow=" + seatNumsRow +
", seatNums=" + seatNums +
", seatState='" + seatState + '\'' +
", delState=" + delState +
", sysCinema=" + sysCinema +
'}';
}
}

@ -1,167 +0,0 @@
package com.rabbiter.cm.domain;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;
public class SysMovie implements Serializable {
private static final long serialVersionUID = 1L;
private Long movieId;
//电影名称
@NotBlank(message = "电影名称不能为空")
private String movieName;
//电影时长
private Integer movieLength;
//电影海报
private String moviePoster;
private String movieArea;
//上映日期
private Date releaseDate;
//电影总票房
private Double movieBoxOffice;
//电影简介
private String movieIntroduction;
//电影图集
private String moviePictures;
//电影的类别
private List<SysMovieCategory> movieCategoryList;
public SysMovie() {
}
public SysMovie(Long movieId, String movieName, Integer movieLength, String moviePoster, String movieArea, Date releaseDate, Double movieBoxOffice, String movieIntroduction, String moviePictures, List<SysMovieCategory> movieCategoryList) {
this.movieId = movieId;
this.movieName = movieName;
this.movieLength = movieLength;
this.moviePoster = moviePoster;
this.movieArea = movieArea;
this.releaseDate = releaseDate;
this.movieBoxOffice = movieBoxOffice;
this.movieIntroduction = movieIntroduction;
this.moviePictures = moviePictures;
this.movieCategoryList = movieCategoryList;
}
public Long getMovieId() {
return movieId;
}
public void setMovieId(Long movieId) {
this.movieId = movieId;
}
public String getMovieName() {
return movieName;
}
public void setMovieName(String movieName) {
this.movieName = movieName;
}
public Integer getMovieLength() {
return movieLength;
}
public void setMovieLength(Integer movieLength) {
this.movieLength = movieLength;
}
public String getMoviePoster() {
return moviePoster;
}
public void setMoviePoster(String moviePoster) {
this.moviePoster = moviePoster;
}
public String getMovieArea() {
return movieArea;
}
public void setMovieArea(String movieArea) {
this.movieArea = movieArea;
}
public Date getReleaseDate() {
return releaseDate;
}
public void setReleaseDate(Date releaseDate) {
this.releaseDate = releaseDate;
}
public Double getMovieBoxOffice() {
return movieBoxOffice;
}
public void setMovieBoxOffice(Double movieBoxOffice) {
this.movieBoxOffice = movieBoxOffice;
}
public String getMovieIntroduction() {
return movieIntroduction;
}
public void setMovieIntroduction(String movieIntroduction) {
this.movieIntroduction = movieIntroduction;
}
public String getMoviePictures() {
return moviePictures;
}
public void setMoviePictures(String moviePictures) {
this.moviePictures = moviePictures;
}
public List<SysMovieCategory> getMovieCategoryList() {
return movieCategoryList;
}
public void setMovieCategoryList(List<SysMovieCategory> movieCategoryList) {
this.movieCategoryList = movieCategoryList;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysMovie sysMovie = (SysMovie) o;
return Objects.equals(movieId, sysMovie.movieId) && Objects.equals(movieName, sysMovie.movieName) && Objects.equals(movieLength, sysMovie.movieLength) && Objects.equals(moviePoster, sysMovie.moviePoster) && Objects.equals(movieArea, sysMovie.movieArea) && Objects.equals(releaseDate, sysMovie.releaseDate) && Objects.equals(movieBoxOffice, sysMovie.movieBoxOffice) && Objects.equals(movieIntroduction, sysMovie.movieIntroduction) && Objects.equals(moviePictures, sysMovie.moviePictures) && Objects.equals(movieCategoryList, sysMovie.movieCategoryList);
}
@Override
public int hashCode() {
return Objects.hash(movieId, movieName, movieLength, moviePoster, movieArea, releaseDate, movieBoxOffice, movieIntroduction, moviePictures, movieCategoryList);
}
@Override
public String toString() {
return "SysMovie{" +
"movieId=" + movieId +
", movieName='" + movieName + '\'' +
", movieLength=" + movieLength +
", moviePoster='" + moviePoster + '\'' +
", movieArea='" + movieArea + '\'' +
", releaseDate=" + releaseDate +
", movieBoxOffice=" + movieBoxOffice +
", movieIntroduction='" + movieIntroduction + '\'' +
", moviePictures='" + moviePictures + '\'' +
", movieCategoryList=" + movieCategoryList +
'}';
}
}

@ -1,61 +0,0 @@
package com.rabbiter.cm.domain;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Objects;
public class SysMovieCategory implements Serializable {
//序列号
private static final long serialVersionUID = 1L;
//电影分类id
private Long movieCategoryId;
//电影分类名称
@NotBlank(message = "电影分类名称不能为空")
private String movieCategoryName;
public SysMovieCategory() {
}
public SysMovieCategory(Long movieCategoryId, String movieCategoryName) {
this.movieCategoryId = movieCategoryId;
this.movieCategoryName = movieCategoryName;
}
public Long getMovieCategoryId() {
return movieCategoryId;
}
public void setMovieCategoryId(Long movieCategoryId) {
this.movieCategoryId = movieCategoryId;
}
public String getMovieCategoryName() {
return movieCategoryName;
}
public void setMovieCategoryName(String movieCategoryName) {
this.movieCategoryName = movieCategoryName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysMovieCategory that = (SysMovieCategory) o;
return Objects.equals(movieCategoryId, that.movieCategoryId) && Objects.equals(movieCategoryName, that.movieCategoryName);
}
@Override
public int hashCode() {
return Objects.hash(movieCategoryId, movieCategoryName);
}
@Override
public String toString() {
return "SysMovieCategory{" +
"movieCategoryId=" + movieCategoryId +
", movieCategoryName='" + movieCategoryName + '\'' +
'}';
}
}

@ -1,62 +0,0 @@
package com.rabbiter.cm.domain;
import java.io.Serializable;
import java.util.Objects;
/**
*
*/
public class SysMovieToCategory implements Serializable {
private static final Long serialVersionUID = 1L;
private Long movieId;
private Long movieCategoryId;
public SysMovieToCategory() {
}
public SysMovieToCategory(Long movieId, Long movieCategoryId) {
this.movieId = movieId;
this.movieCategoryId = movieCategoryId;
}
public Long getMovieId() {
return movieId;
}
public void setMovieId(Long movieId) {
this.movieId = movieId;
}
public Long getMovieCategoryId() {
return movieCategoryId;
}
public void setMovieCategoryId(Long movieCategoryId) {
this.movieCategoryId = movieCategoryId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysMovieToCategory that = (SysMovieToCategory) o;
return Objects.equals(movieId, that.movieId) && Objects.equals(movieCategoryId, that.movieCategoryId);
}
@Override
public int hashCode() {
return Objects.hash(movieId, movieCategoryId);
}
@Override
public String toString() {
return "SysMovieToCategory{" +
"movieId=" + movieId +
", movieCategoryId=" + movieCategoryId +
'}';
}
}

@ -1,124 +0,0 @@
package com.rabbiter.cm.domain;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
public class SysResource implements Serializable {
private static final Long serialVersionUID = 1L;
private Long id;
@NotBlank(message = "菜单名称不能为空")
private String name;
private String path;
//菜单权限等级
private Integer level;
private Long parentId;
//父菜单
private SysResource parent;
//子菜单
private List<SysResource> children;
public SysResource() {
}
public SysResource(Long id, String name, String path, Integer level, Long parentId, SysResource parent, List<SysResource> children) {
this.id = id;
this.name = name;
this.path = path;
this.level = level;
this.parentId = parentId;
this.parent = parent;
this.children = children;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public SysResource getParent() {
return parent;
}
public void setParent(SysResource parent) {
this.parent = parent;
}
public List<SysResource> getChildren() {
return children;
}
public void setChildren(List<SysResource> children) {
this.children = children;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysResource that = (SysResource) o;
return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(path, that.path) && Objects.equals(level, that.level) && Objects.equals(parentId, that.parentId) && Objects.equals(parent, that.parent) && Objects.equals(children, that.children);
}
@Override
public int hashCode() {
return Objects.hash(id, name, path, level, parentId, parent, children);
}
@Override
public String toString() {
return "SysResource{" +
"id=" + id +
", name='" + name + '\'' +
", path='" + path + '\'' +
", level=" + level +
", parentId=" + parentId +
", parent=" + parent +
", children=" + children +
'}';
}
}

@ -1,90 +0,0 @@
package com.rabbiter.cm.domain;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
public class SysRole implements Serializable {
private static final Long serialVersionUID = 1L;
private Long roleId;
//角色名称
@NotBlank(message = "角色名称不能为空")
private String roleName;
//角色描述
@NotBlank(message = "角色描述不能为空")
private String roleDesc;
//角色拥有的权限分多级权限存储取名为children方便读取所有权限
private List<SysResource> children;
public SysRole() {
}
public SysRole(Long roleId, String roleName, String roleDesc, List<SysResource> children) {
this.roleId = roleId;
this.roleName = roleName;
this.roleDesc = roleDesc;
this.children = children;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public String getRoleDesc() {
return roleDesc;
}
public void setRoleDesc(String roleDesc) {
this.roleDesc = roleDesc;
}
public List<SysResource> getChildren() {
return children;
}
public void setChildren(List<SysResource> children) {
this.children = children;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysRole sysRole = (SysRole) o;
return Objects.equals(roleId, sysRole.roleId) && Objects.equals(roleName, sysRole.roleName) && Objects.equals(roleDesc, sysRole.roleDesc) && Objects.equals(children, sysRole.children);
}
@Override
public int hashCode() {
return Objects.hash(roleId, roleName, roleDesc, children);
}
@Override
public String toString() {
return "SysRole{" +
"roleId=" + roleId +
", roleName='" + roleName + '\'' +
", roleDesc='" + roleDesc + '\'' +
", children=" + children +
'}';
}
}

@ -1,243 +0,0 @@
package com.rabbiter.cm.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
/**
*
*/
public class SysSession implements Serializable {
private static final Long serialVersionUID = 1L;
//场次编号
private Long sessionId;
//影厅编号
@NotNull(message = "场次所在影厅不能为空")
private Long hallId;
//该场次语言版本
@NotBlank(message = "场次电影语言版本不能为空")
private String languageVersion;
// 电影编号
@NotNull(message = "场次安排电影不能为空")
private Long movieId;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "HH:mm")
private String playTime;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "HH:mm")
private String endTime;
// 截止时间,此时间之前不可删不可改电影、影厅信息
private String deadline;
// 场次日期
@NotNull(message = "场次日期不能为空")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
private LocalDate sessionDate;
// 场次票价
@NotNull(message = "场次票价不能为空")
@Size(min = 0, message = "场次票价不能为负数")
private Double sessionPrice;
// 场次提示
private String sessionTips;
// 场次座位信息
@NotBlank(message = "场次座位信息不能为空")
private String sessionSeats;
private Integer seatNums;
// 已售座位数
private Integer sallNums;
private SysHall sysHall;
private SysMovie sysMovie;
public SysSession() {
}
public SysSession(Long sessionId, Long hallId, String languageVersion, Long movieId, String playTime, String endTime, String deadline, LocalDate sessionDate, Double sessionPrice, String sessionTips, String sessionSeats, Integer seatNums, Integer sallNums, SysHall sysHall, SysMovie sysMovie) {
this.sessionId = sessionId;
this.hallId = hallId;
this.languageVersion = languageVersion;
this.movieId = movieId;
this.playTime = playTime;
this.endTime = endTime;
this.deadline = deadline;
this.sessionDate = sessionDate;
this.sessionPrice = sessionPrice;
this.sessionTips = sessionTips;
this.sessionSeats = sessionSeats;
this.seatNums = seatNums;
this.sallNums = sallNums;
this.sysHall = sysHall;
this.sysMovie = sysMovie;
}
public Long getSessionId() {
return sessionId;
}
public void setSessionId(Long sessionId) {
this.sessionId = sessionId;
}
public Long getHallId() {
return hallId;
}
public void setHallId(Long hallId) {
this.hallId = hallId;
}
public String getLanguageVersion() {
return languageVersion;
}
public void setLanguageVersion(String languageVersion) {
this.languageVersion = languageVersion;
}
public Long getMovieId() {
return movieId;
}
public void setMovieId(Long movieId) {
this.movieId = movieId;
}
public String getPlayTime() {
return playTime;
}
public void setPlayTime(String playTime) {
this.playTime = playTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getDeadline() {
return deadline;
}
public void setDeadline(String deadline) {
this.deadline = deadline;
}
public LocalDate getSessionDate() {
return sessionDate;
}
public void setSessionDate(LocalDate sessionDate) {
this.sessionDate = sessionDate;
}
public Double getSessionPrice() {
return sessionPrice;
}
public void setSessionPrice(Double sessionPrice) {
this.sessionPrice = sessionPrice;
}
public String getSessionTips() {
return sessionTips;
}
public void setSessionTips(String sessionTips) {
this.sessionTips = sessionTips;
}
public String getSessionSeats() {
return sessionSeats;
}
public void setSessionSeats(String sessionSeats) {
this.sessionSeats = sessionSeats;
}
public Integer getSeatNums() {
return seatNums;
}
public void setSeatNums(Integer seatNums) {
this.seatNums = seatNums;
}
public Integer getSallNums() {
return sallNums;
}
public void setSallNums(Integer sallNums) {
this.sallNums = sallNums;
}
public SysHall getSysHall() {
return sysHall;
}
public void setSysHall(SysHall sysHall) {
this.sysHall = sysHall;
}
public SysMovie getSysMovie() {
return sysMovie;
}
public void setSysMovie(SysMovie sysMovie) {
this.sysMovie = sysMovie;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysSession that = (SysSession) o;
return Objects.equals(sessionId, that.sessionId) && Objects.equals(hallId, that.hallId) && Objects.equals(languageVersion, that.languageVersion) && Objects.equals(movieId, that.movieId) && Objects.equals(playTime, that.playTime) && Objects.equals(endTime, that.endTime) && Objects.equals(deadline, that.deadline) && Objects.equals(sessionDate, that.sessionDate) && Objects.equals(sessionPrice, that.sessionPrice) && Objects.equals(sessionTips, that.sessionTips) && Objects.equals(sessionSeats, that.sessionSeats) && Objects.equals(seatNums, that.seatNums) && Objects.equals(sallNums, that.sallNums) && Objects.equals(sysHall, that.sysHall) && Objects.equals(sysMovie, that.sysMovie);
}
@Override
public int hashCode() {
return Objects.hash(sessionId, hallId, languageVersion, movieId, playTime, endTime, deadline, sessionDate, sessionPrice, sessionTips, sessionSeats, seatNums, sallNums, sysHall, sysMovie);
}
@Override
public String toString() {
return "SysSession{" +
"sessionId=" + sessionId +
", hallId=" + hallId +
", languageVersion='" + languageVersion + '\'' +
", movieId=" + movieId +
", playTime='" + playTime + '\'' +
", endTime='" + endTime + '\'' +
", deadline='" + deadline + '\'' +
", sessionDate=" + sessionDate +
", sessionPrice=" + sessionPrice +
", sessionTips='" + sessionTips + '\'' +
", sessionSeats='" + sessionSeats + '\'' +
", seatNums=" + seatNums +
", sallNums=" + sallNums +
", sysHall=" + sysHall +
", sysMovie=" + sysMovie +
'}';
}
}

@ -1,185 +0,0 @@
package com.rabbiter.cm.domain;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Objects;
public class SysUser implements Serializable {
private final static Long serialVersionUID = 1L;
//用户id
private Long userId;
//用户名
@NotBlank(message = "用户名不能为空")
private String userName;
//密码
@NotBlank(message = "密码不能为空")
private String password;
//盐
private String salt;
//邮箱
@Email(message = "邮箱格式有误")
private String email;
//电话号码
@Pattern(regexp = "^1[3|4|5|7|8]\\d{9}$", message = "电话号码格式有错")
private String phoneNumber;
//性别
private Boolean sex;
//用户头像
private String userPicture;
//用户对应的角色id为简化操作采用1对1
private Long roleId;
private String birthday;
private String autograph;
//用户的角色
private SysRole sysRole;
public SysUser() {
}
public SysUser(Long userId, String userName, String password, String salt, String email, String phoneNumber, Boolean sex, String userPicture, Long roleId, String birthday, String autograph, SysRole sysRole) {
this.userId = userId;
this.userName = userName;
this.password = password;
this.salt = salt;
this.email = email;
this.phoneNumber = phoneNumber;
this.sex = sex;
this.userPicture = userPicture;
this.roleId = roleId;
this.birthday = birthday;
this.autograph = autograph;
this.sysRole = sysRole;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public Boolean getSex() {
return sex;
}
public void setSex(Boolean sex) {
this.sex = sex;
}
public String getUserPicture() {
return userPicture;
}
public void setUserPicture(String userPicture) {
this.userPicture = userPicture;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getAutograph() {
return autograph;
}
public void setAutograph(String autograph) {
this.autograph = autograph;
}
public SysRole getSysRole() {
return sysRole;
}
public void setSysRole(SysRole sysRole) {
this.sysRole = sysRole;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysUser sysUser = (SysUser) o;
return Objects.equals(userId, sysUser.userId) && Objects.equals(userName, sysUser.userName) && Objects.equals(password, sysUser.password) && Objects.equals(salt, sysUser.salt) && Objects.equals(email, sysUser.email) && Objects.equals(phoneNumber, sysUser.phoneNumber) && Objects.equals(sex, sysUser.sex) && Objects.equals(userPicture, sysUser.userPicture) && Objects.equals(roleId, sysUser.roleId) && Objects.equals(birthday, sysUser.birthday) && Objects.equals(autograph, sysUser.autograph) && Objects.equals(sysRole, sysUser.sysRole);
}
@Override
public int hashCode() {
return Objects.hash(userId, userName, password, salt, email, phoneNumber, sex, userPicture, roleId, birthday, autograph, sysRole);
}
@Override
public String toString() {
return "SysUser{" +
"userId=" + userId +
", userName='" + userName + '\'' +
", password='" + password + '\'' +
", salt='" + salt + '\'' +
", email='" + email + '\'' +
", phoneNumber='" + phoneNumber + '\'' +
", sex=" + sex +
", userPicture='" + userPicture + '\'' +
", roleId=" + roleId +
", birthday='" + birthday + '\'' +
", autograph='" + autograph + '\'' +
", sysRole=" + sysRole +
'}';
}
}

@ -1,49 +0,0 @@
package com.rabbiter.cm.domain.vo;
import com.rabbiter.cm.domain.SysBill;
import java.io.Serializable;
/**
*
*/
public class SysBillVo implements Serializable {
//订单信息
private SysBill sysBill;
//若成功更新后场次的座位信息
private String sessionSeats;
public SysBillVo() {
}
public SysBillVo(SysBill sysBill, String sessionSeats) {
this.sysBill = sysBill;
this.sessionSeats = sessionSeats;
}
public SysBill getSysBill() {
return sysBill;
}
public void setSysBill(SysBill sysBill) {
this.sysBill = sysBill;
}
public String getSessionSeats() {
return sessionSeats;
}
public void setSessionSeats(String sessionSeats) {
this.sessionSeats = sessionSeats;
}
@Override
public String toString() {
return "SysBillVo{" +
"sysBill=" + sysBill +
", sessionSeats='" + sessionSeats + '\'' +
'}';
}
}

@ -1,96 +0,0 @@
package com.rabbiter.cm.domain.vo;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
/**
*
*/
public class SysMovieVo implements Serializable {
private String movieName;
private String movieArea;
private Long movieCategoryId;
private Date startDate;
private Date endDate;
public SysMovieVo() {
}
public SysMovieVo(String movieName, String movieArea, Long movieCategoryId, Date startDate, Date endDate) {
this.movieName = movieName;
this.movieArea = movieArea;
this.movieCategoryId = movieCategoryId;
this.startDate = startDate;
this.endDate = endDate;
}
public String getMovieName() {
return movieName;
}
public void setMovieName(String movieName) {
this.movieName = movieName;
}
public String getMovieArea() {
return movieArea;
}
public void setMovieArea(String movieArea) {
this.movieArea = movieArea;
}
public Long getMovieCategoryId() {
return movieCategoryId;
}
public void setMovieCategoryId(Long movieCategoryId) {
this.movieCategoryId = movieCategoryId;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysMovieVo that = (SysMovieVo) o;
return Objects.equals(movieName, that.movieName) && Objects.equals(movieArea, that.movieArea) && Objects.equals(movieCategoryId, that.movieCategoryId) && Objects.equals(startDate, that.startDate) && Objects.equals(endDate, that.endDate);
}
@Override
public int hashCode() {
return Objects.hash(movieName, movieArea, movieCategoryId, startDate, endDate);
}
@Override
public String toString() {
return "SysMovieVo{" +
"movieName='" + movieName + '\'' +
", movieArea='" + movieArea + '\'' +
", movieCategoryId=" + movieCategoryId +
", startDate=" + startDate +
", endDate=" + endDate +
'}';
}
}

@ -1,58 +0,0 @@
package com.rabbiter.cm.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.time.LocalDate;
public class SysSessionVo implements Serializable {
private Long hallId;
private Long movieId;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
private LocalDate sessionDate;
public SysSessionVo() {
}
public SysSessionVo(Long hallId, Long movieId, LocalDate sessionDate) {
this.hallId = hallId;
this.movieId = movieId;
this.sessionDate = sessionDate;
}
public Long getHallId() {
return hallId;
}
public void setHallId(Long hallId) {
this.hallId = hallId;
}
public Long getMovieId() {
return movieId;
}
public void setMovieId(Long movieId) {
this.movieId = movieId;
}
public LocalDate getSessionDate() {
return sessionDate;
}
public void setSessionDate(LocalDate sessionDate) {
this.sessionDate = sessionDate;
}
@Override
public String toString() {
return "SysSessionVo{" +
"hallId=" + hallId +
", movieId=" + movieId +
", sessionDate=" + sessionDate +
'}';
}
}

@ -1,45 +0,0 @@
package com.rabbiter.cm.domain.vo;
import java.io.Serializable;
/**
*
*/
public class SysUserVo implements Serializable {
private String userName;
private String password;
public SysUserVo() {
}
public SysUserVo(String userName, String password) {
this.userName = userName;
this.password = password;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "SysUserVo{" +
"userName='" + userName + '\'' +
", password='" + password + '\'' +
'}';
}
}

@ -1,23 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysBill;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysBillMapper {
List<SysBill> findAllBills(SysBill sysBill);
SysBill findBillById(Long id);
int addBill(SysBill sysBill);
int updateBill(SysBill sysBill);
int deleteBill(Long id);
List<SysBill> findTimeoutBill();
}

@ -1,16 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysCinema;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysCinemaMapper {
SysCinema findCinema();
int updateCinema(SysCinema sysCinema);
// 前台展示单个影院信息,返回包含影院、上映中的所有电影信息
SysCinema findCinemaById(Long id);
}

@ -1,19 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysHall;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysHallMapper {
List<SysHall> findAllHalls(SysHall sysHall);
SysHall findHallById(SysHall sysHall);
int addHall(SysHall sysHall);
int updateHall(SysHall sysHall);
int deleteHall(SysHall sysHall);
}

@ -1,28 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysMovieCategory;
import com.rabbiter.cm.domain.SysMovieToCategory;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysMovieCategoryMapper {
List<SysMovieCategory> findAllCategorys();
SysMovieCategory findCategoryById(Long id);
List<SysMovieCategory> findOneMovieCategorys(Long id);
int addCategory(SysMovieCategory sysMovieCategory);
int updateCategory(SysMovieCategory sysMovieCategory);
int deleteCategory(Long id);
int addMovieToCategory(SysMovieToCategory sysMovieToCategory);
int deleteMovieToCategory(SysMovieToCategory sysMovieToCategory);
}

@ -1,65 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysMovie;
import com.rabbiter.cm.domain.vo.SysMovieVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysMovieMapper {
/**
*
* @param sysMovieVo
* @return
*/
List<SysMovie> findAllMovies(SysMovieVo sysMovieVo);
/**
* id
* @param id
* @return
*/
SysMovie findMovieById(Long id);
/**
*
* @param id
* @return
*/
SysMovie findOneMovie(Long id);
int addMovie(SysMovie sysMovie);
int updateMovie(SysMovie sysMovie);
int deleteMovie(Long id);
/**
*
*
* @param id
* @return
*/
List<SysMovie> findMovieByCinemaId(Long id);
/**
*
* @return
*/
List<SysMovie> totalBoxOfficeList();
/**
* 10 movieArea in (+)
* @return
*/
List<SysMovie> domesticBoxOfficeList();
/**
* 10 movieArea not in (+)
* @return
*/
List<SysMovie> foreignBoxOfficeList();
}

@ -1,40 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysResource;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysResourceMapper {
/**
*
*
* @return
*/
List<SysResource> findAllResources();
/**
* children
*
* @return
*/
List<SysResource> findWithChildren();
/**
*
*
* @return
*/
List<SysResource> findAllWithAllChildren();
SysResource findResourceById(Long id);
int addResource(SysResource sysResource);
int updateResource(SysResource sysResource);
int deleteResource(Long id);
}

@ -1,29 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysRole;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysRoleMapper {
List<SysRole> findAllRoles();
SysRole findRoleById(Long id);
int addRole(SysRole sysRole);
int updateRole(SysRole sysRole);
int deleteRole(Long id);
//给当前角色分配权限
int addRight(Long roleId, Long resourceId);
int deleteRight(Long roleId, Long resourceId);
//查询指定角色的所有三级权限id
List<Long> findAllRights(Long roleId);
}

@ -1,76 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.SysSession;
import com.rabbiter.cm.domain.vo.SysSessionVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysSessionMapper {
/**
*
*
* @param sysSessionVo
* @return
*/
List<SysSession> findByVo(SysSessionVo sysSessionVo);
/**
*
*
* @param sysSession
* @return
*/
List<SysSession> findSessionByMovieIdOrHallId(SysSession sysSession);
/**
*
*
* @param id
* @return
*/
SysSession findSessionById(Long id);
/**
*
*
* @param id
* @return
*/
SysSession findOneSession(Long id);
/**
*
*
* @param sysSession
* @return
*/
int addSession(SysSession sysSession);
/**
*
*
* @param sysSession
* @return
*/
int updateSession(SysSession sysSession);
/**
*
*
* @param id
* @return
*/
int deleteSession(Long id);
/**
* idid5
*
* @param movieId
* @return
*/
List<SysSession> findSessionByMovieId(Long movieId);
}

@ -1,38 +0,0 @@
package com.rabbiter.cm.mapper;
import com.rabbiter.cm.domain.vo.SysUserVo;
import com.rabbiter.cm.domain.LoginUser;
import com.rabbiter.cm.domain.SysUser;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface SysUserMapper {
List<SysUser> findAllUsers(SysUser sysUser);
SysUser findUserById(Long id);
/**
* jwt
* @param userName
* @return
*/
SysUser findUserByName(String userName);
int addUser(SysUser sysUser);
int updateUser(SysUser sysUser);
int deleteUser(Long id);
LoginUser findLoginUser(SysUserVo sysUserVo);
/**
* id
*
* @param userName
* @return
*/
List<Long> checkUserNameUnique(String userName);
}
Loading…
Cancel
Save