一版本注释 #1

Merged
p7kr8tqu6 merged 1 commits from 1 into main 10 months ago

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="gerenjiankangguanlixitong" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="gerenjiankangguanlixitong" options="-parameters" />
</option>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<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/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.jlwl</groupId>
<!-- 导入项目的名称 -->
<artifactId>gerenjiankangguanlixitong</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>gerenjiankangguanlixitong</name>
<description>个人健康管理系统小程序</description>
<properties>
<java.version>1.8</java.version>
<fastjson.version>1.2.8</fastjson.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!--访问静态资源-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.0.12</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!--<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<scope>4.0</scope>
<version>4.0</version>
</dependency>-->
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- poi高版本额外包 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-examples</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,102 @@
package com.ServletContextListener;
// 导入MyBatis-Plus的EntityWrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.EntityWrapper;
// 导入DictionaryEntity实体类用于映射字典表
import com.entity.DictionaryEntity;
// 导入DictionaryService接口用于定义字典服务
import com.service.DictionaryService;
// 导入MyThreadMethod类用于自定义线程方法
import com.thread.MyThreadMethod;
// 导入SLF4J的日志记录器
import org.slf4j.Logger;
// 导入SLF4J的日志记录器工厂
import org.slf4j.LoggerFactory;
// 导入Spring的ApplicationContext接口用于获取Spring上下文
import org.springframework.context.ApplicationContext;
// 导入Spring的WebApplicationContextUtils类用于从ServletContext获取Spring上下文
import org.springframework.web.context.support.WebApplicationContextUtils;
// 导入Servlet的ServletContextListener接口用于监听Servlet上下文事件
import javax.servlet.ServletContextListener;
// 导入Servlet的ServletContextEvent类用于获取Servlet上下文事件信息
import javax.servlet.ServletContextEvent;
// 注解用于声明这是一个Servlet监听器
import javax.servlet.annotation.WebListener;
// 导入Java的HashMap类用于存储键值对
import java.util.HashMap;
// 导入Java的List类用于存储列表数据
import java.util.List;
// 导入Java的Map接口用于存储键值对
import java.util.Map;
/**
* ,,
*/
@WebListener
// 实现ServletContextListener接口用于监听Servlet上下文事件
public class DictionaryServletContextListener implements ServletContextListener {
// 创建日志记录器实例
private static final Logger logger = LoggerFactory.getLogger(DictionaryServletContextListener.class);
// 声明MyThreadMethod实例
private MyThreadMethod myThreadMethod;
/**
*
*
* @param sce Servlet
*/
@Override
public void contextDestroyed(ServletContextEvent sce) {
// 记录服务器停止日志
logger.info("----------服务器停止----------");
}
/**
*
*
* @param sce Servlet
*/
@Override
public void contextInitialized(ServletContextEvent sce) {
// 获取Spring上下文
ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());
// 记录字典表初始化开始日志
logger.info("----------字典表初始化开始----------");
// 获取DictionaryService实例
DictionaryService dictionaryService = (DictionaryService) appContext.getBean("dictionaryService");
// 查询所有字典实体
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
// 创建字典映射
Map<String, Map<Integer, String>> map = new HashMap<>();
// 遍历字典实体列表
for (DictionaryEntity d : dictionaryEntities) {
// 获取当前字典代码对应的映射
Map<Integer, String> m = map.get(d.getDicCode());
// 如果映射为空,则创建新的映射
if (m == null || m.isEmpty()) {
m = new HashMap<>();
}
// 将字典索引和名称添加到映射中
m.put(d.getCodeIndex(), d.getIndexName());
// 将映射添加到字典映射中
map.put(d.getDicCode(), m);
}
// 将字典映射设置到ServletContext中
sce.getServletContext().setAttribute("dictionaryMap", map);
// 记录字典表初始化完成日志
logger.info("----------字典表初始化完成----------");
// 记录线程执行开始日志
logger.info("----------线程执行开始----------");
// 如果MyThreadMethod实例为空则创建并启动线程
if (myThreadMethod == null) {
myThreadMethod = new MyThreadMethod();
myThreadMethod.start(); // servlet 上下文初始化时启动线程myThreadMethod
}
// 记录线程执行结束日志
logger.info("----------线程执行结束----------");
}
}

@ -0,0 +1,25 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface APPLoginUser {
/**
*
* 便
*
* 使
* <pre>
* public void someMethod(@APPLoginUser User loginUser) {
* // 使用 loginUser 进行业务处理
* }
* </pre>
*/
}

@ -0,0 +1,31 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* 便
*
* @param comment
* @param type
*
* 使
* <pre>
* public class User {
* @ColumnInfo(comment = "用户ID", type = "BIGINT")
* private Long id;
*
* @ColumnInfo(comment = "用户名", type = "VARCHAR(255)")
* private String username;
* }
* </pre>
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ColumnInfo {
String comment();
String type();
}

@ -0,0 +1,22 @@
package com.annotation;
import java.lang.annotation.*;
/**
* Token
* 便Token
*
* 使
* <pre>
* @IgnoreAuth
* public void someMethod() {
* // 无需Token验证的方法逻辑
* }
* </pre>
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IgnoreAuth {
}

@ -0,0 +1,23 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* 便
*
* 使
* <pre>
* public void someMethod(@LoginUser User loginUser) {
* // 使用 loginUser 进行业务处理
* }
* </pre>
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface LoginUser {
}

@ -0,0 +1,89 @@
// 声明该类所在的包名为 com.config包是 Java 中用于组织类和接口的一种机制,有助于避免命名冲突和管理代码结构
package com.config;
// 导入 Spring 框架中的 @Bean 注解,此注解用于将方法返回的对象注册为 Spring 容器中的 Bean
import org.springframework.context.annotation.Bean;
// 导入 Spring 框架中的 @Configuration 注解用于标记一个类为配置类Spring 会对该类进行解析以获取 Bean 定义等信息
import org.springframework.context.annotation.Configuration;
// 导入 Spring MVC 中用于配置拦截器注册的 InterceptorRegistry 类,借助它能对拦截器进行注册和配置
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
// 导入 Spring MVC 中用于配置静态资源处理器的 ResourceHandlerRegistry 类,可利用它来配置静态资源的访问路径
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
// 导入 Spring MVC 中支持 Web MVC 配置的基类 WebMvcConfigurationSupport通过继承它可对 Web MVC 进行自定义配置
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
// 导入自定义的授权拦截器类,该类负责处理授权相关的拦截逻辑
import com.interceptor.AuthorizationInterceptor;
/**
*
* {@link WebMvcConfigurationSupport}
*
* @author []
*/
// 使用 @Configuration 注解,表明这个类是一个 Spring 配置类Spring 会扫描该类并处理其中的配置信息
@Configuration
// 定义一个名为 InterceptorConfig 的类,继承自 WebMvcConfigurationSupport目的是对 Web MVC 相关的配置进行定制
public class InterceptorConfig extends WebMvcConfigurationSupport {
/**
* {@link AuthorizationInterceptor}
*
* @return {@link AuthorizationInterceptor}
*/
// 使用 @Bean 注解,把这个方法返回的 AuthorizationInterceptor 实例注册为 Spring 容器中的 Bean
@Bean
// 定义一个名为 getAuthorizationInterceptor 的公共方法,返回类型为 AuthorizationInterceptor
public AuthorizationInterceptor getAuthorizationInterceptor() {
// 创建 AuthorizationInterceptor 类的一个新实例并返回
return new AuthorizationInterceptor();
}
/**
*
* {@link AuthorizationInterceptor} "/**""/static/**"
*
* @param registry
*/
// 重写父类 WebMvcConfigurationSupport 中的 addInterceptors 方法,用于注册拦截器
@Override
// 定义 addInterceptors 方法,接收一个 InterceptorRegistry 类型的参数 registry
public void addInterceptors(InterceptorRegistry registry) {
// 调用 registry 的 addInterceptor 方法,将之前创建的 AuthorizationInterceptor Bean 添加到拦截器链中
registry.addInterceptor(getAuthorizationInterceptor())
// 设置拦截的路径模式为 "/**",意味着拦截所有请求
.addPathPatterns("/**")
// 设置排除的路径模式为 "/static/**",即静态资源请求不会被该拦截器拦截
.excludePathPatterns("/static/**");
// 调用父类的 addInterceptors 方法,确保父类中的拦截器配置也能生效
super.addInterceptors(registry);
}
/**
*
* {@link WebMvcConfigurationSupport}
*
* @param registry
*/
// 重写父类的 addResourceHandlers 方法,用于配置静态资源的处理
@Override
// 定义 addResourceHandlers 方法,接收一个 ResourceHandlerRegistry 类型的参数 registry
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// 调用 registry 的 addResourceHandler 方法,设置要处理的资源路径模式为 "/**",表示处理所有资源请求
registry.addResourceHandler("/**")
// 添加资源位置,这里表示从类路径下的 resources 目录查找静态资源
.addResourceLocations("classpath:/resources/")
// 添加资源位置,从类路径下的 static 目录查找静态资源
.addResourceLocations("classpath:/static/")
// 添加资源位置,从类路径下的 admin 目录查找静态资源
.addResourceLocations("classpath:/admin/")
// 添加资源位置,从类路径下的 img 目录查找静态资源
.addResourceLocations("classpath:/img/")
// 添加资源位置,从类路径下的 front 目录查找静态资源
.addResourceLocations("classpath:/front/")
// 添加资源位置,从类路径下的 public 目录查找静态资源
.addResourceLocations("classpath:/public/");
// 调用父类的 addResourceHandlers 方法,保证父类中的静态资源配置依然有效
super.addResourceHandlers(registry);
}
}

@ -0,0 +1,43 @@
package com.config;
import java.util.Date;
import org.apache.ibatis.reflection.MetaObject;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
/**
*
*/
public class MyMetaObjectHandler extends MetaObjectHandler {
/**
*
* ctime
*
* @param metaObject
*/
@Override
public void insertFill(MetaObject metaObject) {
this.setFieldValByName("ctime", new Date(), metaObject);
}
/**
*
* false
*
* @return boolean
*/
@Override
public boolean openUpdateFill() {
return false;
}
/**
*
* openUpdateFillfalse
*
* @param metaObject
*/
@Override
public void updateFill(MetaObject metaObject) {
// 关闭更新填充、这里不执行
}
}

@ -0,0 +1,33 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
/**
* Mybatis-Plus Mybatis-Plus
* Spring @Configuration
* @Bean Spring
*/
@Configuration
public class MybatisPlusConfig {
/**
*
* <p>
* Mybatis-Plus PaginationInterceptor
*
* </p>
*
* @return PaginationInterceptor
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -0,0 +1,130 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
@RequestMapping("config")
@RestController
public class ConfigController {
// 自动注入ConfigService
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, ConfigEntity config) {
// 创建EntityWrapper对象用于条件查询
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
// 调用服务层方法查询分页数据
PageUtils page = configService.queryPage(params);
// 返回查询结果
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, ConfigEntity config) {
// 创建EntityWrapper对象用于条件查询
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
// 调用服务层方法查询分页数据
PageUtils page = configService.queryPage(params);
// 返回查询结果
return R.ok().put("data", page);
}
/**
* ID
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id) {
// 调用服务层方法根据ID查询配置信息
ConfigEntity config = configService.selectById(id);
// 返回查询结果
return R.ok().put("data", config);
}
/**
* ID
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id) {
// 调用服务层方法根据ID查询配置信息
ConfigEntity config = configService.selectById(id);
// 返回查询结果
return R.ok().put("data", config);
}
/**
* name
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name) {
// 调用服务层方法根据name查询配置信息
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", name));
// 返回查询结果
return R.ok().put("data", config);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody ConfigEntity config) {
// 验证实体对象(注释掉)
// ValidatorUtils.validateEntity(config);
// 调用服务层方法保存配置信息
configService.insert(config);
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ConfigEntity config) {
// 验证实体对象(注释掉)
// ValidatorUtils.validateEntity(config);
// 调用服务层方法更新配置信息
configService.updateById(config); // 全部更新
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids) {
// 调用服务层方法批量删除配置信息
configService.deleteBatchIds(Arrays.asList(ids));
// 返回成功信息
return R.ok();
}
}

@ -0,0 +1,356 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {
// 定义日志记录器
private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);
// 定义表名常量
private static final String TABLE_NAME = "dictionary";
// 自动注入DictionaryService
@Autowired
private DictionaryService dictionaryService;
// 自动注入TokenService
@Autowired
private TokenService tokenService;
// 自动注入ForumService
@Autowired
private ForumService forumService; // 论坛
// 自动注入GerentizhengService
@Autowired
private GerentizhengService gerentizhengService; // 体检记录
// 自动注入JiankangtieshiService
@Autowired
private JiankangtieshiService jiankangtieshiService; // 健康贴士
// 自动注入MeirijihuaService
@Autowired
private MeirijihuaService meirijihuaService; // 每日计划
// 自动注入MeishiService
@Autowired
private MeishiService meishiService; // 健康食谱
// 自动注入MeishiCollectionService
@Autowired
private MeishiCollectionService meishiCollectionService; // 健康食谱收藏
// 自动注入MeishiLiuyanService
@Autowired
private MeishiLiuyanService meishiLiuyanService; // 健康食谱留言
// 自动注入NewsService
@Autowired
private NewsService newsService; // 公告信息
// 自动注入YaopinService
@Autowired
private YaopinService yaopinService; // 药品信息
// 自动注入YonghuService
@Autowired
private YonghuService yonghuService; // 用户
// 自动注入YundongService
@Autowired
private YundongService yundongService; // 运动教程
// 自动注入YundongCollectionService
@Autowired
private YundongCollectionService yundongCollectionService; // 运动教程收藏
// 自动注入YundongLiuyanService
@Autowired
private YundongLiuyanService yundongLiuyanService; // 运动教程留言
// 自动注入UsersService
@Autowired
private UsersService usersService; // 管理员
/**
*
*/
@RequestMapping("/page")
@IgnoreAuth
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 调用服务层方法查询分页数据
PageUtils page = dictionaryService.queryPage(params);
// 字典表数据转换
List<DictionaryView> list = (List<DictionaryView>) page.getList();
for (DictionaryView c : list) {
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
// 返回查询结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询字典实体
DictionaryEntity dictionary = dictionaryService.selectById(id);
if (dictionary != null) {
// 实体转视图
DictionaryView view = new DictionaryView();
BeanUtils.copyProperties(dictionary, view); // 把实体数据重构到视图中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回查询结果
return R.ok().put("data", view);
} else {
// 返回错误信息
return R.error(511, "查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request) {
// 记录日志
logger.debug("save方法:,,Controller:{},,dictionary:{}", this.getClass().getName(), dictionary.toString());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
if (false)
return R.error(511, "永远不会进入");
// 构建查询条件
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.eq("index_name", dictionary.getIndexName());
if (dictionary.getDicCode().contains("_erji_types")) {
queryWrapper.eq("super_id", dictionary.getSuperId());
}
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);
if (dictionaryEntity == null) {
// 设置创建时间
dictionary.setCreateTime(new Date());
// 插入新数据
dictionaryService.insert(dictionary);
// 字典表新增数据,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = request.getServletContext();
Map<String, Map<Integer, String>> map = new HashMap<>();
for (DictionaryEntity d : dictionaryEntities) {
Map<Integer, String> m = map.get(d.getDicCode());
if (m == null || m.isEmpty()) {
m = new HashMap<>();
}
m.put(d.getCodeIndex(), d.getIndexName());
map.put(d.getDicCode(), m);
}
servletContext.setAttribute("dictionaryMap", map);
// 返回成功信息
return R.ok();
} else {
// 返回错误信息
return R.error(511, "表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,dictionary:{}", this.getClass().getName(), dictionary.toString());
// 查询原先数据
DictionaryEntity oldDictionaryEntity = dictionaryService.selectById(dictionary.getId());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// 根据ID更新数据
dictionaryService.updateById(dictionary);
// 如果字典表修改数据的话,把数据再重新查出,放入监听器中
List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());
ServletContext servletContext = request.getServletContext();
Map<String, Map<Integer, String>> map = new HashMap<>();
for (DictionaryEntity d : dictionaryEntities) {
Map<Integer, String> m = map.get(d.getDicCode());
if (m == null || m.isEmpty()) {
m = new HashMap<>();
}
m.put(d.getCodeIndex(), d.getIndexName());
map.put(d.getDicCode(), m);
}
servletContext.setAttribute("dictionaryMap", map);
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 查询要删除的数据
List<DictionaryEntity> oldDictionaryList = dictionaryService.selectBatchIds(Arrays.asList(ids));
// 批量删除数据
dictionaryService.deleteBatchIds(Arrays.asList(ids));
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/maxCodeIndex")
public R maxCodeIndex(@RequestBody DictionaryEntity dictionary) {
// 记录日志
logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}", this.getClass().getName(), dictionary.toString());
// 设置排序字段
List<String> descs = new ArrayList<>();
descs.add("code_index");
// 构建查询条件
Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>()
.eq("dic_code", dictionary.getDicCode())
.orderDesc(descs);
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询列表
List<DictionaryEntity> dictionaryEntityList = dictionaryService.selectList(queryWrapper);
if (dictionaryEntityList.size() > 0) {
// 返回最大codeIndex + 1
return R.ok().put("maxCodeIndex", dictionaryEntityList.get(0).getCodeIndex() + 1);
} else {
// 返回默认值1
return R.ok().put("maxCodeIndex", 1);
}
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save(String fileName, HttpServletRequest request) {
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 获取当前用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 设置日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
// 初始化字典实体列表
List<DictionaryEntity> dictionaryList = new ArrayList<>(); // 上传的东西
// 初始化要查询的字段
Map<String, List<String>> seachFields = new HashMap<>(); // 要查询的字段
// 获取当前时间
Date date = new Date();
// 获取文件后缀
int lastIndexOf = fileName.lastIndexOf(".");
if (lastIndexOf == -1) {
// 返回错误信息
return R.error(511, "该文件没有后缀");
} else {
// 获取文件后缀
String suffix = fileName.substring(lastIndexOf);
if (!".xls".equals(suffix)) {
// 返回错误信息
return R.error(511, "只支持后缀为xls的excel文件");
} else {
// 获取文件路径
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
File file = new File(resource.getFile());
if (!file.exists()) {
// 返回错误信息
return R.error(511, "找不到上传文件,请联系管理员");
} else {
// 读取xls文件
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
dataList.remove(0); // 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
DictionaryEntity dictionaryEntity = new DictionaryEntity();
// dictionaryEntity.setDicCode(data.get(0)); // 字段 要改的
// dictionaryEntity.setDicName(data.get(0)); // 字段名 要改的
// dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0))); // 编码 要改的
// dictionaryEntity.setIndexName(data.get(0)); // 编码名字 要改的
// dictionaryEntity.setSuperId(Integer.valueOf(data.get(0))); // 父字段id 要改的
// dictionaryEntity.setBeizhu(data.get(0)); // 备注 要改的
// dictionaryEntity.setCreateTime(date);// 时间
dictionaryList.add(dictionaryEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
dictionaryService.insertBatch(dictionaryList);
// 返回成功信息
return R.ok();
}
}
}
} catch (Exception e) {
// 打印异常堆栈信息
e.printStackTrace();
// 返回错误信息
return R.error(511, "批量插入数据异常,请联系管理员");
}
}
}

@ -0,0 +1,133 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;
/**
*
*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController {
// 自动注入ConfigService
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/upload")
public R upload(@RequestParam("file") MultipartFile file, String type) throws Exception {
// 检查文件是否为空
if (file.isEmpty()) {
throw new EIException("上传文件不能为空");
}
// 获取文件扩展名
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
// 获取静态资源路径
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
// 如果路径不存在,则设置为当前路径
if (!path.exists()) {
path = new File("");
}
// 创建上传文件夹路径
File upload = new File(path.getAbsolutePath(), "/upload/");
// 如果上传文件夹不存在,则创建
if (!upload.exists()) {
upload.mkdirs();
}
// 生成文件名(时间戳+扩展名)
String fileName = new Date().getTime() + "." + fileExt;
// 创建目标文件对象
File dest = new File(upload.getAbsolutePath() + "/" + fileName);
// 将上传的文件保存到目标文件
file.transferTo(dest);
// 如果类型为1则更新配置表中的faceFile字段
if (StringUtils.isNotBlank(type) && type.equals("1")) {
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
if (configEntity == null) {
configEntity = new ConfigEntity();
configEntity.setName("faceFile");
configEntity.setValue(fileName);
} else {
configEntity.setValue(fileName);
}
// 插入或更新配置实体
configService.insertOrUpdate(configEntity);
}
// 返回成功信息,包含文件名
return R.ok().put("file", fileName);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/download")
public ResponseEntity<byte[]> download(@RequestParam String fileName) {
try {
// 获取静态资源路径
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
// 如果路径不存在,则设置为当前路径
if (!path.exists()) {
path = new File("");
}
// 创建上传文件夹路径
File upload = new File(path.getAbsolutePath(), "/upload/");
// 如果上传文件夹不存在,则创建
if (!upload.exists()) {
upload.mkdirs();
}
// 创建目标文件对象
File file = new File(upload.getAbsolutePath() + "/" + fileName);
// 检查文件是否存在
if (file.exists()) {
/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
getResponse().sendError(403);
}*/
// 设置HTTP头信息
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
headers.setContentDispositionFormData("attachment", fileName);
// 读取文件内容并返回
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file), headers, HttpStatus.CREATED);
}
} catch (IOException e) {
// 打印异常堆栈信息
e.printStackTrace();
}
// 返回内部服务器错误
return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}

@ -0,0 +1,425 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/forum")
public class ForumController {
// 定义日志记录器
private static final Logger logger = LoggerFactory.getLogger(ForumController.class);
// 定义表名常量
private static final String TABLE_NAME = "forum";
// 自动注入ForumService
@Autowired
private ForumService forumService;
// 自动注入TokenService
@Autowired
private TokenService tokenService;
// 自动注入DictionaryService
@Autowired
private DictionaryService dictionaryService; // 字典
// 自动注入GerentizhengService
@Autowired
private GerentizhengService gerentizhengService; // 体检记录
// 自动注入JiankangtieshiService
@Autowired
private JiankangtieshiService jiankangtieshiService; // 健康贴士
// 自动注入MeirijihuaService
@Autowired
private MeirijihuaService meirijihuaService; // 每日计划
// 自动注入MeishiService
@Autowired
private MeishiService meishiService; // 健康食谱
// 自动注入MeishiCollectionService
@Autowired
private MeishiCollectionService meishiCollectionService; // 健康食谱收藏
// 自动注入MeishiLiuyanService
@Autowired
private MeishiLiuyanService meishiLiuyanService; // 健康食谱留言
// 自动注入NewsService
@Autowired
private NewsService newsService; // 公告信息
// 自动注入YaopinService
@Autowired
private YaopinService yaopinService; // 药品信息
// 自动注入YonghuService
@Autowired
private YonghuService yonghuService; // 用户
// 自动注入YundongService
@Autowired
private YundongService yundongService; // 运动教程
// 自动注入YundongCollectionService
@Autowired
private YundongCollectionService yundongCollectionService; // 运动教程收藏
// 自动注入YundongLiuyanService
@Autowired
private YundongLiuyanService yundongLiuyanService; // 运动教程留言
// 自动注入UsersService
@Autowired
private UsersService usersService; // 管理员
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 调用服务层方法查询分页数据
PageUtils page = forumService.queryPage(params);
// 字典表数据转换
List<ForumView> list = (List<ForumView>) page.getList();
for (ForumView c : list) {
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
// 返回查询结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询论坛实体
ForumEntity forum = forumService.selectById(id);
if (forum != null) {
// 实体转视图
ForumView view = new ForumView();
BeanUtils.copyProperties(forum, view); // 把实体数据重构到视图中
// 级联表 用户
YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createTime", "insertTime", "updateTime", "yonghuId", "usersId"}); // 把级联的数据添加到视图中并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 级联表 管理员
UsersEntity users = usersService.selectById(forum.getUsersId());
if (users != null) {
view.setUsersId(users.getId());
view.setUusername(users.getUsername());
view.setUpassword(users.getPassword());
view.setUrole(users.getRole());
view.setUaddtime(users.getAddtime());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回查询结果
return R.ok().put("data", view);
} else {
// 返回错误信息
return R.error(511, "查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ForumEntity forum, HttpServletRequest request) {
// 记录日志
logger.debug("save方法:,,Controller:{},,forum:{}", this.getClass().getName(), forum.toString());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
if (false)
return R.error(511, "永远不会进入");
else if ("用户".equals(role))
forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
else if ("管理员".equals(role))
forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 构建查询条件
Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()
.eq("forum_name", forum.getForumName())
.eq("yonghu_id", forum.getYonghuId())
.eq("users_id", forum.getUsersId())
.eq("super_ids", forum.getSuperIds())
.eq("forum_state_types", forum.getForumStateTypes());
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
ForumEntity forumEntity = forumService.selectOne(queryWrapper);
if (forumEntity == null) {
// 设置插入时间和创建时间
forum.setInsertTime(new Date());
forum.setCreateTime(new Date());
// 插入新数据
forumService.insert(forum);
// 返回成功信息
return R.ok();
} else {
// 返回错误信息
return R.error(511, "表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ForumEntity forum, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,forum:{}", this.getClass().getName(), forum.toString());
// 查询原先数据
ForumEntity oldForumEntity = forumService.selectById(forum.getId());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// else if("管理员".equals(role))
// forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 设置更新时间
forum.setUpdateTime(new Date());
// 根据ID更新数据
forumService.updateById(forum);
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 查询要删除的数据
List<ForumEntity> oldForumList = forumService.selectBatchIds(Arrays.asList(ids));
// 批量删除数据
forumService.deleteBatchIds(Arrays.asList(ids));
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save(String fileName, HttpServletRequest request) {
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 获取当前用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 设置日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
// 初始化论坛实体列表
List<ForumEntity> forumList = new ArrayList<>(); // 上传的东西
// 初始化要查询的字段
Map<String, List<String>> seachFields = new HashMap<>(); // 要查询的字段
// 获取当前时间
Date date = new Date();
// 获取文件后缀
int lastIndexOf = fileName.lastIndexOf(".");
if (lastIndexOf == -1) {
// 返回错误信息
return R.error(511, "该文件没有后缀");
} else {
// 获取文件后缀
String suffix = fileName.substring(lastIndexOf);
if (!".xls".equals(suffix)) {
// 返回错误信息
return R.error(511, "只支持后缀为xls的excel文件");
} else {
// 获取文件路径
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
File file = new File(resource.getFile());
if (!file.exists()) {
// 返回错误信息
return R.error(511, "找不到上传文件,请联系管理员");
} else {
// 读取xls文件
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
dataList.remove(0); // 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
ForumEntity forumEntity = new ForumEntity();
// forumEntity.setForumName(data.get(0)); // 帖子标题 要改的
// forumEntity.setYonghuId(Integer.valueOf(data.get(0))); // 用户 要改的
// forumEntity.setUsersId(Integer.valueOf(data.get(0))); // 管理员 要改的
// forumEntity.setForumContent("");// 详情和图片
// forumEntity.setSuperIds(Integer.valueOf(data.get(0))); // 父id 要改的
// forumEntity.setForumStateTypes(Integer.valueOf(data.get(0))); // 帖子状态 要改的
// forumEntity.setInsertTime(date);// 时间
// forumEntity.setUpdateTime(sdf.parse(data.get(0))); // 修改时间 要改的
// forumEntity.setCreateTime(date);// 时间
forumList.add(forumEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
forumService.insertBatch(forumList);
// 返回成功信息
return R.ok();
}
}
}
} catch (Exception e) {
// 打印异常堆栈信息
e.printStackTrace();
// 返回错误信息
return R.error(511, "批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 调用服务层方法查询分页数据
PageUtils page = forumService.queryPage(params);
// 字典表数据转换
List<ForumView> list = (List<ForumView>) page.getList();
for (ForumView c : list)
dictionaryService.dictionaryConvert(c, request); // 修改对应字典表字段
// 返回查询结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询论坛实体
ForumEntity forum = forumService.selectById(id);
if (forum != null) {
// 实体转视图
ForumView view = new ForumView();
BeanUtils.copyProperties(forum, view); // 把实体数据重构到视图中
// 级联表 用户
YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createDate"}); // 把级联的数据添加到视图中并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 级联表 管理员
UsersEntity users = usersService.selectById(forum.getUsersId());
if (users != null) {
view.setUsersId(users.getId());
view.setUusername(users.getUsername());
view.setUpassword(users.getPassword());
view.setUrole(users.getRole());
view.setUaddtime(users.getAddtime());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回查询结果
return R.ok().put("data", view);
} else {
// 返回错误信息
return R.error(511, "查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ForumEntity forum, HttpServletRequest request) {
// 记录日志
logger.debug("add方法:,,Controller:{},,forum:{}", this.getClass().getName(), forum.toString());
// 构建查询条件
Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()
.eq("forum_name", forum.getForumName())
.eq("yonghu_id", forum.getYonghuId())
.eq("users_id", forum.getUsersId())
.eq("super_ids", forum.getSuperIds())
.eq("forum_state_types", forum.getForumStateTypes());
// .notIn("forum_types", new Integer[]{102});
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
ForumEntity forumEntity = forumService.selectOne(queryWrapper);
if (forumEntity == null) {
// 设置插入时间和创建时间
forum.setInsertTime(new Date());
forum.setCreateTime(new Date());
// 插入新数据
forumService.insert(forum);
// 返回成功信息
return R.ok();
} else {
// 返回错误信息
return R.error(511, "表中有相同数据");
}
}
}

@ -0,0 +1,385 @@
package com.controller;
// 导入用于处理文件操作的类
import java.io.File;
// 导入用于处理高精度数值计算的类
import java.math.BigDecimal;
// 导入用于处理 URL 相关操作的类
import java.net.URL;
// 导入用于格式化日期的类
import java.text.SimpleDateFormat;
// 导入阿里巴巴的 FastJSON 库中的 JSONObject 类,用于处理 JSON 数据
import com.alibaba.fastjson.JSONObject;
// 导入 Java 中的各种集合类
import java.util.*;
// 导入 Spring 框架中用于复制 Bean 属性的类
import org.springframework.beans.BeanUtils;
// 导入用于处理 HTTP 请求的类
import javax.servlet.http.HttpServletRequest;
// 导入 Spring 框架中用于获取 Web 应用上下文的类
import org.springframework.web.context.ContextLoader;
// 导入用于表示 Servlet 上下文的类
import javax.servlet.ServletContext;
// 导入自定义的 Token 服务类
import com.service.TokenService;
// 导入自定义的工具类包中的所有类
import com.utils.*;
// 导入用于处理反射相关异常的类
import java.lang.reflect.InvocationTargetException;
// 导入自定义的字典服务类
import com.service.DictionaryService;
// 导入 Apache Commons Lang 库中用于处理字符串的工具类
import org.apache.commons.lang3.StringUtils;
// 导入自定义的忽略认证注解
import com.annotation.IgnoreAuth;
// 导入用于记录日志的接口
import org.slf4j.Logger;
// 导入用于创建日志记录器的工厂类
import org.slf4j.LoggerFactory;
// 导入 Spring 框架中用于标记控制器的注解
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
// 导入 Spring 框架中用于处理请求映射的注解
import org.springframework.web.bind.annotation.*;
// 导入 MyBatis-Plus 框架中用于构建实体包装器的类
import com.baomidou.mybatisplus.mapper.EntityWrapper;
// 导入 MyBatis-Plus 框架中的包装器接口
import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入自定义的各种实体类
import com.entity.*;
// 导入自定义的各种视图类
import com.entity.view.*;
// 导入自定义的各种服务类
import com.service.*;
// 导入自定义的分页工具类
import com.utils.PageUtils;
// 导入自定义的返回结果类
import com.utils.R;
// 再次导入阿里巴巴的 FastJSON 库中的相关类
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
// 使用 @RestController 注解将该类标记为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 数据
@RestController
// 使用 @Controller 注解将该类标记为控制器,用于处理 Web 请求
@Controller
// 使用 @RequestMapping 注解将该控制器的所有请求映射到 /gerentizheng 路径
@RequestMapping("/gerentizheng")
public class GerentizhengController {
// 创建一个日志记录器,用于记录该控制器类的日志信息
private static final Logger logger = LoggerFactory.getLogger(GerentizhengController.class);
// 定义一个常量,表示数据库表名
private static final String TABLE_NAME = "gerentizheng";
// 使用 @Autowired 注解自动注入 GerentizhengService 实例
@Autowired
private GerentizhengService gerentizhengService;
// 使用 @Autowired 注解自动注入 TokenService 实例
@Autowired
private TokenService tokenService;
// 使用 @Autowired 注解自动注入 DictionaryService 实例,用于处理字典相关业务
@Autowired
private DictionaryService dictionaryService;//字典
// 使用 @Autowired 注解自动注入 ForumService 实例,用于处理论坛相关业务
@Autowired
private ForumService forumService;//论坛
// 使用 @Autowired 注解自动注入 JiankangtieshiService 实例,用于处理健康贴士相关业务
@Autowired
private JiankangtieshiService jiankangtieshiService;//健康贴士
// 使用 @Autowired 注解自动注入 MeirijihuaService 实例,用于处理每日计划相关业务
@Autowired
private MeirijihuaService meirijihuaService;//每日计划
// 使用 @Autowired 注解自动注入 MeishiService 实例,用于处理健康食谱相关业务
@Autowired
private MeishiService meishiService;//健康食谱
// 使用 @Autowired 注解自动注入 MeishiCollectionService 实例,用于处理健康食谱收藏相关业务
@Autowired
private MeishiCollectionService meishiCollectionService;//健康食谱收藏
// 使用 @Autowired 注解自动注入 MeishiLiuyanService 实例,用于处理健康食谱留言相关业务
@Autowired
private MeishiLiuyanService meishiLiuyanService;//健康食谱留言
// 使用 @Autowired 注解自动注入 NewsService 实例,用于处理公告信息相关业务
@Autowired
private NewsService newsService;//公告信息
// 使用 @Autowired 注解自动注入 YaopinService 实例,用于处理药品信息相关业务
@Autowired
private YaopinService yaopinService;//药品信息
// 使用 @Autowired 注解自动注入 YonghuService 实例,用于处理用户相关业务
@Autowired
private YonghuService yonghuService;//用户
// 使用 @Autowired 注解自动注入 YundongService 实例,用于处理运动教程相关业务
@Autowired
private YundongService yundongService;//运动教程
// 使用 @Autowired 注解自动注入 YundongCollectionService 实例,用于处理运动教程收藏相关业务
@Autowired
private YundongCollectionService yundongCollectionService;//运动教程收藏
// 使用 @Autowired 注解自动注入 YundongLiuyanService 实例,用于处理运动教程留言相关业务
@Autowired
private YundongLiuyanService yundongLiuyanService;//运动教程留言
// 使用 @Autowired 注解自动注入 UsersService 实例,用于处理管理员相关业务
@Autowired
private UsersService usersService;//管理员
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ForumEntity forum, HttpServletRequest request) {
// 记录日志
logger.debug("save方法:,,Controller:{},,forum:{}", this.getClass().getName(), forum.toString());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
if (false)
return R.error(511, "永远不会进入");
else if ("用户".equals(role))
forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
else if ("管理员".equals(role))
forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 构建查询条件
Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()
.eq("forum_name", forum.getForumName())
.eq("yonghu_id", forum.getYonghuId())
.eq("users_id", forum.getUsersId())
.eq("super_ids", forum.getSuperIds())
.eq("forum_state_types", forum.getForumStateTypes());
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
ForumEntity forumEntity = forumService.selectOne(queryWrapper);
if (forumEntity == null) {
// 设置插入时间和创建时间
forum.setInsertTime(new Date());
forum.setCreateTime(new Date());
// 插入新数据
forumService.insert(forum);
// 返回成功信息
return R.ok();
} else {
// 返回错误信息
return R.error(511, "表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody ForumEntity forum, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,forum:{}", this.getClass().getName(), forum.toString());
// 查询原先数据
ForumEntity oldForumEntity = forumService.selectById(forum.getId());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// else if("管理员".equals(role))
// forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 设置更新时间
forum.setUpdateTime(new Date());
// 根据ID更新数据
forumService.updateById(forum);
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 查询要删除的数据
List<ForumEntity> oldForumList = forumService.selectBatchIds(Arrays.asList(ids));
// 批量删除数据
forumService.deleteBatchIds(Arrays.asList(ids));
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save(String fileName, HttpServletRequest request) {
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 获取当前用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 设置日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
// 初始化论坛实体列表
List<ForumEntity> forumList = new ArrayList<>(); // 上传的东西
// 初始化要查询的字段
Map<String, List<String>> seachFields = new HashMap<>(); // 要查询的字段
// 获取当前时间
Date date = new Date();
// 获取文件后缀
int lastIndexOf = fileName.lastIndexOf(".");
if (lastIndexOf == -1) {
// 返回错误信息
return R.error(511, "该文件没有后缀");
} else {
// 获取文件后缀
String suffix = fileName.substring(lastIndexOf);
if (!".xls".equals(suffix)) {
// 返回错误信息
return R.error(511, "只支持后缀为xls的excel文件");
} else {
// 获取文件路径
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
File file = new File(resource.getFile());
if (!file.exists()) {
// 返回错误信息
return R.error(511, "找不到上传文件,请联系管理员");
} else {
// 读取xls文件
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
dataList.remove(0); // 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
ForumEntity forumEntity = new ForumEntity();
// forumEntity.setForumName(data.get(0)); // 帖子标题 要改的
// forumEntity.setYonghuId(Integer.valueOf(data.get(0))); // 用户 要改的
// forumEntity.setUsersId(Integer.valueOf(data.get(0))); // 管理员 要改的
// forumEntity.setForumContent("");// 详情和图片
// forumEntity.setSuperIds(Integer.valueOf(data.get(0))); // 父id 要改的
// forumEntity.setForumStateTypes(Integer.valueOf(data.get(0))); // 帖子状态 要改的
// forumEntity.setInsertTime(date);// 时间
// forumEntity.setUpdateTime(sdf.parse(data.get(0))); // 修改时间 要改的
// forumEntity.setCreateTime(date);// 时间
forumList.add(forumEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
forumService.insertBatch(forumList);
// 返回成功信息
return R.ok();
}
}
}
} catch (Exception e) {
// 打印异常堆栈信息
e.printStackTrace();
// 返回错误信息
return R.error(511, "批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 调用服务层方法查询分页数据
PageUtils page = forumService.queryPage(params);
// 字典表数据转换
List<ForumView> list = (List<ForumView>) page.getList();
for (ForumView c : list)
dictionaryService.dictionaryConvert(c, request); // 修改对应字典表字段
// 返回查询结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询论坛实体
ForumEntity forum = forumService.selectById(id);
if (forum != null) {
// 实体转视图
ForumView view = new ForumView();
BeanUtils.copyProperties(forum, view); // 把实体数据重构到视图中
// 级联表 用户
YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createDate"}); // 把级联的数据添加到视图中并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 级联表 管理员
UsersEntity users = usersService.selectById(forum.getUsersId());
if (users != null) {
view.setUsersId(users.getId());
view.setUusername(users.getUsername());
view.setUpassword(users.getPassword());
view.setUrole(users.getRole());
view.setUaddtime(users.getAddtime());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回查询结果
return R.ok().put("data", view);
} else {
// 返回错误信息
return R.error(511, "查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody ForumEntity forum, HttpServletRequest request) {
// 记录日志
logger.debug("add方法:,,Controller:{},,forum:{}", this.getClass().getName(), forum.toString());
// 构建查询条件
Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()
.eq("forum_name", forum.getForumName())
.eq("yonghu_id", forum.getYonghuId())
.eq("users_id", forum.getUsersId())
.eq("super_ids", forum.getSuperIds())
.eq("forum_state_types", forum.getForumStateTypes());
// .notIn("forum_types", new Integer[]{102});
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
ForumEntity forumEntity = forumService.selectOne(queryWrapper);
if (forumEntity == null) {
// 设置插入时间和创建时间
forum.setInsertTime(new Date());
forum.setCreateTime(new Date());
// 插入新数据
forumService.insert(forum);
// 返回成功信息
return R.ok();
} else {
// 返回错误信息
return R.error(511, "表中有相同数据");
}
}
}

@ -0,0 +1,416 @@
package com.controller;
// 声明该类所在的包为 com.controller包用于组织和管理 Java 类,避免命名冲突
// 导入用于处理文件操作的类,可能用于文件上传、下载等功能
import java.io.File;
// 导入用于高精度数值计算的类,常用于处理货币、金融等领域的数值计算
import java.math.BigDecimal;
// 导入用于处理 URL 相关操作的类,比如获取网络资源等
import java.net.URL;
// 导入用于格式化日期的类,可将日期按照指定格式进行转换
import java.text.SimpleDateFormat;
// 导入阿里巴巴的 FastJSON 库中的 JSONObject 类,用于处理 JSON 数据,如解析、生成 JSON 对象
import com.alibaba.fastjson.JSONObject;
// 导入 Java 中的各种集合类,如 List、Map、Set 等,用于数据存储和处理
import java.util.*;
// 导入 Spring 框架中用于复制 Bean 属性的类,方便在不同对象间复制属性值
import org.springframework.beans.BeanUtils;
// 导入用于处理 HTTP 请求的类,在 Web 开发中获取请求相关信息
import javax.servlet.http.HttpServletRequest;
// 导入 Spring 框架中用于获取 Web 应用上下文的类,可获取应用的全局信息
import org.springframework.web.context.ContextLoader;
// 导入用于表示 Servlet 上下文的类,包含了 Servlet 应用的相关信息
import javax.servlet.ServletContext;
// 导入自定义的 Token 服务类,可能用于处理用户认证、授权中的 Token 相关逻辑
import com.service.TokenService;
// 导入自定义的工具类包中的所有类,工具类通常包含一些通用的方法,如字符串处理、数据验证等
import com.utils.*;
// 导入用于处理反射相关异常的类,反射操作中可能会抛出此类异常
import java.lang.reflect.InvocationTargetException;
// 导入自定义的字典服务类,可能用于处理字典数据的增删改查等操作
import com.service.DictionaryService;
// 导入 Apache Commons Lang 库中用于处理字符串的工具类,提供了丰富的字符串操作方法
import org.apache.commons.lang3.StringUtils;
// 导入自定义的忽略认证注解,用于标记不需要进行认证的方法或接口
import com.annotation.IgnoreAuth;
// 导入用于记录日志的接口,用于记录应用运行过程中的信息
import org.slf4j.Logger;
// 导入用于创建日志记录器的工厂类,通过该类创建具体的日志记录器
import org.slf4j.LoggerFactory;
// 导入 Spring 框架中用于自动注入依赖的注解,简化 Bean 的注入过程
import org.springframework.beans.factory.annotation.Autowired;
// 导入 Spring 框架中用于标记控制器的注解,表明该类是一个处理 Web 请求的控制器
import org.springframework.stereotype.Controller;
// 导入 Spring 框架中用于处理请求映射的注解,如 @RequestMapping、@GetMapping 等
import org.springframework.web.bind.annotation.*;
// 导入 MyBatis-Plus 框架中用于构建实体包装器的类,用于构建查询条件等
import com.baomidou.mybatisplus.mapper.EntityWrapper;
// 导入 MyBatis-Plus 框架中的包装器接口,提供了统一的包装器操作方法
import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入自定义的各种实体类,实体类通常对应数据库中的表结构
import com.entity.*;
// 导入自定义的各种视图类,视图类可能用于封装特定的业务视图数据
import com.entity.view.*;
// 导入自定义的各种服务类,服务类通常包含具体的业务逻辑实现
import com.service.*;
// 导入自定义的分页工具类,用于处理数据的分页操作
import com.utils.PageUtils;
// 导入自定义的返回结果类,用于统一封装接口的返回结果
import com.utils.R;
// 再次导入阿里巴巴的 FastJSON 库中的相关类,可能用于更全面的 JSON 数据处理
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/jiankangtieshi")
public class JiankangtieshiController {
// 定义日志记录器
private static final Logger logger = LoggerFactory.getLogger(JiankangtieshiController.class);
// 定义表名常量
private static final String TABLE_NAME = "jiankangtieshi";
// 自动注入JiankangtieshiService
@Autowired
private JiankangtieshiService jiankangtieshiService;
// 自动注入TokenService
@Autowired
private TokenService tokenService;
// 自动注入DictionaryService
@Autowired
private DictionaryService dictionaryService; // 字典
// 自动注入ForumService
@Autowired
private ForumService forumService; // 论坛
// 自动注入GerentizhengService
@Autowired
private GerentizhengService gerentizhengService; // 体检记录
// 自动注入MeirijihuaService
@Autowired
private MeirijihuaService meirijihuaService; // 每日计划
// 自动注入MeishiService
@Autowired
private MeishiService meishiService; // 健康食谱
// 自动注入MeishiCollectionService
@Autowired
private MeishiCollectionService meishiCollectionService; // 健康食谱收藏
// 自动注入MeishiLiuyanService
@Autowired
private MeishiLiuyanService meishiLiuyanService; // 健康食谱留言
// 自动注入NewsService
@Autowired
private NewsService newsService; // 公告信息
// 自动注入YaopinService
@Autowired
private YaopinService yaopinService; // 药品信息
// 自动注入YonghuService
@Autowired
private YonghuService yonghuService; // 用户
// 自动注入YundongService
@Autowired
private YundongService yundongService; // 运动教程
// 自动注入YundongCollectionService
@Autowired
private YundongCollectionService yundongCollectionService; // 运动教程收藏
// 自动注入YundongLiuyanService
@Autowired
private YundongLiuyanService yundongLiuyanService; // 运动教程留言
// 自动注入UsersService
@Autowired
private UsersService usersService; // 管理员
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
if (false)
return R.error(511, "永不会进入");
else if ("用户".equals(role))
params.put("yonghuId", request.getSession().getAttribute("userId"));
// 检查参数
CommonUtil.checkMap(params);
// 调用服务层方法查询分页数据
PageUtils page = jiankangtieshiService.queryPage(params);
// 字典表数据转换
List<JiankangtieshiView> list = (List<JiankangtieshiView>) page.getList();
for (JiankangtieshiView c : list) {
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
// 返回查询结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询健康贴士实体
JiankangtieshiEntity jiankangtieshi = jiankangtieshiService.selectById(id);
if (jiankangtieshi != null) {
// 实体转视图
JiankangtieshiView view = new JiankangtieshiView();
BeanUtils.copyProperties(jiankangtieshi, view); // 把实体数据重构到视图中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回查询结果
return R.ok().put("data", view);
} else {
// 返回错误信息
return R.error(511, "查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody JiankangtieshiEntity jiankangtieshi, HttpServletRequest request) {
// 记录日志
logger.debug("save方法:,,Controller:{},,jiankangtieshi:{}", this.getClass().getName(), jiankangtieshi.toString());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
if (false)
return R.error(511, "永远不会进入");
// 构建查询条件
Wrapper<JiankangtieshiEntity> queryWrapper = new EntityWrapper<JiankangtieshiEntity>()
.eq("jiankangtieshi_name", jiankangtieshi.getJiankangtieshiName())
.eq("jiankangtieshi_types", jiankangtieshi.getJiankangtieshiTypes());
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
JiankangtieshiEntity jiankangtieshiEntity = jiankangtieshiService.selectOne(queryWrapper);
if (jiankangtieshiEntity == null) {
// 设置插入时间和创建时间
jiankangtieshi.setInsertTime(new Date());
jiankangtieshi.setCreateTime(new Date());
// 插入新数据
jiankangtieshiService.insert(jiankangtieshi);
// 返回成功信息
return R.ok();
} else {
// 返回错误信息
return R.error(511, "表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody JiankangtieshiEntity jiankangtieshi, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,jiankangtieshi:{}", this.getClass().getName(), jiankangtieshi.toString());
// 查询原先数据
JiankangtieshiEntity oldJiankangtieshiEntity = jiankangtieshiService.selectById(jiankangtieshi.getId());
// 获取当前用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// 处理图片字段
if ("".equals(jiankangtieshi.getJiankangtieshiPhoto()) || "null".equals(jiankangtieshi.getJiankangtieshiPhoto())) {
jiankangtieshi.setJiankangtieshiPhoto(null);
}
// 根据ID更新数据
jiankangtieshiService.updateById(jiankangtieshi);
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 查询要删除的数据
List<JiankangtieshiEntity> oldJiankangtieshiList = jiankangtieshiService.selectBatchIds(Arrays.asList(ids));
// 批量删除数据
jiankangtieshiService.deleteBatchIds(Arrays.asList(ids));
// 返回成功信息
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save(String fileName, HttpServletRequest request) {
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 获取当前用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 设置日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
// 初始化健康贴士实体列表
List<JiankangtieshiEntity> jiankangtieshiList = new ArrayList<>(); // 上传的东西
// 初始化要查询的字段
Map<String, List<String>> seachFields = new HashMap<>(); // 要查询的字段
// 获取当前时间
Date date = new Date();
// 获取文件后缀
int lastIndexOf = fileName.lastIndexOf(".");
if (lastIndexOf == -1) {
// 返回错误信息
return R.error(511, "该文件没有后缀");
} else {
// 获取文件后缀
String suffix = fileName.substring(lastIndexOf);
if (!".xls".equals(suffix)) {
// 返回错误信息
return R.error(511, "只支持后缀为xls的excel文件");
} else {
// 获取文件路径
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
File file = new File(resource.getFile());
if (!file.exists()) {
// 返回错误信息
return R.error(511, "找不到上传文件,请联系管理员");
} else {
// 读取xls文件
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
dataList.remove(0); // 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
JiankangtieshiEntity jiankangtieshiEntity = new JiankangtieshiEntity();
// jiankangtieshiEntity.setJiankangtieshiName(data.get(0)); // 贴士标题 要改的
// jiankangtieshiEntity.setJiankangtieshiTypes(Integer.valueOf(data.get(0))); // 贴士类型 要改的
// jiankangtieshiEntity.setJiankangtieshiPhoto("");// 详情和图片
// jiankangtieshiEntity.setInsertTime(date);// 时间
// jiankangtieshiEntity.setJiankangtieshiContent("");// 详情和图片
// jiankangtieshiEntity.setCreateTime(date);// 时间
jiankangtieshiList.add(jiankangtieshiEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
jiankangtieshiService.insertBatch(jiankangtieshiList);
// 返回成功信息
return R.ok();
}
}
}
} catch (Exception e) {
// 打印异常堆栈信息
e.printStackTrace();
// 返回错误信息
return R.error(511, "批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 调用服务层方法查询分页数据
PageUtils page = jiankangtieshiService.queryPage(params);
// 字典表数据转换
List<JiankangtieshiView> list = (List<JiankangtieshiView>) page.getList();
for (JiankangtieshiView c : list)
dictionaryService.dictionaryConvert(c, request); // 修改对应字典表字段
// 返回查询结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询健康贴士实体
JiankangtieshiEntity jiankangtieshi = jiankangtieshiService.selectById(id);
if (jiankangtieshi != null) {
// 实体转视图
JiankangtieshiView view = new JiankangtieshiView();
BeanUtils.copyProperties(jiankangtieshi, view); // 把实体数据重构到视图中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回查询结果
return R.ok().put("data", view);
} else {
// 返回错误信息
return R.error(511, "查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody JiankangtieshiEntity jiankangtieshi, HttpServletRequest request) {
// 记录日志
logger.debug("add方法:,,Controller:{},,jiankangtieshi:{}", this.getClass().getName(), jiankangtieshi.toString());
// 构建查询条件
Wrapper<JiankangtieshiEntity> queryWrapper = new EntityWrapper<JiankangtieshiEntity>()
.eq("jiankangtieshi_name", jiankangtieshi.getJiankangtieshiName())
.eq("jiankangtieshi_types", jiankangtieshi.getJiankangtieshiTypes());
// .notIn("jiankangtieshi_types", new Integer[]{102});
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
JiankangtieshiEntity jiankangtieshiEntity = jiankangtieshiService.selectOne(queryWrapper);
if (jiankangtieshiEntity == null) {
// 设置插入时间和创建时间
jiankangtieshi.setInsertTime(new Date());
jiankangtieshi.setCreateTime(new Date());
// 插入新数据
jiankangtieshiService.insert(jiankangtieshi);
// 返回成功信息
return R.ok();
} else {
// 返回错误信息
return R.error(511, "表中有相同数据");
}
}
}

@ -0,0 +1,441 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/meirijihua")
public class MeirijihuaController {
// 日志记录器
private static final Logger logger = LoggerFactory.getLogger(MeirijihuaController.class);
// 表名常量
private static final String TABLE_NAME = "meirijihua";
// 自动注入每日计划服务
@Autowired
private MeirijihuaService meirijihuaService;
// 自动注入Token服务
@Autowired
private TokenService tokenService;
// 自动注入字典服务
@Autowired
private DictionaryService dictionaryService;
// 自动注入论坛服务
@Autowired
private ForumService forumService;
// 自动注入体检记录服务
@Autowired
private GerentizhengService gerentizhengService;
// 自动注入健康贴士服务
@Autowired
private JiankangtieshiService jiankangtieshiService;
// 自动注入健康食谱服务
@Autowired
private MeishiService meishiService;
// 自动注入健康食谱收藏服务
@Autowired
private MeishiCollectionService meishiCollectionService;
// 自动注入健康食谱留言服务
@Autowired
private MeishiLiuyanService meishiLiuyanService;
// 自动注入公告信息服务
@Autowired
private NewsService newsService;
// 自动注入药品信息服务
@Autowired
private YaopinService yaopinService;
// 自动注入用户服务
@Autowired
private YonghuService yonghuService;
// 自动注入运动教程服务
@Autowired
private YundongService yundongService;
// 自动注入运动教程收藏服务
@Autowired
private YundongCollectionService yundongCollectionService;
// 自动注入运动教程留言服务
@Autowired
private YundongLiuyanService yundongLiuyanService;
// 自动注入管理员服务
@Autowired
private UsersService usersService;
/**
*
*
* @param params
* @param request HTTP
* @return
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 根据角色设置查询参数
if (false)
return R.error(511, "永不会进入");
else if ("用户".equals(role))
params.put("yonghuId", request.getSession().getAttribute("userId"));
// 设置删除状态
params.put("meirijihuaDeleteStart", 1);
params.put("meirijihuaDeleteEnd", 1);
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meirijihuaService.queryPage(params);
// 字典表数据转换
List<MeirijihuaView> list = (List<MeirijihuaView>) page.getList();
for (MeirijihuaView c : list) {
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
*
* @param id ID
* @param request HTTP
* @return
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询每日计划
MeirijihuaEntity meirijihua = meirijihuaService.selectById(id);
if (meirijihua != null) {
// entity转view
MeirijihuaView view = new MeirijihuaView();
BeanUtils.copyProperties(meirijihua, view);// 把实体数据重构到view中
// 级联表 用户
// 级联表
YonghuEntity yonghu = yonghuService.selectById(meirijihua.getYonghuId());
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createTime", "insertTime", "updateTime", "yonghuId"});// 把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
} else {
return R.error(511, "查不到数据");
}
}
/**
*
*
* @param meirijihua
* @param request HTTP
* @return
*/
@RequestMapping("/save")
public R save(@RequestBody MeirijihuaEntity meirijihua, HttpServletRequest request) {
// 记录日志
logger.debug("save方法:,,Controller:{},,meirijihua:{}", this.getClass().getName(), meirijihua.toString());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 根据角色设置用户ID
if (false)
return R.error(511, "永远不会进入");
else if ("用户".equals(role))
meirijihua.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 构建查询条件
Wrapper<MeirijihuaEntity> queryWrapper = new EntityWrapper<MeirijihuaEntity>()
.eq("yonghu_id", meirijihua.getYonghuId())
.eq("meirijihua_name", meirijihua.getMeirijihuaName())
.eq("meirijihua_delete", meirijihua.getMeirijihuaDelete());
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
MeirijihuaEntity meirijihuaEntity = meirijihuaService.selectOne(queryWrapper);
if (meirijihuaEntity == null) {
// 设置删除状态和时间戳
meirijihua.setMeirijihuaDelete(1);
meirijihua.setInsertTime(new Date());
meirijihua.setCreateTime(new Date());
// 插入数据
meirijihuaService.insert(meirijihua);
return R.ok();
} else {
return R.error(511, "表中有相同数据");
}
}
/**
*
*
* @param meirijihua
* @param request HTTP
* @return
*/
@RequestMapping("/update")
public R update(@RequestBody MeirijihuaEntity meirijihua, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,meirijihua:{}", this.getClass().getName(), meirijihua.toString());
// 查询原先数据
MeirijihuaEntity oldMeirijihuaEntity = meirijihuaService.selectById(meirijihua.getId());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// meirijihua.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 根据ID更新数据
meirijihuaService.updateById(meirijihua);
return R.ok();
}
/**
*
*
* @param ids ID
* @param request HTTP
* @return
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 要删除的数据
List<MeirijihuaEntity> oldMeirijihuaList = meirijihuaService.selectBatchIds(Arrays.asList(ids));
ArrayList<MeirijihuaEntity> list = new ArrayList<>();
for (Integer id : ids) {
MeirijihuaEntity meirijihuaEntity = new MeirijihuaEntity();
meirijihuaEntity.setId(id);
meirijihuaEntity.setMeirijihuaDelete(2);
list.add(meirijihuaEntity);
}
if (list != null && list.size() > 0) {
meirijihuaService.updateBatchById(list);
}
return R.ok();
}
/**
*
*
* @param fileName
* @param request HTTP
* @return
*/
@RequestMapping("/batchInsert")
public R save(String fileName, HttpServletRequest request) {
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 获取用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<MeirijihuaEntity> meirijihuaList = new ArrayList<>();// 上传的东西
Map<String, List<String>> seachFields = new HashMap<>();// 要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if (lastIndexOf == -1) {
return R.error(511, "该文件没有后缀");
} else {
String suffix = fileName.substring(lastIndexOf);
if (!".xls".equals(suffix)) {
return R.error(511, "只支持后缀为xls的excel文件");
} else {
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);// 获取文件路径
File file = new File(resource.getFile());
if (!file.exists()) {
return R.error(511, "找不到上传文件,请联系管理员");
} else {
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());// 读取xls文件
dataList.remove(0);// 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
MeirijihuaEntity meirijihuaEntity = new MeirijihuaEntity();
// meirijihuaEntity.setYonghuId(Integer.valueOf(data.get(0))); // 用户 要改的
// meirijihuaEntity.setMeirijihuaName(data.get(0)); // 计划标题 要改的
// meirijihuaEntity.setYinshiText(data.get(0)); // 饮食计划 要改的
// meirijihuaEntity.setYundongText(data.get(0)); // 运动计划 要改的
// meirijihuaEntity.setYaopinText(data.get(0)); // 药品计划 要改的
// meirijihuaEntity.setMeirijihuaContent("");// 详情和图片
// meirijihuaEntity.setMeirijihuaTime(sdf.parse(data.get(0))); // 计划时间 要改的
// meirijihuaEntity.setMeirijihuaDelete(1);// 逻辑删除字段
// meirijihuaEntity.setInsertTime(date);// 时间
// meirijihuaEntity.setCreateTime(date);// 时间
meirijihuaList.add(meirijihuaEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
meirijihuaService.insertBatch(meirijihuaList);
return R.ok();
}
}
}
} catch (Exception e) {
e.printStackTrace();
return R.error(511, "批量插入数据异常,请联系管理员");
}
}
/**
*
*
* @param params
* @param request HTTP
* @return
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meirijihuaService.queryPage(params);
// 字典表数据转换
List<MeirijihuaView> list = (List<MeirijihuaView>) page.getList();
for (MeirijihuaView c : list)
dictionaryService.dictionaryConvert(c, request); // 修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
*
* @param id ID
* @param request HTTP
* @return
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 根据ID查询每日计划
MeirijihuaEntity meirijihua = meirijihuaService.selectById(id);
if (meirijihua != null) {
// entity转view
MeirijihuaView view = new MeirijihuaView();
BeanUtils.copyProperties(meirijihua, view);// 把实体数据重构到view中
// 级联表
YonghuEntity yonghu = yonghuService.selectById(meirijihua.getYonghuId());
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createDate"});// 把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
} else {
return R.error(511, "查不到数据");
}
}
/**
*
*
* @param meirijihua
* @param request HTTP
* @return
*/
@RequestMapping("/add")
public R add(@RequestBody MeirijihuaEntity meirijihua, HttpServletRequest request) {
// 记录日志
logger.debug("add方法:,,Controller:{},,meirijihua:{}", this.getClass().getName(), meirijihua.toString());
// 构建查询条件
Wrapper<MeirijihuaEntity> queryWrapper = new EntityWrapper<MeirijihuaEntity>()
.eq("yonghu_id", meirijihua.getYonghuId())
.eq("meirijihua_name", meirijihua.getMeirijihuaName())
.eq("yinshi_text", meirijihua.getYinshiText())
.eq("yundong_text", meirijihua.getYundongText())
.eq("yaopin_text", meirijihua.getYaopinText())
.eq("meirijihua_delete", meirijihua.getMeirijihuaDelete())
// .notIn("meirijihua_types", new Integer[]{102})
;
// 记录SQL语句
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 查询是否存在相同数据
MeirijihuaEntity meirijihuaEntity = meirijihuaService.selectOne(queryWrapper);
if (meirijihuaEntity == null) {
// 设置删除状态和时间戳
meirijihua.setMeirijihuaDelete(1);
meirijihua.setInsertTime(new Date());
meirijihua.setCreateTime(new Date());
// 插入数据
// 插入每日计划数据
meirijihuaService.insert(meirijihua);
// 返回成功响应
return R.ok();
} else {
// 返回错误响应,提示表中已有相同数据
return R.error(511, "表中有相同数据");
}
}
}

@ -0,0 +1,434 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/meishiCollection")
public class MeishiCollectionController {
// 日志记录器
private static final Logger logger = LoggerFactory.getLogger(MeishiCollectionController.class);
// 表名常量
private static final String TABLE_NAME = "meishiCollection";
// 自动注入健康食谱收藏服务
@Autowired
private MeishiCollectionService meishiCollectionService;
// 自动注入Token服务
@Autowired
private TokenService tokenService;
// 自动注入字典服务
@Autowired
private DictionaryService dictionaryService;
// 自动注入论坛服务
@Autowired
private ForumService forumService;
// 自动注入体检记录服务
@Autowired
private GerentizhengService gerentizhengService;
// 自动注入健康贴士服务
@Autowired
private JiankangtieshiService jiankangtieshiService;
// 自动注入每日计划服务
@Autowired
private MeirijihuaService meirijihuaService;
// 自动注入健康食谱服务
@Autowired
private MeishiService meishiService;
// 自动注入健康食谱留言服务
@Autowired
private MeishiLiuyanService meishiLiuyanService;
// 自动注入公告信息服务
@Autowired
private NewsService newsService;
// 自动注入药品信息服务
@Autowired
private YaopinService yaopinService;
// 自动注入用户服务
@Autowired
private YonghuService yonghuService;
// 自动注入运动教程服务
@Autowired
private YundongService yundongService;
// 自动注入运动教程收藏服务
@Autowired
private YundongCollectionService yundongCollectionService;
// 自动注入运动教程留言服务
@Autowired
private YundongLiuyanService yundongLiuyanService;
// 自动注入管理员服务
@Autowired
private UsersService usersService;
/**
*
* @param params
* @param request HTTP
* @return
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 根据角色设置查询参数
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meishiCollectionService.queryPage(params);
// 字典表数据转换
List<MeishiCollectionView> list =(List<MeishiCollectionView>)page.getList();
for(MeishiCollectionView c:list){
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
* @param id ID
* @param request HTTP
* @return
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询健康食谱收藏
MeishiCollectionEntity meishiCollection = meishiCollectionService.selectById(id);
if(meishiCollection !=null){
// entity转view
MeishiCollectionView view = new MeishiCollectionView();
BeanUtils.copyProperties( meishiCollection , view );
// 把实体数据重构到view中
// 级联表 健康食谱
// 级联表
MeishiEntity meishi = meishiService.selectById(meishiCollection.getMeishiId());
if(meishi != null){
BeanUtils.copyProperties( meishi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});
// 把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setMeishiId(meishi.getId());
}
// 级联表 用户
// 级联表
YonghuEntity yonghu = yonghuService.selectById(meishiCollection.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});
// 把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
* @param meishiCollection
* @param request HTTP
* @return
*/
@RequestMapping("/save")
public R save(@RequestBody MeishiCollectionEntity meishiCollection, HttpServletRequest request){
// 记录日志
logger.debug("save方法:,,Controller:{},,meishiCollection:{}",this.getClass().getName(),meishiCollection.toString());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 根据角色设置用户ID
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
meishiCollection.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 构建查询条件
Wrapper<MeishiCollectionEntity> queryWrapper = new EntityWrapper<MeishiCollectionEntity>()
.eq("meishi_id", meishiCollection.getMeishiId())
.eq("yonghu_id", meishiCollection.getYonghuId())
.eq("meishi_collection_types", meishiCollection.getMeishiCollectionTypes())
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
MeishiCollectionEntity meishiCollectionEntity = meishiCollectionService.selectOne(queryWrapper);
if(meishiCollectionEntity==null){
// 设置时间戳
meishiCollection.setInsertTime(new Date());
meishiCollection.setCreateTime(new Date());
// 插入数据
meishiCollectionService.insert(meishiCollection);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
* @param meishiCollection
* @param request HTTP
* @return
*/
@RequestMapping("/update")
public R update(@RequestBody MeishiCollectionEntity meishiCollection, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,meishiCollection:{}",this.getClass().getName(),meishiCollection.toString());
// 查询原先数据
MeishiCollectionEntity oldMeishiCollectionEntity = meishiCollectionService.selectById(meishiCollection.getId());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// meishiCollection.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 根据ID更新数据
meishiCollectionService.updateById(meishiCollection);
return R.ok();
}
/**
*
* @param ids ID
* @param request HTTP
* @return
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
// 要删除的数据
List<MeishiCollectionEntity> oldMeishiCollectionList =meishiCollectionService.selectBatchIds(Arrays.asList(ids));
// 批量删除数据
meishiCollectionService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
* @param fileName
* @param request HTTP
* @return
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
// 获取用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<MeishiCollectionEntity> meishiCollectionList = new ArrayList<>();// 上传的东西
Map<String, List<String>> seachFields= new HashMap<>();// 要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 读取xls文件
dataList.remove(0);// 删除第一行,因为第一行是提示
for(List<String> data:dataList){
// 循环
MeishiCollectionEntity meishiCollectionEntity = new MeishiCollectionEntity();
// meishiCollectionEntity.setMeishiId(Integer.valueOf(data.get(0)));
// 健康食谱 要改的
// meishiCollectionEntity.setYonghuId(Integer.valueOf(data.get(0)));
// 用户 要改的
// meishiCollectionEntity.setMeishiCollectionTypes(Integer.valueOf(data.get(0)));
// 类型 要改的
// meishiCollectionEntity.setInsertTime(date);// 时间
// meishiCollectionEntity.setCreateTime(date);// 时间
meishiCollectionList.add(meishiCollectionEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
meishiCollectionService.insertBatch(meishiCollectionList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
* @param params
* @param request HTTP
* @return
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meishiCollectionService.queryPage(params);
// 字典表数据转换
List<MeishiCollectionView> list =(List<MeishiCollectionView>)page.getList();
for(MeishiCollectionView c:list)
dictionaryService.dictionaryConvert(c, request);
// 修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
* @param id ID
* @param request HTTP
* @return
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询健康食谱收藏
MeishiCollectionEntity meishiCollection = meishiCollectionService.selectById(id);
if(meishiCollection !=null){
// entity转view
MeishiCollectionView view = new MeishiCollectionView();
BeanUtils.copyProperties( meishiCollection , view );
// 把实体数据重构到view中
// 级联表
MeishiEntity meishi = meishiService.selectById(meishiCollection.getMeishiId());
if(meishi != null){
BeanUtils.copyProperties( meishi , view ,new String[]{ "id", "createDate"});
// 把级联的数据添加到view中,并排除id和创建时间字段
view.setMeishiId(meishi.getId());
}
// 级联表
YonghuEntity yonghu = yonghuService.selectById(meishiCollection.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});
// 把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
* @param meishiCollection
* @param request HTTP
* @return
*/
@RequestMapping("/add")
public R add(@RequestBody MeishiCollectionEntity meishiCollection, HttpServletRequest request){
// 记录日志
logger.debug("add方法:,,Controller:{},,meishiCollection:{}",this.getClass().getName(),meishiCollection.toString());
// 构建查询条件
Wrapper<MeishiCollectionEntity> queryWrapper = new EntityWrapper<MeishiCollectionEntity>()
.eq("meishi_id", meishiCollection.getMeishiId())
.eq("yonghu_id", meishiCollection.getYonghuId())
.eq("meishi_collection_types", meishiCollection.getMeishiCollectionTypes())
// .notIn("meishi_collection_types", new Integer[]{102})
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
MeishiCollectionEntity meishiCollectionEntity = meishiCollectionService.selectOne(queryWrapper);
if(meishiCollectionEntity==null){
// 设置时间戳
meishiCollection.setInsertTime(new Date());
meishiCollection.setCreateTime(new Date());
// 插入数据
meishiCollectionService.insert(meishiCollection);
return R.ok();
}else {
return R.error(511,"您已经收藏过了");
}
}
}

@ -0,0 +1,520 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/meishi")
public class MeishiController {
// 日志记录器
private static final Logger logger = LoggerFactory.getLogger(MeishiController.class);
// 表名常量
private static final String TABLE_NAME = "meishi";
// 自动注入健康食谱服务
@Autowired
private MeishiService meishiService;
// 自动注入Token服务
@Autowired
private TokenService tokenService;
// 自动注入字典服务
@Autowired
private DictionaryService dictionaryService;
// 自动注入论坛服务
@Autowired
private ForumService forumService;
// 自动注入体检记录服务
@Autowired
private GerentizhengService gerentizhengService;
// 自动注入健康贴士服务
@Autowired
private JiankangtieshiService jiankangtieshiService;
// 自动注入每日计划服务
@Autowired
private MeirijihuaService meirijihuaService;
// 自动注入健康食谱收藏服务
@Autowired
private MeishiCollectionService meishiCollectionService;
// 自动注入健康食谱留言服务
@Autowired
private MeishiLiuyanService meishiLiuyanService;
// 自动注入公告信息服务
@Autowired
private NewsService newsService;
// 自动注入药品信息服务
@Autowired
private YaopinService yaopinService;
// 自动注入用户服务
@Autowired
private YonghuService yonghuService;
// 自动注入运动教程服务
@Autowired
private YundongService yundongService;
// 自动注入运动教程收藏服务
@Autowired
private YundongCollectionService yundongCollectionService;
// 自动注入运动教程留言服务
@Autowired
private YundongLiuyanService yundongLiuyanService;
// 自动注入管理员服务
@Autowired
private UsersService usersService;
/**
*
* @param params
* @param request HTTP
* @return
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 根据角色设置查询参数
if(false)
return R.error(511,"永不会进入");
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
// 设置删除状态
params.put("meishiDeleteStart",1);params.put("meishiDeleteEnd",1);
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meishiService.queryPage(params);
// 字典表数据转换
List<MeishiView> list =(List<MeishiView>)page.getList();
for(MeishiView c:list){
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
return R.ok().put("data", page);
}
/**
*
* @param id ID
* @param request HTTP
* @return
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询健康食谱
MeishiEntity meishi = meishiService.selectById(id);
if(meishi !=null){
// entity转view
MeishiView view = new MeishiView();
BeanUtils.copyProperties( meishi , view );
// 把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
* @param meishi
* @param request HTTP
* @return
*/
@RequestMapping("/save")
public R save(@RequestBody MeishiEntity meishi, HttpServletRequest request){
// 记录日志
logger.debug("save方法:,,Controller:{},,meishi:{}",this.getClass().getName(),meishi.toString());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 根据角色设置用户ID
if(false)
return R.error(511,"永远不会进入");
// 构建查询条件
Wrapper<MeishiEntity> queryWrapper = new EntityWrapper<MeishiEntity>()
.eq("meishi_name", meishi.getMeishiName())
.eq("meishi_types", meishi.getMeishiTypes())
.eq("meishi_num", meishi.getMeishiNum())
.eq("zan_number", meishi.getZanNumber())
.eq("cai_number", meishi.getCaiNumber())
.eq("meishi_delete", meishi.getMeishiDelete())
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
MeishiEntity meishiEntity = meishiService.selectOne(queryWrapper);
if(meishiEntity==null){
// 设置删除状态和时间戳
meishi.setMeishiDelete(1);
meishi.setInsertTime(new Date());
meishi.setCreateTime(new Date());
// 插入数据
meishiService.insert(meishi);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
*
* @param meishi
* @param request HTTP
* @return
*/
@RequestMapping("/update")
public R update(@RequestBody MeishiEntity meishi, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,meishi:{}",this.getClass().getName(),meishi.toString());
// 查询原先数据
MeishiEntity oldMeishiEntity = meishiService.selectById(meishi.getId());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// 如果图片字段为空设置为null
if("".equals(meishi.getMeishiPhoto()) || "null".equals(meishi.getMeishiPhoto())){
meishi.setMeishiPhoto(null);
}
// 根据ID更新数据
meishiService.updateById(meishi);
return R.ok();
}
/**
*
* @param ids ID
* @param request HTTP
* @return
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
// 要删除的数据
List<MeishiEntity> oldMeishiList =meishiService.selectBatchIds(Arrays.asList(ids));
ArrayList<MeishiEntity> list = new ArrayList<>();
for(Integer id:ids){
MeishiEntity meishiEntity = new MeishiEntity();
meishiEntity.setId(id);
meishiEntity.setMeishiDelete(2);
list.add(meishiEntity);
}
if(list != null && list.size() >0){
meishiService.updateBatchById(list);
}
return R.ok();
}
/**
*
* @param fileName
* @param request HTTP
* @return
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
// 获取用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<MeishiEntity> meishiList = new ArrayList<>();
// 上传的东西
Map<String, List<String>> seachFields= new HashMap<>();
// 要查询的字段
Date date = new Date();
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
return R.error(511,"该文件没有后缀");
}else{
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
return R.error(511,"只支持后缀为xls的excel文件");
}else{
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件路径
File file = new File(resource.getFile());
if(!file.exists()){
return R.error(511,"找不到上传文件,请联系管理员");
}else{
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 读取xls文件
dataList.remove(0);
// 删除第一行,因为第一行是提示
for(List<String> data:dataList){
// 循环
MeishiEntity meishiEntity = new MeishiEntity();
// meishiEntity.setMeishiName(data.get(0));
// 食谱标题 要改的
// meishiEntity.setMeishiPhoto("");// 详情和图片
// meishiEntity.setMeishiTypes(Integer.valueOf(data.get(0)));
// 食谱类型 要改的
// meishiEntity.setMeishiNum(Integer.valueOf(data.get(0)));
// 所含热量 要改的
// meishiEntity.setZanNumber(Integer.valueOf(data.get(0)));
// 赞 要改的
// meishiEntity.setCaiNumber(Integer.valueOf(data.get(0)));
// 踩 要改的
// meishiEntity.setMeishiContent("");
// 详情和图片
// meishiEntity.setMeishiDelete(1);
// 逻辑删除字段
// meishiEntity.setInsertTime(date);
// 时间
// meishiEntity.setCreateTime(date);
// 时间
meishiList.add(meishiEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
meishiService.insertBatch(meishiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
* @param params
* @param request HTTP
* @return
*/
@IgnoreAuth
@RequestMapping("/gexingtuijian")
public R gexingtuijian(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("gexingtuijian方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
List<MeishiView> returnMeishiViewList = new ArrayList<>();
// 查看收藏
Map<String, Object> params1 = new HashMap<>(params);params1.put("sort","id");params1.put("yonghuId",request.getSession().getAttribute("userId"));
PageUtils pageUtils = meishiCollectionService.queryPage(params1);
List<MeishiCollectionView> collectionViewsList =(List<MeishiCollectionView>)pageUtils.getList();
Map<Integer,Integer> typeMap=new HashMap<>();
// 收藏的类型列表
for(MeishiCollectionView collectionView:collectionViewsList){
Integer meishiTypes = collectionView.getMeishiTypes();
if(typeMap.containsKey(meishiTypes)){
typeMap.put(meishiTypes,typeMap.get(meishiTypes)+1);
}else{
typeMap.put(meishiTypes,1);
}
}
List<Integer> typeList = new ArrayList<>();
// 排序后的有序类型 按最多到最少
typeMap.entrySet().stream().sorted((o1, o2) -> o2.getValue() - o1.getValue()).forEach(e -> typeList.add(e.getKey()));
// 排序
Integer limit = Integer.valueOf(String.valueOf(params.get("limit")));
for(Integer type:typeList){
Map<String, Object> params2 = new HashMap<>(params);params2.put("meishiTypes",type);
PageUtils pageUtils1 = meishiService.queryPage(params2);
List<MeishiView> meishiViewList =(List<MeishiView>)pageUtils1.getList();
returnMeishiViewList.addAll(meishiViewList);
if(returnMeishiViewList.size()>= limit) break;
// 返回的推荐数量大于要的数量 跳出循环
}
// 正常查询出来商品,用于补全推荐缺少的数据
PageUtils page = meishiService.queryPage(params);
if(returnMeishiViewList.size()<limit){
// 返回数量还是小于要求数量
int toAddNum = limit - returnMeishiViewList.size();
// 要添加的数量
List<MeishiView> meishiViewList =(List<MeishiView>)page.getList();
for(MeishiView meishiView:meishiViewList){
Boolean addFlag = true;
for(MeishiView returnMeishiView:returnMeishiViewList){
if(returnMeishiView.getId().intValue() ==meishiView.getId().intValue()) addFlag=false;
// 返回的数据中已存在此商品
}
if(addFlag){
toAddNum=toAddNum-1;
returnMeishiViewList.add(meishiView);
if(toAddNum==0) break;
// 够数量了
}
}
}else {
returnMeishiViewList = returnMeishiViewList.subList(0, limit);
}
for(MeishiView c:returnMeishiViewList)
dictionaryService.dictionaryConvert(c, request);
page.setList(returnMeishiViewList);
return R.ok().put("data", page);
}
/**
*
* @param params
* @param request HTTP
* @return
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meishiService.queryPage(params);
// 字典表数据转换
List<MeishiView> list =(List<MeishiView>)page.getList();
for(MeishiView c:list)
dictionaryService.dictionaryConvert(c, request);
// 修改对应字典表字段
return R.ok().put("data", page);
}
/**
*
* @param id ID
* @param request HTTP
* @return
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询健康食谱
MeishiEntity meishi = meishiService.selectById(id);
if(meishi !=null){
// entity转view
MeishiView view = new MeishiView();
BeanUtils.copyProperties( meishi , view );
// 把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
* @param meishi
* @param request HTTP
* @return
*/
@RequestMapping("/add")
public R add(@RequestBody MeishiEntity meishi, HttpServletRequest request){
// 记录日志
logger.debug("add方法:,,Controller:{},,meishi:{}",this.getClass().getName(),meishi.toString());
// 构建查询条件
Wrapper<MeishiEntity> queryWrapper = new EntityWrapper<MeishiEntity>()
.eq("meishi_name", meishi.getMeishiName())
.eq("meishi_types", meishi.getMeishiTypes())
// 添加查询条件:所含热量
.eq("meishi_num", meishi.getMeishiNum())
// 添加查询条件:赞的数量
.eq("zan_number", meishi.getZanNumber())
// 添加查询条件:踩的数量
.eq("cai_number", meishi.getCaiNumber())
// 添加查询条件:删除状态
.eq("meishi_delete", meishi.getMeishiDelete())
// .notIn("meishi_types", new Integer[]{102}) // 排除特定类型的健康食谱
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
MeishiEntity meishiEntity = meishiService.selectOne(queryWrapper);
if(meishiEntity==null){
// 设置默认赞的数量为1
meishi.setZanNumber(1);
// 设置默认踩的数量为1
meishi.setCaiNumber(1);
// 设置删除状态为1未删除
meishi.setMeishiDelete(1);
// 设置插入时间
meishi.setInsertTime(new Date());
// 设置创建时间
meishi.setCreateTime(new Date());
// 插入新数据
meishiService.insert(meishi);
// 返回成功响应
return R.ok();
}else {
// 返回错误响应,提示表中已有相同数据
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,402 @@
package com.controller;
// 导入所需的类
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
// 导入服务类
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/meishiLiuyan")
public class MeishiLiuyanController {
// 定义日志记录器
private static final Logger logger = LoggerFactory.getLogger(MeishiLiuyanController.class);
// 定义表名常量
private static final String TABLE_NAME = "meishiLiuyan";
// 自动注入MeishiLiuyanService
@Autowired
private MeishiLiuyanService meishiLiuyanService;
// 自动注入TokenService
@Autowired
private TokenService tokenService;
// 自动注入DictionaryService
@Autowired
private DictionaryService dictionaryService;//字典
// 自动注入ForumService
@Autowired
private ForumService forumService;//论坛
// 自动注入GerentizhengService
@Autowired
private GerentizhengService gerentizhengService;//体检记录
// 自动注入JiankangtieshiService
@Autowired
private JiankangtieshiService jiankangtieshiService;//健康贴士
// 自动注入MeirijihuaService
@Autowired
private MeirijihuaService meirijihuaService;//每日计划
// 自动注入MeishiService
@Autowired
private MeishiService meishiService;//健康食谱
// 自动注入MeishiCollectionService
@Autowired
private MeishiCollectionService meishiCollectionService;//健康食谱收藏
// 自动注入NewsService
@Autowired
private NewsService newsService;//公告信息
// 自动注入YaopinService
@Autowired
private YaopinService yaopinService;//药品信息
// 自动注入YonghuService
@Autowired
private YonghuService yonghuService;//用户
// 自动注入YundongService
@Autowired
private YundongService yundongService;//运动教程
// 自动注入YundongCollectionService
@Autowired
private YundongCollectionService yundongCollectionService;//运动教程收藏
// 自动注入YundongLiuyanService
@Autowired
private YundongLiuyanService yundongLiuyanService;//运动教程留言
// 自动注入UsersService
@Autowired
private UsersService usersService;//管理员
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 永远不会进入的条件
if(false)
return R.error(511,"永不会进入");
// 如果用户角色为“用户”则设置用户ID
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meishiLiuyanService.queryPage(params);
// 字典表数据转换
List<MeishiLiuyanView> list =(List<MeishiLiuyanView>)page.getList();
for(MeishiLiuyanView c:list){
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
// 返回结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询实体
MeishiLiuyanEntity meishiLiuyan = meishiLiuyanService.selectById(id);
if(meishiLiuyan !=null){
// entity转view
MeishiLiuyanView view = new MeishiLiuyanView();
BeanUtils.copyProperties( meishiLiuyan , view );//把实体数据重构到view中
// 级联表 健康食谱
// 级联表
MeishiEntity meishi = meishiService.selectById(meishiLiuyan.getMeishiId());
if(meishi != null){
BeanUtils.copyProperties( meishi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setMeishiId(meishi.getId());
}
// 级联表 用户
// 级联表
YonghuEntity yonghu = yonghuService.selectById(meishiLiuyan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回结果
return R.ok().put("data", view);
}else {
// 返回错误信息
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody MeishiLiuyanEntity meishiLiuyan, HttpServletRequest request){
// 记录日志
logger.debug("save方法:,,Controller:{},,meishiLiuyan:{}",this.getClass().getName(),meishiLiuyan.toString());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 永远不会进入的条件
if(false)
return R.error(511,"永远不会进入");
// 如果用户角色为“用户”则设置用户ID
else if("用户".equals(role))
meishiLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 设置创建时间和插入时间
meishiLiuyan.setCreateTime(new Date());
meishiLiuyan.setInsertTime(new Date());
// 插入数据
meishiLiuyanService.insert(meishiLiuyan);
// 返回结果
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody MeishiLiuyanEntity meishiLiuyan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,meishiLiuyan:{}",this.getClass().getName(),meishiLiuyan.toString());
// 查询原先数据
MeishiLiuyanEntity oldMeishiLiuyanEntity = meishiLiuyanService.selectById(meishiLiuyan.getId());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// meishiLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 设置更新时间
meishiLiuyan.setUpdateTime(new Date());
// 根据id更新
meishiLiuyanService.updateById(meishiLiuyan);
// 返回结果
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
// 要删除的数据
List<MeishiLiuyanEntity> oldMeishiLiuyanList =meishiLiuyanService.selectBatchIds(Arrays.asList(ids));
// 删除数据
meishiLiuyanService.deleteBatchIds(Arrays.asList(ids));
// 返回结果
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
// 获取用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 定义日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
// 上传的东西
List<MeishiLiuyanEntity> meishiLiuyanList = new ArrayList<>();
// 要查询的字段
Map<String, List<String>> seachFields= new HashMap<>();
// 获取当前时间
Date date = new Date();
// 获取文件后缀
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
// 返回错误信息
return R.error(511,"该文件没有后缀");
}else{
// 获取文件后缀
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
// 返回错误信息
return R.error(511,"只支持后缀为xls的excel文件");
}else{
// 获取文件路径
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件对象
File file = new File(resource.getFile());
if(!file.exists()){
// 返回错误信息
return R.error(511,"找不到上传文件,请联系管理员");
}else{
// 读取xls文件
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 删除第一行,因为第一行是提示
dataList.remove(0);
for(List<String> data:dataList){
// 循环
MeishiLiuyanEntity meishiLiuyanEntity = new MeishiLiuyanEntity();
// meishiLiuyanEntity.setMeishiId(Integer.valueOf(data.get(0))); //健康食谱 要改的
// meishiLiuyanEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// meishiLiuyanEntity.setMeishiLiuyanText(data.get(0)); //留言内容 要改的
// meishiLiuyanEntity.setInsertTime(date);//时间
// meishiLiuyanEntity.setReplyText(data.get(0)); //回复内容 要改的
// meishiLiuyanEntity.setUpdateTime(sdf.parse(data.get(0))); //回复时间 要改的
// meishiLiuyanEntity.setCreateTime(date);//时间
// 添加到列表中
meishiLiuyanList.add(meishiLiuyanEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
meishiLiuyanService.insertBatch(meishiLiuyanList);
// 返回结果
return R.ok();
}
}
}
}catch (Exception e){
// 打印堆栈跟踪
e.printStackTrace();
// 返回错误信息
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = meishiLiuyanService.queryPage(params);
// 字典表数据转换
List<MeishiLiuyanView> list =(List<MeishiLiuyanView>)page.getList();
for(MeishiLiuyanView c:list)
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
// 返回结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询实体
MeishiLiuyanEntity meishiLiuyan = meishiLiuyanService.selectById(id);
if(meishiLiuyan !=null){
// entity转view
MeishiLiuyanView view = new MeishiLiuyanView();
BeanUtils.copyProperties( meishiLiuyan , view );//把实体数据重构到view中
// 级联表
MeishiEntity meishi = meishiService.selectById(meishiLiuyan.getMeishiId());
if(meishi != null){
BeanUtils.copyProperties( meishi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setMeishiId(meishi.getId());
}
// 级联表
YonghuEntity yonghu = yonghuService.selectById(meishiLiuyan.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回结果
return R.ok().put("data", view);
}else {
// 返回错误信息
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody MeishiLiuyanEntity meishiLiuyan, HttpServletRequest request){
// 记录日志
logger.debug("add方法:,,Controller:{},,meishiLiuyan:{}",this.getClass().getName(),meishiLiuyan.toString());
// 设置创建时间和插入时间
meishiLiuyan.setCreateTime(new Date());
meishiLiuyan.setInsertTime(new Date());
// 插入数据
meishiLiuyanService.insert(meishiLiuyan);
// 返回结果
return R.ok();
}
}

@ -0,0 +1,402 @@
package com.controller;
// 导入所需的类
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
// 导入服务类
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/news")
public class NewsController {
// 定义日志记录器
private static final Logger logger = LoggerFactory.getLogger(NewsController.class);
// 定义表名常量
private static final String TABLE_NAME = "news";
// 自动注入NewsService
@Autowired
private NewsService newsService;
// 自动注入TokenService
@Autowired
private TokenService tokenService;
// 自动注入DictionaryService
@Autowired
private DictionaryService dictionaryService;//字典
// 自动注入ForumService
@Autowired
private ForumService forumService;//论坛
// 自动注入GerentizhengService
@Autowired
private GerentizhengService gerentizhengService;//体检记录
// 自动注入JiankangtieshiService
@Autowired
private JiankangtieshiService jiankangtieshiService;//健康贴士
// 自动注入MeirijihuaService
@Autowired
private MeirijihuaService meirijihuaService;//每日计划
// 自动注入MeishiService
@Autowired
private MeishiService meishiService;//健康食谱
// 自动注入MeishiCollectionService
@Autowired
private MeishiCollectionService meishiCollectionService;//健康食谱收藏
// 自动注入MeishiLiuyanService
@Autowired
private MeishiLiuyanService meishiLiuyanService;//健康食谱留言
// 自动注入YaopinService
@Autowired
private YaopinService yaopinService;//药品信息
// 自动注入YonghuService
@Autowired
private YonghuService yonghuService;//用户
// 自动注入YundongService
@Autowired
private YundongService yundongService;//运动教程
// 自动注入YundongCollectionService
@Autowired
private YundongCollectionService yundongCollectionService;//运动教程收藏
// 自动注入YundongLiuyanService
@Autowired
private YundongLiuyanService yundongLiuyanService;//运动教程留言
// 自动注入UsersService
@Autowired
private UsersService usersService;//管理员
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 永远不会进入的条件
if(false)
return R.error(511,"永不会进入");
// 如果用户角色为“用户”则设置用户ID
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = newsService.queryPage(params);
// 字典表数据转换
List<NewsView> list =(List<NewsView>)page.getList();
for(NewsView c:list){
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
// 返回结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询实体
NewsEntity news = newsService.selectById(id);
if(news !=null){
// entity转view
NewsView view = new NewsView();
BeanUtils.copyProperties( news , view );//把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回结果
return R.ok().put("data", view);
}else {
// 返回错误信息
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody NewsEntity news, HttpServletRequest request){
// 记录日志
logger.debug("save方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 永远不会进入的条件
if(false)
return R.error(511,"永远不会进入");
// 构建查询条件
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if(newsEntity==null){
// 设置创建时间和插入时间
news.setInsertTime(new Date());
news.setCreateTime(new Date());
// 插入数据
newsService.insert(news);
// 返回结果
return R.ok();
}else {
// 返回错误信息
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody NewsEntity news, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
// 查询原先数据
NewsEntity oldNewsEntity = newsService.selectById(news.getId());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// 如果新闻照片为空或为"null"则设置为null
if("".equals(news.getNewsPhoto()) || "null".equals(news.getNewsPhoto())){
news.setNewsPhoto(null);
}
// 根据id更新
newsService.updateById(news);
// 返回结果
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
// 要删除的数据
List<NewsEntity> oldNewsList =newsService.selectBatchIds(Arrays.asList(ids));
// 删除数据
newsService.deleteBatchIds(Arrays.asList(ids));
// 返回结果
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
// 获取用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 定义日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
// 上传的东西
List<NewsEntity> newsList = new ArrayList<>();
// 要查询的字段
Map<String, List<String>> seachFields= new HashMap<>();
// 获取当前时间
Date date = new Date();
// 获取文件后缀
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
// 返回错误信息
return R.error(511,"该文件没有后缀");
}else{
// 获取文件后缀
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
// 返回错误信息
return R.error(511,"只支持后缀为xls的excel文件");
}else{
// 获取文件路径
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件对象
File file = new File(resource.getFile());
if(!file.exists()){
// 返回错误信息
return R.error(511,"找不到上传文件,请联系管理员");
}else{
// 读取xls文件
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 删除第一行,因为第一行是提示
dataList.remove(0);
for(List<String> data:dataList){
// 循环
NewsEntity newsEntity = new NewsEntity();
// newsEntity.setNewsName(data.get(0)); //公告标题 要改的
// newsEntity.setNewsTypes(Integer.valueOf(data.get(0))); //公告类型 要改的
// newsEntity.setNewsPhoto("");//详情和图片
// newsEntity.setInsertTime(date);//时间
// newsEntity.setNewsContent("");//详情和图片
// newsEntity.setCreateTime(date);//时间
// 添加到列表中
newsList.add(newsEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
newsService.insertBatch(newsList);
// 返回结果
return R.ok();
}
}
}
}catch (Exception e){
// 打印堆栈跟踪
e.printStackTrace();
// 返回错误信息
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = newsService.queryPage(params);
// 字典表数据转换
List<NewsView> list =(List<NewsView>)page.getList();
for(NewsView c:list)
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
// 返回结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询实体
NewsEntity news = newsService.selectById(id);
if(news !=null){
// entity转view
NewsView view = new NewsView();
BeanUtils.copyProperties( news , view );//把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回结果
return R.ok().put("data", view);
}else {
// 返回错误信息
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody NewsEntity news, HttpServletRequest request){
// 记录日志
logger.debug("add方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
// 构建查询条件
Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
.eq("news_name", news.getNewsName())
.eq("news_types", news.getNewsTypes())
// .notIn("news_types", new Integer[]{102})
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
NewsEntity newsEntity = newsService.selectOne(queryWrapper);
if(newsEntity==null){
// 设置创建时间和插入时间
news.setInsertTime(new Date());
news.setCreateTime(new Date());
// 插入数据
newsService.insert(news);
// 返回结果
return R.ok();
}else {
// 返回错误信息
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,239 @@
package com.controller;
// 导入所需的类
import java.util.List;
import java.util.Arrays;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.service.UsersService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.UsersEntity;
import com.service.TokenService;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
/**
*
*/
@RequestMapping("users")
@RestController
public class UsersController {
// 自动注入UsersService
@Autowired
private UsersService usersService;
// 自动注入TokenService
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
// 根据用户名查询用户
UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
// 如果用户不存在或密码不匹配,返回错误信息
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
// 生成令牌
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
// 创建响应对象
R r = R.ok();
// 设置令牌
r.put("token", token);
// 设置角色
r.put("role",user.getRole());
// 设置用户ID
r.put("userId",user.getId());
// 返回响应
return r;
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
// 检查用户名是否已存在
if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
// 插入新用户
usersService.insert(user);
// 返回成功响应
return R.ok();
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
// 使会话失效
request.getSession().invalidate();
// 返回成功响应
return R.ok("退出成功");
}
/**
*
*/
@GetMapping(value = "/updatePassword")
public R updatePassword(String oldPassword, String newPassword, HttpServletRequest request) {
// 根据会话获取用户
UsersEntity users = usersService.selectById((Integer)request.getSession().getAttribute("userId"));
// 如果新密码为空,返回错误信息
if(newPassword == null){
return R.error("新密码不能为空") ;
}
// 如果原密码不匹配,返回错误信息
if(!oldPassword.equals(users.getPassword())){
return R.error("原密码输入错误");
}
// 如果新密码和原密码相同,返回错误信息
if(newPassword.equals(users.getPassword())){
return R.error("新密码不能和原密码一致") ;
}
// 设置新密码
users.setPassword(newPassword);
// 更新用户信息
usersService.updateById(users);
// 返回成功响应
return R.ok();
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
// 根据用户名查询用户
UsersEntity user = usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", username));
// 如果用户不存在,返回错误信息
if(user==null) {
return R.error("账号不存在");
}
// 设置默认密码
user.setPassword("123456");
// 更新用户信息
usersService.update(user,null);
// 返回成功响应
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UsersEntity user){
// 构建查询条件
EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
// 查询分页数据
PageUtils page = usersService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
// 返回成功响应
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/list")
public R list( UsersEntity user){
// 构建查询条件
EntityWrapper<UsersEntity> ew = new EntityWrapper<UsersEntity>();
// 设置查询条件
ew.allEq(MPUtil.allEQMapPre( user, "user"));
// 返回成功响应
return R.ok().put("data", usersService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
// 根据ID查询用户
UsersEntity user = usersService.selectById(id);
// 返回成功响应
return R.ok().put("data", user);
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
// 从会话中获取用户ID
Integer id = (Integer)request.getSession().getAttribute("userId");
// 根据ID查询用户
UsersEntity user = usersService.selectById(id);
// 返回成功响应
return R.ok().put("data", user);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
// 检查用户名是否已存在
if(usersService.selectOne(new EntityWrapper<UsersEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
// 插入新用户
usersService.insert(user);
// 返回成功响应
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody UsersEntity user){
// ValidatorUtils.validateEntity(user);
// 根据ID更新用户信息
usersService.updateById(user);//全部更新
// 返回成功响应
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
// 查询所有用户
List<UsersEntity> user = usersService.selectList(null);
// 如果用户数量大于1删除指定用户
if(user.size() > 1){
usersService.deleteBatchIds(Arrays.asList(ids));
}else{
// 返回错误信息
return R.error("管理员最少保留一个");
}
// 返回成功响应
return R.ok();
}
}

@ -0,0 +1,427 @@
package com.controller;
// 导入所需的类
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
// 导入服务类
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/yaopin")
public class YaopinController {
// 定义日志记录器
private static final Logger logger = LoggerFactory.getLogger(YaopinController.class);
// 定义表名常量
private static final String TABLE_NAME = "yaopin";
// 自动注入YaopinService
@Autowired
private YaopinService yaopinService;
// 自动注入TokenService
@Autowired
private TokenService tokenService;
// 自动注入DictionaryService
@Autowired
private DictionaryService dictionaryService;//字典
// 自动注入ForumService
@Autowired
private ForumService forumService;//论坛
// 自动注入GerentizhengService
@Autowired
private GerentizhengService gerentizhengService;//体检记录
// 自动注入JiankangtieshiService
@Autowired
private JiankangtieshiService jiankangtieshiService;//健康贴士
// 自动注入MeirijihuaService
@Autowired
private MeirijihuaService meirijihuaService;//每日计划
// 自动注入MeishiService
@Autowired
private MeishiService meishiService;//健康食谱
// 自动注入MeishiCollectionService
@Autowired
private MeishiCollectionService meishiCollectionService;//健康食谱收藏
// 自动注入MeishiLiuyanService
@Autowired
private MeishiLiuyanService meishiLiuyanService;//健康食谱留言
// 自动注入NewsService
@Autowired
private NewsService newsService;//公告信息
// 自动注入YonghuService
@Autowired
private YonghuService yonghuService;//用户
// 自动注入YundongService
@Autowired
private YundongService yundongService;//运动教程
// 自动注入YundongCollectionService
@Autowired
private YundongCollectionService yundongCollectionService;//运动教程收藏
// 自动注入YundongLiuyanService
@Autowired
private YundongLiuyanService yundongLiuyanService;//运动教程留言
// 自动注入UsersService
@Autowired
private UsersService usersService;//管理员
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 永远不会进入的条件
if(false)
return R.error(511,"永不会进入");
// 如果用户角色为“用户”则设置用户ID
else if("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
// 设置删除状态参数
params.put("yaopinDeleteStart",1);params.put("yaopinDeleteEnd",1);
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = yaopinService.queryPage(params);
// 字典表数据转换
List<YaopinView> list =(List<YaopinView>)page.getList();
for(YaopinView c:list){
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
}
// 返回结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询实体
YaopinEntity yaopin = yaopinService.selectById(id);
if(yaopin !=null){
// entity转view
YaopinView view = new YaopinView();
BeanUtils.copyProperties( yaopin , view );//把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回结果
return R.ok().put("data", view);
}else {
// 返回错误信息
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody YaopinEntity yaopin, HttpServletRequest request){
// 记录日志
logger.debug("save方法:,,Controller:{},,yaopin:{}",this.getClass().getName(),yaopin.toString());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// 永远不会进入的条件
if(false)
return R.error(511,"永远不会进入");
// 构建查询条件
Wrapper<YaopinEntity> queryWrapper = new EntityWrapper<YaopinEntity>()
.eq("yaopin_name", yaopin.getYaopinName())
.eq("yaopin_types", yaopin.getYaopinTypes())
.eq("yaopin_zuoyng", yaopin.getYaopinZuoyng())
.eq("yaopin_chengfen", yaopin.getYaopinChengfen())
.eq("yaopin_delete", yaopin.getYaopinDelete())
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
YaopinEntity yaopinEntity = yaopinService.selectOne(queryWrapper);
if(yaopinEntity==null){
// 设置删除状态
yaopin.setYaopinDelete(1);
// 设置创建时间和插入时间
yaopin.setInsertTime(new Date());
yaopin.setCreateTime(new Date());
// 插入数据
yaopinService.insert(yaopin);
// 返回结果
return R.ok();
}else {
// 返回错误信息
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody YaopinEntity yaopin, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 记录日志
logger.debug("update方法:,,Controller:{},,yaopin:{}",this.getClass().getName(),yaopin.toString());
// 查询原先数据
YaopinEntity oldYaopinEntity = yaopinService.selectById(yaopin.getId());
// 获取用户角色
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// 如果药品照片为空或为"null"则设置为null
if("".equals(yaopin.getYaopinPhoto()) || "null".equals(yaopin.getYaopinPhoto())){
yaopin.setYaopinPhoto(null);
}
// 根据id更新
yaopinService.updateById(yaopin);
// 返回结果
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
// 记录日志
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
// 要删除的数据
List<YaopinEntity> oldYaopinList =yaopinService.selectBatchIds(Arrays.asList(ids));
// 创建列表存储要更新的实体
ArrayList<YaopinEntity> list = new ArrayList<>();
for(Integer id:ids){
YaopinEntity yaopinEntity = new YaopinEntity();
yaopinEntity.setId(id);
yaopinEntity.setYaopinDelete(2);
list.add(yaopinEntity);
}
// 如果列表不为空且大小大于0更新批量数据
if(list != null && list.size() >0){
yaopinService.updateBatchById(list);
}
// 返回结果
return R.ok();
}
/**
*
*/
@RequestMapping("/batchInsert")
public R save( String fileName, HttpServletRequest request){
// 记录日志
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
// 获取用户ID
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 定义日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
// 上传的东西
List<YaopinEntity> yaopinList = new ArrayList<>();
// 要查询的字段
Map<String, List<String>> seachFields= new HashMap<>();
// 获取当前时间
Date date = new Date();
// 获取文件后缀
int lastIndexOf = fileName.lastIndexOf(".");
if(lastIndexOf == -1){
// 返回错误信息
return R.error(511,"该文件没有后缀");
}else{
// 获取文件后缀
String suffix = fileName.substring(lastIndexOf);
if(!".xls".equals(suffix)){
// 返回错误信息
return R.error(511,"只支持后缀为xls的excel文件");
}else{
// 获取文件路径
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件对象
File file = new File(resource.getFile());
if(!file.exists()){
// 返回错误信息
return R.error(511,"找不到上传文件,请联系管理员");
}else{
// 读取xls文件
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 删除第一行,因为第一行是提示
dataList.remove(0);
for(List<String> data:dataList){
// 循环
YaopinEntity yaopinEntity = new YaopinEntity();
// yaopinEntity.setYaopinName(data.get(0)); //药品名称 要改的
// yaopinEntity.setYaopinPhoto("");//详情和图片
// yaopinEntity.setYaopinTypes(Integer.valueOf(data.get(0))); //药品类型 要改的
// yaopinEntity.setYaopinZuoyng(data.get(0)); //药品作用 要改的
// yaopinEntity.setYaopinChengfen(data.get(0)); //药品成分 要改的
// yaopinEntity.setYaopinContent("");//详情和图片
// yaopinEntity.setYaopinDelete(1);//逻辑删除字段
// yaopinEntity.setInsertTime(date);//时间
// yaopinEntity.setCreateTime(date);//时间
// 添加到列表中
yaopinList.add(yaopinEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
yaopinService.insertBatch(yaopinList);
// 返回结果
return R.ok();
}
}
}
}catch (Exception e){
// 打印堆栈跟踪
e.printStackTrace();
// 返回错误信息
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
// 记录日志
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 检查参数
CommonUtil.checkMap(params);
// 查询分页数据
PageUtils page = yaopinService.queryPage(params);
// 字典表数据转换
List<YaopinView> list =(List<YaopinView>)page.getList();
for(YaopinView c:list)
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
// 返回结果
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
// 记录日志
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
// 根据ID查询实体
YaopinEntity yaopin = yaopinService.selectById(id);
if(yaopin !=null){
// entity转view
YaopinView view = new YaopinView();
BeanUtils.copyProperties( yaopin , view );//把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 返回结果
return R.ok().put("data", view);
}else {
// 返回错误信息
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody YaopinEntity yaopin, HttpServletRequest request){
// 记录日志
logger.debug("add方法:,,Controller:{},,yaopin:{}",this.getClass().getName(),yaopin.toString());
// 构建查询条件
Wrapper<YaopinEntity> queryWrapper = new EntityWrapper<YaopinEntity>()
.eq("yaopin_name", yaopin.getYaopinName())
.eq("yaopin_types", yaopin.getYaopinTypes())
.eq("yaopin_zuoyng", yaopin.getYaopinZuoyng())
.eq("yaopin_chengfen", yaopin.getYaopinChengfen())
.eq("yaopin_delete", yaopin.getYaopinDelete())
// .notIn("yaopin_types", new Integer[]{102})
;
// 记录SQL语句
logger.info("sql语句:"+queryWrapper.getSqlSegment());
// 查询是否存在相同数据
YaopinEntity yaopinEntity = yaopinService.selectOne(queryWrapper);
if(yaopinEntity==null){
// 设置删除状态
yaopin.setYaopinDelete(1);
// 设置创建时间和插入时间
yaopin.setInsertTime(new Date());
yaopin.setCreateTime(new Date());
// 插入数据
yaopinService.insert(yaopin);
// 返回结果
return R.ok();
}else {
// 返回错误信息
return R.error(511,"表中有相同数据");
}
}
}

@ -0,0 +1,680 @@
package com.controller;
// 导入所需的类库包括Java标准库、第三方库如FastJSON、Spring框架相关类、MyBatis-Plus工具类等。
import java.io.File; // 导入File类用于文件操作
import java.math.BigDecimal; // 导入BigDecimal类用于高精度计算
import java.net.URL; // 导入URL类用于处理URL
import java.text.SimpleDateFormat; // 导入SimpleDateFormat类用于日期格式化
import com.alibaba.fastjson.JSONObject; // 导入JSONObject类用于JSON处理
import java.util.*; // 导入Java集合框架
import org.springframework.beans.BeanUtils; // 导入BeanUtils类用于对象属性复制
import javax.servlet.http.HttpServletRequest; // 导入HttpServletRequest类用于处理HTTP请求
import org.springframework.web.context.ContextLoader; // 导入ContextLoader类用于获取Web应用上下文
import javax.servlet.ServletContext; // 导入ServletContext类用于获取Servlet上下文
import com.service.TokenService; // 导入TokenService类用于处理Token相关操作
import com.utils.*; // 导入自定义工具类
import java.lang.reflect.InvocationTargetException; // 导入InvocationTargetException类用于处理反射异常
import com.service.DictionaryService; // 导入DictionaryService类用于处理字典数据
import org.apache.commons.lang3.StringUtils; // 导入StringUtils类用于字符串操作
import com.annotation.IgnoreAuth; // 导入IgnoreAuth注解用于忽略权限验证
import org.slf4j.Logger; // 导入Logger类用于日志记录
import org.slf4j.LoggerFactory; // 导入LoggerFactory类用于创建Logger实例
import org.springframework.beans.factory.annotation.Autowired; // 导入Autowired注解用于自动注入依赖
import org.springframework.stereotype.Controller; // 导入Controller注解用于标识控制器类
import org.springframework.web.bind.annotation.*; // 导入Web绑定注解用于处理HTTP请求
import com.baomidou.mybatisplus.mapper.EntityWrapper; // 导入EntityWrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper; // 导入Wrapper接口用于构建查询条件
import com.entity.*; // 导入实体类
import com.entity.view.*; // 导入视图类
import com.service.*; // 导入服务类
import com.utils.PageUtils; // 导入PageUtils类用于分页处理
import com.utils.R; // 导入R类用于封装返回结果
import com.alibaba.fastjson.*; // 导入FastJSON相关类用于JSON处理
/**
*
*
* @author []
* @email []
*/
@RestController // 标识该类为RESTful控制器
@RequestMapping("/yonghu") // 映射请求路径为/yonghu
public class YonghuController {
private static final Logger logger = LoggerFactory.getLogger(YonghuController.class); // 创建日志记录器实例
private static final String TABLE_NAME = "yonghu"; // 定义表名常量
@Autowired // 自动注入YonghuService
private YonghuService yonghuService; // 用户服务类
@Autowired // 自动注入TokenService
private TokenService tokenService; // Token服务类
@Autowired // 自动注入DictionaryService
private DictionaryService dictionaryService; // 字典服务类
@Autowired // 自动注入ForumService
private ForumService forumService; // 论坛服务类
@Autowired // 自动注入GerentizhengService
private GerentizhengService gerentizhengService; // 体检记录服务类
@Autowired // 自动注入JiankangtieshiService
private JiankangtieshiService jiankangtieshiService; // 健康贴士服务类
@Autowired // 自动注入MeirijihuaService
private MeirijihuaService meirijihuaService; // 每日计划服务类
@Autowired // 自动注入MeishiService
private MeishiService meishiService; // 健康食谱服务类
@Autowired // 自动注入MeishiCollectionService
private MeishiCollectionService meishiCollectionService; // 健康食谱收藏服务类
@Autowired // 自动注入MeishiLiuyanService
private MeishiLiuyanService meishiLiuyanService; // 健康食谱留言服务类
@Autowired // 自动注入NewsService
private NewsService newsService; // 公告信息服务类
@Autowired // 自动注入YaopinService
private YaopinService yaopinService; // 药品信息服务类
@Autowired // 自动注入YundongService
private YundongService yundongService; // 运动教程服务类
@Autowired // 自动注入YundongCollectionService
private YundongCollectionService yundongCollectionService; // 运动教程收藏服务类
@Autowired // 自动注入YundongLiuyanService
private YundongLiuyanService yundongLiuyanService; // 运动教程留言服务类
@Autowired // 自动注入UsersService
private UsersService usersService; // 管理员服务类
/**
*
*
*/
@RequestMapping("/page") // 映射请求路径为/page
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) { // 处理分页请求
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params)); // 记录日志
String role = String.valueOf(request.getSession().getAttribute("role")); // 获取用户角色
if (false) // 永远不会进入的条件
return R.error(511, "永不会进入"); // 返回错误信息
else if ("用户".equals(role)) // 如果用户角色为“用户”
params.put("yonghuId", request.getSession().getAttribute("userId")); // 设置用户ID
params.put("yonghuDeleteStart", 1); // 设置删除状态参数
params.put("yonghuDeleteEnd", 1); // 设置删除状态参数
CommonUtil.checkMap(params); // 检查参数
PageUtils page = yonghuService.queryPage(params); // 查询分页数据
// 字典表数据转换
List<YonghuView> list = (List<YonghuView>) page.getList(); // 获取分页数据列表
for (YonghuView c : list) { // 遍历列表
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request); // 转换字典数据
}
return R.ok().put("data", page); // 返回结果
}
/**
*
* ID
*/
@RequestMapping("/info/{id}") // 映射请求路径为/info/{id}
public R info(@PathVariable("id") Long id, HttpServletRequest request) { // 处理详情请求
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id); // 记录日志
YonghuEntity yonghu = yonghuService.selectById(id); // 根据ID查询实体
if (yonghu != null) { // 如果查询到数据
// entity转view
YonghuView view = new YonghuView(); // 创建视图对象
BeanUtils.copyProperties(yonghu, view); // 把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request); // 转换字典数据
return R.ok().put("data", view); // 返回结果
} else {
return R.error(511, "查不到数据"); // 返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/save") // 映射请求路径为/save
public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request) { // 处理保存请求
logger.debug("save方法:,,Controller:{},,yonghu:{}", this.getClass().getName(), yonghu.toString()); // 记录日志
String role = String.valueOf(request.getSession().getAttribute("role")); // 获取用户角色
if (false) // 永远不会进入的条件
return R.error(511, "永远不会进入"); // 返回错误信息
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>() // 构建查询条件
.eq("username", yonghu.getUsername()) // 账户名相等
.or() // 或者
.eq("yonghu_phone", yonghu.getYonghuPhone()) // 手机号相等
.or() // 或者
.eq("yonghu_id_number", yonghu.getYonghuIdNumber()) // 身份证号相等
.andNew() // 新的条件
.eq("yonghu_delete", 1); // 删除状态为1
logger.info("sql语句:" + queryWrapper.getSqlSegment()); // 记录SQL语句
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
// 查询是否存在相同数据
if (yonghuEntity == null) {
// 如果不存在相同数据
yonghu.setYonghuDelete(1);
// 设置删除状态
yonghu.setCreateTime(new Date());
// 设置创建时间
yonghu.setPassword("123456");
// 设置默认密码
yonghuService.insert(yonghu);
// 插入数据
return R.ok();
// 返回成功结果
} else {
return R.error(511, "账户或者联系方式或者身份证号已经被使用");
// 返回错误信息
}
}
/**
*
* ID
*/
@RequestMapping("/update")
// 映射请求路径为/update
public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 处理修改请求
logger.debug("update方法:,,Controller:{},,yonghu:{}", this.getClass().getName(), yonghu.toString());
// 记录日志
YonghuEntity oldYonghuEntity = yonghuService.selectById(yonghu.getId());
// 查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
// if(false)
// return R.error(511,"永远不会进入");
if ("".equals(yonghu.getYonghuPhoto()) || "null".equals(yonghu.getYonghuPhoto())) {
// 如果药品照片为空或为"null"
yonghu.setYonghuPhoto(null);
// 设置为null
}
yonghuService.updateById(yonghu);
// 根据id更新
return R.ok();
// 返回成功结果
}
/**
*
* ID
*/
@RequestMapping("/delete")
// 映射请求路径为/delete
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
// 处理删除请求
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 记录日志
List<YonghuEntity> oldYonghuList = yonghuService.selectBatchIds(Arrays.asList(ids));
// 要删除的数据
ArrayList<YonghuEntity> list = new ArrayList<>();
// 创建列表存储要更新的实体
for (Integer id : ids) {
// 遍历ID数组
YonghuEntity yonghuEntity = new YonghuEntity();
// 创建实体对象
yonghuEntity.setId(id);
// 设置ID
yonghuEntity.setYonghuDelete(2);
// 设置删除状态
list.add(yonghuEntity);
// 添加到列表中
}
if (list != null && list.size() > 0) {
// 如果列表不为空且大小大于0
yonghuService.updateBatchById(list);
// 更新批量数据
}
return R.ok();
// 返回成功结果
}
/**
*
*
*/
@RequestMapping("/batchInsert")
// 映射请求路径为/batchInsert
public R save(String fileName, HttpServletRequest request) {
// 处理批量上传请求
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 记录日志
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 获取用户ID
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 初始化日期格式化器
try {
List<YonghuEntity> yonghuList = new ArrayList<>();
// 定义药品信息列表
Map<String, List<String>> seachFields = new HashMap<>();
// 定义要查询的字段
Date date = new Date();
// 获取当前时间
int lastIndexOf = fileName.lastIndexOf(".");
// 获取文件后缀
if (lastIndexOf == -1) {
// 如果文件没有后缀
return R.error(511, "该文件没有后缀");
// 返回错误信息
} else {
String suffix = fileName.substring(lastIndexOf);
// 获取文件后缀
if (!".xls".equals(suffix)) {
// 如果不是xls文件
return R.error(511, "只支持后缀为xls的excel文件");
// 返回错误信息
} else {
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName); // 获取文件路径
File file = new File(resource.getFile());
// 获取文件对象
if (!file.exists()) {
// 如果文件不存在
return R.error(511, "找不到上传文件,请联系管理员");
// 返回错误信息
} else {
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 读取Excel数据并解析
dataList.remove(0);
// 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 遍历数据
// 循环
YonghuEntity yonghuEntity = new YonghuEntity();
// 创建实体对象
// yonghuEntity.setUsername(data.get(0));
// 账户 要改的
// //yonghuEntity.setPassword("123456");
// 密码
// yonghuEntity.setYonghuName(data.get(0));
// 用户姓名 要改的
// yonghuEntity.setSexTypes(Integer.valueOf(data.get(0)));
// 性别 要改的
// yonghuEntity.setYonghuPhoto("");
// 详情和图片
// yonghuEntity.setYonghuIdNumber(data.get(0));
// 身份证号 要改的
// yonghuEntity.setYonghuPhone(data.get(0));
// 联系方式 要改的
// yonghuEntity.setYonghuEmail(data.get(0));
// 电子邮箱 要改的
// yonghuEntity.setYonghuDelete(1);
// 逻辑删除字段
// yonghuEntity.setCreateTime(date);
// 时间
yonghuList.add(yonghuEntity);
// 添加到列表中
// 把要查询是否重复的字段放入map中
// 账户
if (seachFields.containsKey("username")) {
// 如果map中包含username
List<String> username = seachFields.get("username");
// 获取username列表
username.add(data.get(0));
// 添加到列表中
} else {
List<String> username = new ArrayList<>();
// 创建新的username列表
username.add(data.get(0));
// 添加到列表中
seachFields.put("username", username);
// 放入map中
}
// 身份证号
if (seachFields.containsKey("yonghuIdNumber")) {
// 如果map中包含yonghuIdNumber
List<String> yonghuIdNumber = seachFields.get("yonghuIdNumber");
// 获取yonghuIdNumber列表
yonghuIdNumber.add(data.get(0));
// 添加到列表中
} else {
List<String> yonghuIdNumber = new ArrayList<>();
// 创建新的yonghuIdNumber列表
yonghuIdNumber.add(data.get(0));
// 添加到列表中
seachFields.put("yonghuIdNumber", yonghuIdNumber);
// 放入map中
}
// 联系方式
if (seachFields.containsKey("yonghuPhone")) {
// 如果map中包含yonghuPhone
List<String> yonghuPhone = seachFields.get("yonghuPhone");
// 获取yonghuPhone列表
yonghuPhone.add(data.get(0));
// 添加到列表中
} else {
List<String> yonghuPhone = new ArrayList<>();
// 创建新的yonghuPhone列表
yonghuPhone.add(data.get(0));
// 添加到列表中
seachFields.put("yonghuPhone", yonghuPhone);
// 放入map中
}
}
// 查询是否重复
// 账户
List<YonghuEntity> yonghuEntities_username = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("username", seachFields.get("username")).eq("yonghu_delete", 1));
// 查询账户是否重复
if (yonghuEntities_username.size() > 0) {
// 如果存在重复数据
ArrayList<String> repeatFields = new ArrayList<>();
// 创建重复字段列表
for (YonghuEntity s : yonghuEntities_username) {
repeatFields.add(s.getUsername());
}
return R.error(511, "数据库的该表中的 [账户] 字段已经存在 存在数据为:" + repeatFields.toString());
}
//身份证号
List<YonghuEntity> yonghuEntities_yonghuIdNumber = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_id_number", seachFields.get("yonghuIdNumber")).eq("yonghu_delete", 1));
if (yonghuEntities_yonghuIdNumber.size() > 0) {
ArrayList<String> repeatFields = new ArrayList<>();
for (YonghuEntity s : yonghuEntities_yonghuIdNumber) {
repeatFields.add(s.getYonghuIdNumber());
}
return R.error(511, "数据库的该表中的 [身份证号] 字段已经存在 存在数据为:" + repeatFields.toString());
}
//联系方式
List<YonghuEntity> yonghuEntities_yonghuPhone = yonghuService.selectList(new EntityWrapper<YonghuEntity>().in("yonghu_phone", seachFields.get("yonghuPhone")).eq("yonghu_delete", 1));
if (yonghuEntities_yonghuPhone.size() > 0) {
ArrayList<String> repeatFields = new ArrayList<>();
for (YonghuEntity s : yonghuEntities_yonghuPhone) {
repeatFields.add(s.getYonghuPhone());
}
return R.error(511, "数据库的该表中的 [联系方式] 字段已经存在 存在数据为:" + repeatFields.toString());
}
yonghuService.insertBatch(yonghuList);
return R.ok();
}
}
}
} catch (Exception e) {
e.printStackTrace();
return R.error(511, "批量插入数据异常,请联系管理员");
}
}
/**
*
*/
/**
*
*
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
// 根据用户名查询用户信息
if (yonghu == null || !yonghu.getPassword().equals(password))
// 如果用户不存在或密码不匹配
return R.error("账号或密码不正确");
else if (yonghu.getYonghuDelete() != 1)
// 如果用户已被删除
return R.error("账户已被删除");
String token = tokenService.generateToken(yonghu.getId(), username, "yonghu", "用户");
// 生成Token
R r = R.ok();
// 创建返回结果对象
r.put("token", token);
// 设置Token
r.put("role", "用户");
// 设置角色
r.put("username", yonghu.getYonghuName());
// 设置用户名
r.put("tableName", "yonghu");
// 设置表名
r.put("userId", yonghu.getId());
// 设置用户ID
return r;
// 返回成功结果
}
/**
*
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {
// ValidatorUtils.validateEntity(user);
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("username", yonghu.getUsername())
.or()
.eq("yonghu_id_number", yonghu.getYonghuIdNumber())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.andNew()
.eq("yonghu_delete", 1);
// 构建查询条件,检查账户、身份证号或手机号是否已存在
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
// 查询是否存在相同数据
if (yonghuEntity != null)
// 如果存在相同数据
return R.error("账户或者联系方式或者身份证号已经被使用");
yonghu.setYonghuDelete(1);
// 设置删除状态
yonghu.setCreateTime(new Date());
// 设置创建时间
yonghuService.insert(yonghu);
// 插入新用户数据
return R.ok();
// 返回成功结果
}
/**
*
* ID
*/
@GetMapping(value = "/resetPassword")
public R resetPassword(Integer id, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectById(id);
// 根据ID查询用户信息
yonghu.setPassword("123456");
// 设置默认密码
yonghuService.updateById(yonghu);
// 更新用户信息
return R.ok();
// 返回成功结果
}
/**
*
*
*/
@GetMapping(value = "/updatePassword")
public R updatePassword(String oldPassword, String newPassword, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectById((Integer) request.getSession().getAttribute("userId"));
// 根据会话中的用户ID查询用户信息
if (newPassword == null) {
// 如果新密码为空
return R.error("新密码不能为空");
}
if (!oldPassword.equals(yonghu.getPassword())) {
// 如果旧密码不匹配
return R.error("原密码输入错误");
}
if (newPassword.equals(yonghu.getPassword())) {
// 如果新密码与旧密码相同
return R.error("新密码不能和原密码一致");
}
yonghu.setPassword(newPassword);
// 设置新密码
yonghuService.updateById(yonghu);
// 更新用户信息
return R.ok();
// 返回成功结果
}
/**
*
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request) {
YonghuEntity yonghu = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("username", username));
// 根据用户名查询用户信息
if (yonghu != null) {
// 如果用户存在
yonghu.setPassword("123456");
// 设置默认密码
yonghuService.updateById(yonghu);
// 更新用户信息
return R.ok();
} else {
// 如果用户不存在
return R.error("账号不存在");
}
}
/**
* session
*
*/
@RequestMapping("/session")
public R getCurrYonghu(HttpServletRequest request) {
Integer id = (Integer) request.getSession().getAttribute("userId");
// 从会话中获取用户ID
YonghuEntity yonghu = yonghuService.selectById(id);
// 根据ID查询用户信息
if (yonghu != null) {
// 如果用户存在
//entity转view
YonghuView view = new YonghuView();
BeanUtils.copyProperties(yonghu, view);//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据
return R.ok().put("data", view);
// 返回用户信息
} else {
return R.error(511, "查不到数据");
// 返回错误信息
}
}
/**
* 退
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
// 使会话失效
return R.ok("退出成功");
// 返回成功结果
}
/**
*
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志
CommonUtil.checkMap(params);
// 检查参数
PageUtils page = yonghuService.queryPage(params);
// 查询分页数据
//字典表数据转换
List<YonghuView> list = (List<YonghuView>) page.getList();
// 获取分页数据列表
for (YonghuView c : list)
dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
// 转换字典数据
return R.ok().put("data", page);
// 返回结果
}
/**
*
* ID
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 记录日志
YonghuEntity yonghu = yonghuService.selectById(id);
// 根据ID查询用户信息
if (yonghu != null) {
// 如果用户存在
//entity转view
YonghuView view = new YonghuView();
BeanUtils.copyProperties(yonghu, view);//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据
return R.ok().put("data", view);
// 返回用户信息
} else {
return R.error(511, "查不到数据");
// 返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/add")
public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {
logger.debug("add方法:,,Controller:{},,yonghu:{}", this.getClass().getName(), yonghu.toString());
// 记录日志
Wrapper<YonghuEntity> queryWrapper = new EntityWrapper<YonghuEntity>()
.eq("username", yonghu.getUsername())
.or()
.eq("yonghu_id_number", yonghu.getYonghuIdNumber())
.or()
.eq("yonghu_phone", yonghu.getYonghuPhone())
.andNew()
.eq("yonghu_delete", 1)
// .notIn("yonghu_types", new Integer[]{102})
;
// 构建查询条件,检查账户、身份证号或手机号是否已存在
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 记录SQL语句
YonghuEntity yonghuEntity = yonghuService.selectOne(queryWrapper);
// 查询是否存在相同数据
if (yonghuEntity == null) {
// 如果不存在相同数据
yonghu.setYonghuDelete(1);
// 设置删除状态
yonghu.setCreateTime(new Date());
// 设置创建时间
yonghu.setPassword("123456");
// 设置默认密码
yonghuService.insert(yonghu);
// 插入新用户数据
return R.ok();
// 返回成功结果
} else {
return R.error(511, "账户或者联系方式或者身份证号已经被使用");
// 返回错误信息
}
}
}

@ -0,0 +1,443 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@RequestMapping("/yundongCollection")
public class YundongCollectionController {
private static final Logger logger = LoggerFactory.getLogger(YundongCollectionController.class);
private static final String TABLE_NAME = "yundongCollection";
@Autowired
private YundongCollectionService yundongCollectionService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService; // 字典服务类
@Autowired
private ForumService forumService; // 论坛服务类
@Autowired
private GerentizhengService gerentizhengService; // 体检记录服务类
@Autowired
private JiankangtieshiService jiankangtieshiService; // 健康贴士服务类
@Autowired
private MeirijihuaService meirijihuaService; // 每日计划服务类
@Autowired
private MeishiService meishiService; // 健康食谱服务类
@Autowired
private MeishiCollectionService meishiCollectionService; // 健康食谱收藏服务类
@Autowired
private MeishiLiuyanService meishiLiuyanService; // 健康食谱留言服务类
@Autowired
private NewsService newsService; // 公告信息服务类
@Autowired
private YaopinService yaopinService; // 药品信息服务类
@Autowired
private YonghuService yonghuService; // 用户服务类
@Autowired
private YundongService yundongService; // 运动教程服务类
@Autowired
private YundongLiuyanService yundongLiuyanService; // 运动教程留言服务类
@Autowired
private UsersService usersService; // 管理员服务类
/**
*
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
if (false)
// 永远不会进入的条件
return R.error(511, "永不会进入");
else if ("用户".equals(role))
// 如果用户角色为“用户”
params.put("yonghuId", request.getSession().getAttribute("userId"));
// 设置用户ID
CommonUtil.checkMap(params);
// 检查参数
PageUtils page = yundongCollectionService.queryPage(params);
// 查询分页数据
// 字典表数据转换
List<YundongCollectionView> list = (List<YundongCollectionView>) page.getList();
// 获取分页数据列表
for (YundongCollectionView c : list) {
// 遍历列表
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
// 转换字典数据
}
return R.ok().put("data", page);
// 返回结果
}
/**
*
* ID
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request) {
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 记录日志
YundongCollectionEntity yundongCollection = yundongCollectionService.selectById(id);
// 根据ID查询实体
if (yundongCollection != null) {
// 如果查询到数据
// entity转view
YundongCollectionView view = new YundongCollectionView();
BeanUtils.copyProperties(yundongCollection, view);
// 把实体数据重构到view中
// 级联表 运动教程
YundongEntity yundong = yundongService.selectById(yundongCollection.getYundongId());
// 根据运动教程ID查询运动教程信息
if (yundong != null) {
BeanUtils.copyProperties(yundong, view, new String[]{"id", "createTime", "insertTime", "updateTime", "yonghuId"});
// 把级联的数据添加到view中并排除id和创建时间字段
view.setYundongId(yundong.getId());
}
// 级联表 用户
YonghuEntity yonghu = yonghuService.selectById(yundongCollection.getYonghuId());
// 根据用户ID查询用户信息
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createTime", "insertTime", "updateTime", "yonghuId"});
// 把级联的数据添加到view中并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据
return R.ok().put("data", view);
// 返回结果
} else {
return R.error(511, "查不到数据");
// 返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/save")
public R save(@RequestBody YundongCollectionEntity yundongCollection, HttpServletRequest request) {
logger.debug("save方法:,,Controller:{},,yundongCollection:{}", this.getClass().getName(), yundongCollection.toString());
// 记录日志
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
if (false)
// 永远不会进入的条件
return R.error(511, "永远不会进入");
else if ("用户".equals(role))
// 如果用户角色为“用户”
yundongCollection.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 设置用户ID
Wrapper<YundongCollectionEntity> queryWrapper = new EntityWrapper<YundongCollectionEntity>()
.eq("yundong_id", yundongCollection.getYundongId())
.eq("yonghu_id", yundongCollection.getYonghuId())
.eq("yundong_collection_types", yundongCollection.getYundongCollectionTypes())
;
// 构建查询条件
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 记录SQL语句
YundongCollectionEntity yundongCollectionEntity = yundongCollectionService.selectOne(queryWrapper);
// 查询是否存在相同数据
if (yundongCollectionEntity == null) {
// 如果不存在相同数据
yundongCollection.setInsertTime(new Date());
// 设置插入时间
yundongCollection.setCreateTime(new Date());
// 设置创建时间
yundongCollectionService.insert(yundongCollection);
// 插入数据
return R.ok();
// 返回成功结果
} else {
return R.error(511, "表中有相同数据");
// 返回错误信息
}
}
/**
*
* ID
*/
@RequestMapping("/update")
public R update(@RequestBody YundongCollectionEntity yundongCollection, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,yundongCollection:{}", this.getClass().getName(), yundongCollection.toString());
// 记录日志
YundongCollectionEntity oldYundongCollectionEntity = yundongCollectionService.selectById(yundongCollection.getId());
// 查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// yundongCollection.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
yundongCollectionService.updateById(yundongCollection);
// 根据id更新
return R.ok();
// 返回成功结果
}
/**
*
* ID
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 记录日志
List<YundongCollectionEntity> oldYundongCollectionList = yundongCollectionService.selectBatchIds(Arrays.asList(ids));
// 要删除的数据
yundongCollectionService.deleteBatchIds(Arrays.asList(ids));
// 删除批量数据
return R.ok();
// 返回成功结果
}
/**
*
*
*/
@RequestMapping("/batchInsert")
public R save(String fileName, HttpServletRequest request) {
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 记录日志
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 获取用户ID
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 初始化日期格式化器
try {
List<YundongCollectionEntity> yundongCollectionList = new ArrayList<>();
// 定义运动教程收藏信息列表
Map<String, List<String>> seachFields = new HashMap<>();
// 定义要查询的字段
Date date = new Date();
// 获取当前时间
int lastIndexOf = fileName.lastIndexOf(".");
// 获取文件后缀
if (lastIndexOf == -1) {
// 如果文件没有后缀
return R.error(511, "该文件没有后缀");
// 返回错误信息
} else {
String suffix = fileName.substring(lastIndexOf);
// 获取文件后缀
if (!".xls".equals(suffix)) {
// 如果不是xls文件
return R.error(511, "只支持后缀为xls的excel文件");
// 返回错误信息
} else {
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件路径
File file = new File(resource.getFile());
// 获取文件对象
if (!file.exists()) {
// 如果文件不存在
return R.error(511, "找不到上传文件,请联系管理员");
// 返回错误信息
} else {
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 读取Excel数据并解析
dataList.remove(0);
// 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
YundongCollectionEntity yundongCollectionEntity = new YundongCollectionEntity();
// yundongCollectionEntity.setYundongId(Integer.valueOf(data.get(0))); //运动教程 要改的
// yundongCollectionEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// yundongCollectionEntity.setYundongCollectionTypes(Integer.valueOf(data.get(0))); //类型 要改的
// yundongCollectionEntity.setInsertTime(date);//时间
// yundongCollectionEntity.setCreateTime(date);//时间
yundongCollectionList.add(yundongCollectionEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
yundongCollectionService.insertBatch(yundongCollectionList);
// 批量插入数据
return R.ok();
// 返回成功结果
}
}
}
} catch (Exception e) {
e.printStackTrace();
return R.error(511, "批量插入数据异常,请联系管理员");
// 返回错误信息
}
}
/**
*
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志
CommonUtil.checkMap(params);
// 检查参数
PageUtils page = yundongCollectionService.queryPage(params);
// 查询分页数据
// 字典表数据转换
List<YundongCollectionView> list = (List<YundongCollectionView>) page.getList();
// 获取分页数据列表
for (YundongCollectionView c : list)
dictionaryService.dictionaryConvert(c, request); // 修改对应字典表字段
// 转换字典数据
return R.ok().put("data", page);
// 返回结果
}
/**
*
* ID
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 记录日志
YundongCollectionEntity yundongCollection = yundongCollectionService.selectById(id);
// 根据ID查询实体
if (yundongCollection != null) {
// 如果查询到数据
// entity转view
YundongCollectionView view = new YundongCollectionView();
BeanUtils.copyProperties(yundongCollection, view);
// 把实体数据重构到view中
// 级联表
YundongEntity yundong = yundongService.selectById(yundongCollection.getYundongId());
// 根据运动教程ID查询运动教程信息
if (yundong != null) {
BeanUtils.copyProperties(yundong, view, new String[]{"id", "createDate"});
// 把级联的数据添加到view中并排除id和创建时间字段
view.setYundongId(yundong.getId());
}
// 级联表
YonghuEntity yonghu = yonghuService.selectById(yundongCollection.getYonghuId());
// 根据用户ID查询用户信息
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createDate"});
// 把级联的数据添加到view中并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据
return R.ok().put("data", view);
// 返回结果
} else {
return R.error(511, "查不到数据");
// 返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/add")
public R add(@RequestBody YundongCollectionEntity yundongCollection, HttpServletRequest request) {
logger.debug("add方法:,,Controller:{},,yundongCollection:{}", this.getClass().getName(), yundongCollection.toString());
// 记录日志
Wrapper<YundongCollectionEntity> queryWrapper = new EntityWrapper<YundongCollectionEntity>()
.eq("yundong_id", yundongCollection.getYundongId())
.eq("yonghu_id", yundongCollection.getYonghuId())
.eq("yundong_collection_types", yundongCollection.getYundongCollectionTypes())
// .notIn("yundong_collection_types", new Integer[]{102})
;
// 构建查询条件
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 记录SQL语句
YundongCollectionEntity yundongCollectionEntity = yundongCollectionService.selectOne(queryWrapper);
// 查询是否存在相同数据
if (yundongCollectionEntity == null) {
// 如果不存在相同数据
yundongCollection.setInsertTime(new Date());
// 设置插入时间
yundongCollection.setCreateTime(new Date());
// 设置创建时间
yundongCollectionService.insert(yundongCollection);
// 插入数据
return R.ok();
// 返回成功结果
} else {
return R.error(511, "您已经收藏过了");
// 返回错误信息
}
}
}

@ -0,0 +1,642 @@
package com.controller;
import java.io.File;
// 导入File类用于文件操作
import java.math.BigDecimal;
// 导入BigDecimal类用于高精度计算
import java.net.URL;
// 导入URL类用于处理URL
import java.text.SimpleDateFormat;
// 导入SimpleDateFormat类用于日期格式化
import com.alibaba.fastjson.JSONObject;
// 导入JSONObject类用于JSON处理
import java.util.*;
// 导入Java集合框架
import org.springframework.beans.BeanUtils;
// 导入BeanUtils类用于对象属性复制
import javax.servlet.http.HttpServletRequest;
// 导入HttpServletRequest类用于处理HTTP请求
import org.springframework.web.context.ContextLoader;
// 导入ContextLoader类用于获取Web应用上下文
import javax.servlet.ServletContext;
// 导入ServletContext类用于获取Servlet上下文
import com.service.TokenService;
// 导入TokenService类用于处理Token相关操作
import com.utils.*;
// 导入自定义工具类
import java.lang.reflect.InvocationTargetException;
// 导入InvocationTargetException类用于处理反射异常
import com.service.DictionaryService;
// 导入DictionaryService类用于处理字典数据
import org.apache.commons.lang3.StringUtils;
// 导入StringUtils类用于字符串操作
import com.annotation.IgnoreAuth;
// 导入IgnoreAuth注解用于忽略权限验证
import org.slf4j.Logger;
// 导入Logger类用于日志记录
import org.slf4j.LoggerFactory;
// 导入LoggerFactory类用于创建Logger实例
import org.springframework.beans.factory.annotation.Autowired;
// 导入Autowired注解用于自动注入依赖
import org.springframework.stereotype.Controller;
// 导入Controller注解用于标识控制器类
import org.springframework.web.bind.annotation.*;
// 导入Web绑定注解用于处理HTTP请求
import com.baomidou.mybatisplus.mapper.EntityWrapper;
// 导入EntityWrapper类用于构建查询条件
import com.baomidou.mybatisplus.mapper.Wrapper;
// 导入Wrapper接口用于构建查询条件
import com.entity.*;
// 导入实体类
import com.entity.view.*;
// 导入视图类
import com.service.*;
// 导入服务类
import com.utils.PageUtils;
// 导入PageUtils类用于分页处理
import com.utils.R;
// 导入R类用于封装返回结果
import com.alibaba.fastjson.*;
// 导入FastJSON相关类用于JSON处理
/**
*
*
* @author
* @email
*/
@RestController
// 标识该类为RESTful控制器
@RequestMapping("/yundong")
// 映射请求路径为/yundong
public class YundongController {
private static final Logger logger = LoggerFactory.getLogger(YundongController.class);
// 创建日志记录器实例
private static final String TABLE_NAME = "yundong";
// 定义表名常量
@Autowired
// 自动注入YundongService
private YundongService yundongService;
// 运动教程服务类
@Autowired
// 自动注入TokenService
private TokenService tokenService;
// Token服务类
@Autowired
// 自动注入DictionaryService
private DictionaryService dictionaryService;
// 字典服务类
@Autowired
// 自动注入ForumService
private ForumService forumService;
// 论坛服务类
@Autowired
// 自动注入GerentizhengService
private GerentizhengService gerentizhengService;
// 体检记录服务类
@Autowired
// 自动注入JiankangtieshiService
private JiankangtieshiService jiankangtieshiService;
// 健康贴士服务类
@Autowired
// 自动注入MeirijihuaService
private MeirijihuaService meirijihuaService;
// 每日计划服务类
@Autowired
// 自动注入MeishiService
private MeishiService meishiService;
// 健康食谱服务类
@Autowired
// 自动注入MeishiCollectionService
private MeishiCollectionService meishiCollectionService;
// 健康食谱收藏服务类
@Autowired
// 自动注入MeishiLiuyanService
private MeishiLiuyanService meishiLiuyanService;
// 健康食谱留言服务类
@Autowired
// 自动注入NewsService
private NewsService newsService;
// 公告信息服务类
@Autowired
// 自动注入YaopinService
private YaopinService yaopinService;
// 药品信息服务类
@Autowired
// 自动注入YonghuService
private YonghuService yonghuService;
// 用户服务类
@Autowired
// 自动注入YundongCollectionService
private YundongCollectionService yundongCollectionService;
// 运动教程收藏服务类
@Autowired
// 自动注入YundongLiuyanService
private YundongLiuyanService yundongLiuyanService;
// 运动教程留言服务类
@Autowired
// 自动注入UsersService
private UsersService usersService;
// 管理员服务类
/**
*
*/
@RequestMapping("/page")
// 映射请求路径为/page
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 处理分页请求
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
if (false)
// 永远不会进入的条件
return R.error(511, "永不会进入");
else if ("用户".equals(role))
// 如果用户角色为“用户”
params.put("yonghuId", request.getSession().getAttribute("userId"));
// 设置用户ID
params.put("yundongDeleteStart", 1);
// 设置删除状态参数
params.put("yundongDeleteEnd", 1);
// 设置删除状态参数
CommonUtil.checkMap(params);
// 检查参数
PageUtils page = yundongService.queryPage(params);
// 查询分页数据
// 字典表数据转换
List<YundongView> list = (List<YundongView>) page.getList();
// 获取分页数据列表
for (YundongView c : list) {
// 遍历列表
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
// 转换字典数据
}
return R.ok().put("data", page);
// 返回结果
}
/**
*
* ID
*/
@RequestMapping("/info/{id}")
// 映射请求路径为/info/{id}
public R info(@PathVariable("id") Long id, HttpServletRequest request) {
// 处理详情请求
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 记录日志
YundongEntity yundong = yundongService.selectById(id);
// 根据ID查询实体
if (yundong != null) {
// 如果查询到数据
// entity转view
YundongView view = new YundongView();
BeanUtils.copyProperties(yundong, view);
// 把实体数据重构到view中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据
return R.ok().put("data", view);
// 返回结果
} else {
return R.error(511, "查不到数据");
// 返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/save")
// 映射请求路径为/save
public R save(@RequestBody YundongEntity yundong, HttpServletRequest request) {
// 处理保存请求
logger.debug("save方法:,,Controller:{},,yundong:{}", this.getClass().getName(), yundong.toString());
// 记录日志
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
if (false)
// 永远不会进入的条件
return R.error(511, "永远不会进入");
Wrapper<YundongEntity> queryWrapper = new EntityWrapper<YundongEntity>()
.eq("yundong_name", yundong.getYundongName())
.eq("yundong_types", yundong.getYundongTypes())
.eq("yundong_video", yundong.getYundongVideo())
.eq("yundong_num", yundong.getYundongNum())
.eq("zan_number", yundong.getZanNumber())
.eq("cai_number", yundong.getCaiNumber())
.eq("yundong_delete", yundong.getYundongDelete());
// 构建查询条件
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 记录SQL语句
YundongEntity yundongEntity = yundongService.selectOne(queryWrapper);
// 查询是否存在相同数据
if (yundongEntity == null) {
// 如果不存在相同数据
yundong.setYundongDelete(1);
// 设置删除状态
yundong.setInsertTime(new Date());
// 设置插入时间
yundong.setCreateTime(new Date());
// 设置创建时间
yundongService.insert(yundong);
// 插入数据
return R.ok();
// 返回成功结果
} else {
return R.error(511, "表中有相同数据");
// 返回错误信息
}
}
/**
*
* ID
*/
@RequestMapping("/update")
// 映射请求路径为/update
public R update(@RequestBody YundongEntity yundong, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
// 处理修改请求
logger.debug("update方法:,,Controller:{},,yundong:{}", this.getClass().getName(), yundong.toString());
// 记录日志
YundongEntity oldYundongEntity = yundongService.selectById(yundong.getId());
// 查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
// if(false)
// return R.error(511,"永远不会进入");
if ("".equals(yundong.getYundongPhoto()) || "null".equals(yundong.getYundongPhoto())) {
// 如果运动教程图片为空或为"null"
yundong.setYundongPhoto(null);
// 设置为null
}
if ("".equals(yundong.getYundongVideo()) || "null".equals(yundong.getYundongVideo())) {
// 如果运动教程视频为空或为"null"
yundong.setYundongVideo(null);
// 设置为null
}
yundongService.updateById(yundong);
// 根据id更新
return R.ok();
// 返回成功结果
}
/**
*
* ID
*/
@RequestMapping("/delete")
// 映射请求路径为/delete
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
// 处理删除请求
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 记录日志
List<YundongEntity> oldYundongList = yundongService.selectBatchIds(Arrays.asList(ids));
// 要删除的数据
ArrayList<YundongEntity> list = new ArrayList<>();
// 创建列表存储要更新的实体
for (Integer id : ids) {
// 遍历ID数组
YundongEntity yundongEntity = new YundongEntity();
// 创建实体对象
yundongEntity.setId(id);
// 设置ID
yundongEntity.setYundongDelete(2);
// 设置删除状态
list.add(yundongEntity);
// 添加到列表中
}
if (list != null && list.size() > 0) {
// 如果列表不为空且大小大于0
yundongService.updateBatchById(list);
// 更新批量数据
}
return R.ok();
// 返回成功结果
}
/**
*
*
*/
@RequestMapping("/batchInsert")
// 映射请求路径为/batchInsert
public R save(String fileName, HttpServletRequest request) {
// 处理批量上传请求
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 记录日志
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 获取用户ID
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 初始化日期格式化器
try {
List<YundongEntity> yundongList = new ArrayList<>();
// 定义运动教程信息列表
Map<String, List<String>> seachFields = new HashMap<>();
// 定义要查询的字段
Date date = new Date();
// 获取当前时间
int lastIndexOf = fileName.lastIndexOf(".");
// 获取文件后缀
if (lastIndexOf == -1) {
// 如果文件没有后缀
return R.error(511, "该文件没有后缀");
// 返回错误信息
} else {
String suffix = fileName.substring(lastIndexOf);
// 获取文件后缀
if (!".xls".equals(suffix)) {
// 如果不是xls文件
return R.error(511, "只支持后缀为xls的excel文件");
// 返回错误信息
} else {
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件路径
File file = new File(resource.getFile());
// 获取文件对象
if (!file.exists()) {
// 如果文件不存在
return R.error(511, "找不到上传文件,请联系管理员");
// 返回错误信息
} else {
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 读取Excel数据并解析
dataList.remove(0);
// 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
YundongEntity yundongEntity = new YundongEntity();
// 创建实体对象
// yundongEntity.setYundongName(data.get(0)); //标题 要改的
// yundongEntity.setYundongPhoto("");//详情和图片
// yundongEntity.setYundongTypes(Integer.valueOf(data.get(0))); //运动类型 要改的
// yundongEntity.setYundongVideo(data.get(0)); //运动视频 要改的
// yundongEntity.setYundongNum(Integer.valueOf(data.get(0))); //消耗热量 要改的
// yundongEntity.setZanNumber(Integer.valueOf(data.get(0))); //赞 要改的
// yundongEntity.setCaiNumber(Integer.valueOf(data.get(0))); //踩 要改的
// yundongEntity.setYundongContent("");//详情和图片
// yundongEntity.setYundongDelete(1);//逻辑删除字段
// yundongEntity.setInsertTime(date);//时间
// yundongEntity.setCreateTime(date);//时间
yundongList.add(yundongEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
yundongService.insertBatch(yundongList);
// 批量插入数据
return R.ok();
// 返回成功结果
}
}
}
} catch (Exception e) {
e.printStackTrace();
return R.error(511, "批量插入数据异常,请联系管理员");
// 返回错误信息
}
}
/**
*
*
*/
@IgnoreAuth
// 忽略权限验证
@RequestMapping("/gexingtuijian")
// 映射请求路径为/gexingtuijian
public R gexingtuijian(@RequestParam Map<String, Object> params, HttpServletRequest request) {
// 处理个性推荐请求
logger.debug("gexingtuijian方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志
CommonUtil.checkMap(params);
// 检查参数
List<YundongView> returnYundongViewList = new ArrayList<>();
// 定义返回的运动教程视图列表
// 查看收藏
Map<String, Object> params1 = new HashMap<>(params);
params1.put("sort", "id");
// 设置排序参数
params1.put("yonghuId", request.getSession().getAttribute("userId"));
// 设置用户ID
PageUtils pageUtils = yundongCollectionService.queryPage(params1);
// 查询用户收藏的运动教程
List<YundongCollectionView> collectionViewsList = (List<YundongCollectionView>) pageUtils.getList();
// 获取收藏列表
Map<Integer, Integer> typeMap = new HashMap<>();
// 定义一个Map来统计每种类型的收藏数量
for (YundongCollectionView collectionView : collectionViewsList) {
// 遍历收藏列表
Integer yundongTypes = collectionView.getYundongTypes();
// 获取运动类型
if (typeMap.containsKey(yundongTypes)) {
// 如果类型已存在
typeMap.put(yundongTypes, typeMap.get(yundongTypes) + 1);
// 增加计数
} else {
typeMap.put(yundongTypes, 1);
// 初始化计数
}
}
List<Integer> typeList = new ArrayList<>();
// 定义一个列表来存储排序后的类型
typeMap.entrySet().stream().sorted((o1, o2) -> o2.getValue() - o1.getValue()).forEach(e -> typeList.add(e.getKey()));
// 按照收藏数量从多到少排序并添加到typeList中
Integer limit = Integer.valueOf(String.valueOf(params.get("limit")));
// 获取推荐数量限制
for (Integer type : typeList) {
// 遍历排序后的类型列表
Map<String, Object> params2 = new HashMap<>(params);
params2.put("yundongTypes", type);
// 设置运动类型参数
PageUtils pageUtils1 = yundongService.queryPage(params2);
// 查询该类型的运动教程
List<YundongView> yundongViewList = (List<YundongView>) pageUtils1.getList();
// 获取查询结果
returnYundongViewList.addAll(yundongViewList);
// 添加到返回列表中
if (returnYundongViewList.size() >= limit) break;
// 如果返回列表数量达到限制,跳出循环
}
// 正常查询出来商品,用于补全推荐缺少的数据
PageUtils page = yundongService.queryPage(params);
// 查询所有运动教程
if (returnYundongViewList.size() < limit) {
// 如果返回列表数量小于限制
int toAddNum = limit - returnYundongViewList.size();
// 计算需要添加的数量
List<YundongView> yundongViewList = (List<YundongView>) page.getList();
// 获取所有运动教程列表
for (YundongView yundongView : yundongViewList) {
// 遍历所有运动教程
Boolean addFlag = true;
for (YundongView returnYundongView : returnYundongViewList) {
// 遍历返回列表
if (returnYundongView.getId().intValue() == yundongView.getId().intValue()) addFlag = false;
// 如果返回列表中已存在此运动教程设置标志为false
}
if (addFlag) {
// 如果标志为true
toAddNum = toAddNum - 1;
// 减少需要添加的数量
returnYundongViewList.add(yundongView);
// 添加到返回列表中
if (toAddNum == 0) break;
// 如果需要添加的数量为0跳出循环
}
}
} else {
returnYundongViewList = returnYundongViewList.subList(0, limit);
// 如果返回列表数量大于限制截取前limit个
}
for (YundongView c : returnYundongViewList)
dictionaryService.dictionaryConvert(c, request);
// 转换字典数据
page.setList(returnYundongViewList);
// 设置返回的运动教程列表
return R.ok().put("data", page);
// 返回结果
}
/**
*
*
*/
@IgnoreAuth
// 忽略权限验证
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志,打印当前控制器名称和参数
CommonUtil.checkMap(params);
// 检查并处理请求参数
PageUtils page = yundongService.queryPage(params);
// 调用服务层方法查询分页数据
// 字典表数据转换
List<YundongView> list = (List<YundongView>) page.getList();
// 获取分页数据中的列表
for (YundongView c : list)
dictionaryService.dictionaryConvert(c, request); // 将字典表字段转换为可读格式
return R.ok().put("data", page);
// 返回封装的成功结果,并将分页数据放入返回对象中
}
/**
*
* ID
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 记录日志打印当前控制器名称和ID参数
YundongEntity yundong = yundongService.selectById(id);
// 根据ID查询实体数据
if (yundong != null) {
// 如果查询到数据
// entity转view
YundongView view = new YundongView();
BeanUtils.copyProperties(yundong, view); // 将实体数据复制到视图对象中
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据为可读格式
return R.ok().put("data", view);
// 返回封装的成功结果,并将视图对象放入返回对象中
} else {
return R.error(511, "查不到数据");
// 如果未查询到数据,返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/add")
public R add(@RequestBody YundongEntity yundong, HttpServletRequest request) {
logger.debug("add方法:,,Controller:{},,yundong:{}", this.getClass().getName(), yundong.toString());
// 记录日志,打印当前控制器名称和传入的实体数据
Wrapper<YundongEntity> queryWrapper = new EntityWrapper<YundongEntity>()
.eq("yundong_name", yundong.getYundongName())
.eq("yundong_types", yundong.getYundongTypes())
.eq("yundong_video", yundong.getYundongVideo())
.eq("yundong_num", yundong.getYundongNum())
.eq("zan_number", yundong.getZanNumber())
.eq("cai_number", yundong.getCaiNumber())
.eq("yundong_delete", yundong.getYundongDelete());
// 构建查询条件,检查是否已存在相同数据
logger.info("sql语句:" + queryWrapper.getSqlSegment());
// 打印生成的SQL语句
YundongEntity yundongEntity = yundongService.selectOne(queryWrapper);
// 查询是否存在相同数据
if (yundongEntity == null) {
// 如果不存在相同数据
yundong.setZanNumber(1);
yundong.setCaiNumber(1);
// 初始化赞和踩的数量为1
yundong.setYundongDelete(1);
// 设置逻辑删除状态为未删除
yundong.setInsertTime(new Date());
yundong.setCreateTime(new Date());
// 设置插入时间和创建时间
yundongService.insert(yundong);
// 插入新数据
return R.ok();
// 返回成功结果
} else {
return R.error(511, "表中有相同数据");
// 如果已存在相同数据,返回错误信息
}
}
}

@ -0,0 +1,458 @@
package com.controller;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;
import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
*
*
* @author
* @email
*/
@RestController
@Controller
@RequestMapping("/yundongLiuyan")
public class YundongLiuyanController {
private static final Logger logger = LoggerFactory.getLogger(YundongLiuyanController.class);
// 创建日志记录器实例
private static final String TABLE_NAME = "yundongLiuyan";
// 定义表名常量
@Autowired
private YundongLiuyanService yundongLiuyanService;
// 自动注入运动教程留言服务类
@Autowired
private TokenService tokenService;
// 自动注入Token服务类
@Autowired
private DictionaryService dictionaryService; // 字典服务类
@Autowired
private ForumService forumService; // 论坛服务类
@Autowired
private GerentizhengService gerentizhengService; // 体检记录服务类
@Autowired
private JiankangtieshiService jiankangtieshiService; // 健康贴士服务类
@Autowired
private MeirijihuaService meirijihuaService; // 每日计划服务类
@Autowired
private MeishiService meishiService; // 健康食谱服务类
@Autowired
private MeishiCollectionService meishiCollectionService; // 健康食谱收藏服务类
@Autowired
private MeishiLiuyanService meishiLiuyanService; // 健康食谱留言服务类
@Autowired
private NewsService newsService; // 公告信息服务类
@Autowired
private YaopinService yaopinService; // 药品信息服务类
@Autowired
private YonghuService yonghuService; // 用户服务类
@Autowired
private YundongService yundongService; // 运动教程服务类
@Autowired
private YundongCollectionService yundongCollectionService; // 运动教程收藏服务类
@Autowired
private UsersService usersService; // 管理员服务类
/**
*
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
logger.debug("page方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志,打印当前控制器名称和参数
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
if (false)
return R.error(511, "永不会进入");
// 永远不会进入的条件
else if ("用户".equals(role))
params.put("yonghuId", request.getSession().getAttribute("userId"));
// 如果用户角色为“用户”设置用户ID
CommonUtil.checkMap(params);
// 检查并处理请求参数
PageUtils page = yundongLiuyanService.queryPage(params);
// 调用服务层方法查询分页数据
// 字典表数据转换
List<YundongLiuyanView> list = (List<YundongLiuyanView>) page.getList();
// 获取分页数据中的列表
for (YundongLiuyanView c : list) {
// 遍历列表
// 修改对应字典表字段
dictionaryService.dictionaryConvert(c, request);
// 将字典表字段转换为可读格式
}
return R.ok().put("data", page);
// 返回封装的成功结果,并将分页数据放入返回对象中
}
/**
*
* ID
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request) {
logger.debug("info方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 记录日志打印当前控制器名称和ID参数
YundongLiuyanEntity yundongLiuyan = yundongLiuyanService.selectById(id);
// 根据ID查询实体数据
if (yundongLiuyan != null) {
// 如果查询到数据
// entity转view
YundongLiuyanView view = new YundongLiuyanView();
BeanUtils.copyProperties(yundongLiuyan, view); // 将实体数据复制到视图对象中
// 级联表 运动教程
// 级联表
YundongEntity yundong = yundongService.selectById(yundongLiuyan.getYundongId());
// 根据运动教程ID查询运动教程实体
if (yundong != null) {
BeanUtils.copyProperties(yundong, view, new String[]{"id", "createTime", "insertTime", "updateTime", "yonghuId"});
// 将运动教程数据复制到视图对象中并排除id和创建时间字段
view.setYundongId(yundong.getId());
// 设置运动教程ID
}
// 级联表 用户
// 级联表
YonghuEntity yonghu = yonghuService.selectById(yundongLiuyan.getYonghuId());
// 根据用户ID查询用户实体
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createTime", "insertTime", "updateTime", "yonghuId"});
// 将用户数据复制到视图对象中并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
// 设置用户ID
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据为可读格式
return R.ok().put("data", view);
// 返回封装的成功结果,并将视图对象放入返回对象中
} else {
return R.error(511, "查不到数据");
// 如果未查询到数据,返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/save")
public R save(@RequestBody YundongLiuyanEntity yundongLiuyan, HttpServletRequest request) {
logger.debug("save方法:,,Controller:{},,yundongLiuyan:{}", this.getClass().getName(), yundongLiuyan.toString());
// 记录日志,打印当前控制器名称和传入的实体数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
if (false)
return R.error(511, "永远不会进入");
// 永远不会进入的条件
else if ("用户".equals(role))
yundongLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
// 如果用户角色为“用户”设置用户ID
yundongLiuyan.setCreateTime(new Date());
yundongLiuyan.setInsertTime(new Date());
// 设置创建时间和插入时间
yundongLiuyanService.insert(yundongLiuyan);
// 插入新数据
return R.ok();
// 返回成功结果
}
/**
*
* ID
*/
@RequestMapping("/update")
public R update(@RequestBody YundongLiuyanEntity yundongLiuyan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,yundongLiuyan:{}", this.getClass().getName(), yundongLiuyan.toString());
// 记录日志,打印当前控制器名称和传入的实体数据
YundongLiuyanEntity oldYundongLiuyanEntity = yundongLiuyanService.selectById(yundongLiuyan.getId());
// 查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// 获取用户角色
// if(false)
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// yundongLiuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
yundongLiuyan.setUpdateTime(new Date());
// 设置更新时间
yundongLiuyanService.updateById(yundongLiuyan);
// 根据id更新数据
return R.ok();
// 返回成功结果
}
/**
*
* ID
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request) {
logger.debug("delete:,,Controller:{},,ids:{}", this.getClass().getName(), ids.toString());
// 记录日志打印当前控制器名称和ID数组
List<YundongLiuyanEntity> oldYundongLiuyanList = yundongLiuyanService.selectBatchIds(Arrays.asList(ids));
// 查询要删除的数据
yundongLiuyanService.deleteBatchIds(Arrays.asList(ids));
// 根据ID数组批量删除数据
return R.ok();
// 返回成功结果
}
/**
*
*
*/
@RequestMapping("/batchInsert")
public R save(String fileName, HttpServletRequest request) {
logger.debug("batchInsert方法:,,Controller:{},,fileName:{}", this.getClass().getName(), fileName);
// 记录日志,打印当前控制器名称和文件名
Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
// 获取用户ID
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 初始化日期格式化器
try {
List<YundongLiuyanEntity> yundongLiuyanList = new ArrayList<>();
// 定义运动教程留言信息列表
Map<String, List<String>> seachFields = new HashMap<>();
// 定义要查询的字段
Date date = new Date();
// 获取当前时间
int lastIndexOf = fileName.lastIndexOf(".");
// 获取文件后缀
if (lastIndexOf == -1) {
// 如果文件没有后缀
return R.error(511, "该文件没有后缀");
// 返回错误信息
} else {
String suffix = fileName.substring(lastIndexOf);
// 获取文件后缀
if (!".xls".equals(suffix)) {
// 如果不是xls文件
return R.error(511, "只支持后缀为xls的excel文件");
// 返回错误信息
} else {
URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);
// 获取文件路径
File file = new File(resource.getFile());
// 获取文件对象
if (!file.exists()) {
// 如果文件不存在
return R.error(511, "找不到上传文件,请联系管理员");
// 返回错误信息
} else {
List<List<String>> dataList = PoiUtil.poiImport(file.getPath());
// 读取Excel数据并解析
dataList.remove(0);
// 删除第一行,因为第一行是提示
for (List<String> data : dataList) {
// 循环
YundongLiuyanEntity yundongLiuyanEntity = new YundongLiuyanEntity();
// 创建实体对象
// yundongLiuyanEntity.setYundongId(Integer.valueOf(data.get(0))); //运动教程 要改的
// yundongLiuyanEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// yundongLiuyanEntity.setYundongLiuyanText(data.get(0)); //留言内容 要改的
// yundongLiuyanEntity.setInsertTime(date);//时间
// yundongLiuyanEntity.setReplyText(data.get(0)); //回复内容 要改的
// yundongLiuyanEntity.setUpdateTime(sdf.parse(data.get(0))); //回复时间 要改的
// yundongLiuyanEntity.setCreateTime(date);//时间
yundongLiuyanList.add(yundongLiuyanEntity);
// 把要查询是否重复的字段放入map中
}
// 查询是否重复
yundongLiuyanService.insertBatch(yundongLiuyanList);
// 批量插入数据
return R.ok();
// 返回成功结果
}
}
}
} catch (Exception e) {
e.printStackTrace();
return R.error(511, "批量插入数据异常,请联系管理员");
// 返回错误信息
}
}
/**
*
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request) {
logger.debug("list方法:,,Controller:{},,params:{}", this.getClass().getName(), JSONObject.toJSONString(params));
// 记录日志,打印当前控制器名称和参数
CommonUtil.checkMap(params);
// 检查并处理请求参数
PageUtils page = yundongLiuyanService.queryPage(params);
// 调用服务层方法查询分页数据
// 字典表数据转换
List<YundongLiuyanView> list = (List<YundongLiuyanView>) page.getList();
// 获取分页数据中的列表
for (YundongLiuyanView c : list)
dictionaryService.dictionaryConvert(c, request); // 修改对应字典表字段
return R.ok().put("data", page);
// 返回封装的成功结果,并将分页数据放入返回对象中
}
/**
*
* ID
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request) {
logger.debug("detail方法:,,Controller:{},,id:{}", this.getClass().getName(), id);
// 记录日志打印当前控制器名称和ID参数
YundongLiuyanEntity yundongLiuyan = yundongLiuyanService.selectById(id);
// 根据ID查询实体数据
if (yundongLiuyan != null) {
// 如果查询到数据
// entity转view
YundongLiuyanView view = new YundongLiuyanView();
BeanUtils.copyProperties(yundongLiuyan, view); // 把实体数据重构到view中
// 级联表
YundongEntity yundong = yundongService.selectById(yundongLiuyan.getYundongId());
// 根据运动教程ID查询运动教程实体
if (yundong != null) {
BeanUtils.copyProperties(yundong, view, new String[]{"id", "createDate"});
// 把运动教程数据添加到view中并排除id和创建时间字段
view.setYundongId(yundong.getId());
// 设置运动教程ID
}
// 级联表
YonghuEntity yonghu = yonghuService.selectById(yundongLiuyan.getYonghuId());
// 根据用户ID查询用户实体
if (yonghu != null) {
BeanUtils.copyProperties(yonghu, view, new String[]{"id", "createDate"});
// 把用户数据添加到view中并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
// 设置用户ID
}
// 修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
// 转换字典数据为可读格式
return R.ok().put("data", view);
// 返回封装的成功结果,并将视图对象放入返回对象中
} else {
return R.error(511, "查不到数据");
// 如果未查询到数据,返回错误信息
}
}
/**
*
*
*/
@RequestMapping("/add")
public R add(@RequestBody YundongLiuyanEntity yundongLiuyan, HttpServletRequest request) {
logger.debug("add方法:,,Controller:{},,yundongLiuyan:{}", this.getClass().getName(), yundongLiuyan.toString());
// 记录日志,打印当前控制器名称和传入的实体数据
yundongLiuyan.setCreateTime(new Date());
// 设置创建时间为当前时间
yundongLiuyan.setInsertTime(new Date());
// 设置插入时间为当前时间
yundongLiuyanService.insert(yundongLiuyan);
// 调用服务层方法插入新数据
return R.ok();
// 返回成功结果
}
}

@ -0,0 +1,98 @@
package com.dao;
import java.util.List;
import java.util.Map;
/**
*
* 访
*/
public interface CommonDao {
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> pieSum(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> pieCount(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> barSumOne(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> barCountOne(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> barSumTwo(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> barCountTwo(Map<String, Object> params);
/**
*
*
* @param params
* @return Map
*/
Map<String, Object> queryScore(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupSum(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> newSelectGroupCount(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> barSum(Map<String, Object> params);
/**
*
*
* @param params
* @return
*/
List<Map<String, Object>> barCount(Map<String, Object> params);
}

@ -0,0 +1,12 @@
package com.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.entity.ConfigEntity;
/**
*
*/
public interface ConfigDao extends BaseMapper<ConfigEntity> {
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DictionaryView;
/**
* Dao
*
* @author
*/
public interface DictionaryDao extends BaseMapper<DictionaryEntity> {
List<DictionaryView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,28 @@
package com.dao;
import com.entity.ForumEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.ForumView;
/**
* Dao
*
* @author
*/
/**
*
*
* @param page
* @param params
* @return
*/
public interface ForumDao extends BaseMapper<ForumEntity> {
List<ForumView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,28 @@
package com.dao;
import com.entity.GerentizhengEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.GerentizhengView;
/**
* Dao
*
* @author
*/
/**
*
*
* @param page
* @param params
* @return
*/
public interface GerentizhengDao extends BaseMapper<GerentizhengEntity> {
List<GerentizhengView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,28 @@
package com.dao;
import com.entity.JiankangtieshiEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.JiankangtieshiView;
/**
* Dao
*
* @author
*/
/**
*
*
* @param page
* @param params
* @return
*/
public interface JiankangtieshiDao extends BaseMapper<JiankangtieshiEntity> {
List<JiankangtieshiView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.MeirijihuaEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.MeirijihuaView;
/**
* Dao
*
* @author
*/
public interface MeirijihuaDao extends BaseMapper<MeirijihuaEntity> {
List<MeirijihuaView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.MeishiCollectionEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.MeishiCollectionView;
/**
* Dao
*
* @author
*/
public interface MeishiCollectionDao extends BaseMapper<MeishiCollectionEntity> {
List<MeishiCollectionView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.MeishiEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.MeishiView;
/**
* Dao
*
* @author
*/
public interface MeishiDao extends BaseMapper<MeishiEntity> {
List<MeishiView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.MeishiLiuyanEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.MeishiLiuyanView;
/**
* Dao
*
* @author
*/
public interface MeishiLiuyanDao extends BaseMapper<MeishiLiuyanEntity> {
List<MeishiLiuyanView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.NewsView;
/**
* Dao
*
* @author
*/
public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,22 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.TokenEntity;
/**
* token
*/
public interface TokenDao extends BaseMapper<TokenEntity> {
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
List<TokenEntity> selectListView(Pagination page,@Param("ew") Wrapper<TokenEntity> wrapper);
}

@ -0,0 +1,22 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UsersEntity;
/**
*
*/
public interface UsersDao extends BaseMapper<UsersEntity> {
List<UsersEntity> selectListView(@Param("ew") Wrapper<UsersEntity> wrapper);
List<UsersEntity> selectListView(Pagination page, @Param("ew") Wrapper<UsersEntity> wrapper);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.YaopinEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YaopinView;
/**
* Dao
*
* @author
*/
public interface YaopinDao extends BaseMapper<YaopinEntity> {
List<YaopinView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YonghuView;
/**
* Dao
*
* @author
*/
public interface YonghuDao extends BaseMapper<YonghuEntity> {
List<YonghuView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.YundongCollectionEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YundongCollectionView;
/**
* Dao
*
* @author
*/
public interface YundongCollectionDao extends BaseMapper<YundongCollectionEntity> {
List<YundongCollectionView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.YundongEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YundongView;
/**
* Dao
*
* @author
*/
public interface YundongDao extends BaseMapper<YundongEntity> {
List<YundongView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,21 @@
package com.dao;
import com.entity.YundongLiuyanEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YundongLiuyanView;
/**
* Dao
*
* @author
*/
public interface YundongLiuyanDao extends BaseMapper<YundongLiuyanEntity> {
List<YundongLiuyanView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}

@ -0,0 +1,62 @@
package com.entity;
import java.io.Serializable;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* @author yangliyuan
* @version 202027 8:36:05
* : config
*/
@TableName("config") // 指定数据库表名为config
public class ConfigEntity implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
// 主键,自增类型
@TableId(type = IdType.AUTO)
private Long id;
/**
* key
*/
private String name;
/**
* value
*/
private String value;
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
// 获取key
public String getName() {
return name;
}
// 设置key
public void setName(String name) {
this.name = name;
}
// 获取value
public String getValue() {
return value;
}
// 设置value
public void setValue(String value) {
this.value = value;
}
}

@ -0,0 +1,289 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("dictionary")
// 指定数据库表名为dictionary
public class DictionaryEntity<T> implements Serializable {
// 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L;
// 序列化版本号
// 无参构造函数
public DictionaryEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public DictionaryEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
// 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
// 指定主键自增
@ColumnInfo(comment = "主键", type = "bigint(20)")
// 自定义注解,描述字段信息
@TableField(value = "id")
// 指定数据库字段名为id
private Long id;
/**
*
*/
@ColumnInfo(comment = "字段", type = "varchar(200)")
// 自定义注解,描述字段信息
@TableField(value = "dic_code")
// 指定数据库字段名为dic_code
private String dicCode;
/**
*
*/
@ColumnInfo(comment = "字段名", type = "varchar(200)")
// 自定义注解,描述字段信息
@TableField(value = "dic_name")
// 指定数据库字段名为dic_name
private String dicName;
/**
*
*/
@ColumnInfo(comment = "编码", type = "int(11)")
// 自定义注解,描述字段信息
@TableField(value = "code_index")
// 指定数据库字段名为code_index
private Integer codeIndex;
/**
*
*/
@ColumnInfo(comment = "编码名字", type = "varchar(200)")
// 自定义注解,描述字段信息
@TableField(value = "index_name")
// 指定数据库字段名为index_name
private String indexName;
/**
* id
*/
@ColumnInfo(comment = "父字段id", type = "int(11)")
// 自定义注解,描述字段信息
@TableField(value = "super_id")
// 指定数据库字段名为super_id
private Integer superId;
/**
*
*/
@ColumnInfo(comment = "备注", type = "varchar(200)")
// 自定义注解,描述字段信息
@TableField(value = "beizhu")
// 指定数据库字段名为beizhu
private String beizhu;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment = "创建时间", type = "timestamp")
// 自定义注解,描述字段信息
@TableField(value = "create_time", fill = FieldFill.INSERT)
// 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Long getId() {
return id;
}
/**
*
*/
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
// 重写toString方法便于调试和日志输出
@Override
// 重写Object类的toString方法用于返回对象的字符串表示
public String toString() {
// 返回一个包含对象属性的字符串
return "Dictionary{" +
// 添加主键id
", id=" + id +
// 添加字段dicCode
", dicCode=" + dicCode +
// 添加字段名dicName
", dicName=" + dicName +
// 添加编码codeIndex
", codeIndex=" + codeIndex +
// 添加编码名字indexName
", indexName=" + indexName +
// 添加父字段id superId
", superId=" + superId +
// 添加备注beizhu
", beizhu=" + beizhu +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,85 @@
package com.entity;
/**
* RuntimeException
*/
public class EIException extends RuntimeException {
private static final long serialVersionUID = 1L; // 序列化版本号
private String msg; // 异常消息
private int code = 500; // 异常代码默认为500
/**
*
* @param msg
*/
public EIException(String msg) {
super(msg); // 调用父类构造函数
this.msg = msg; // 设置异常消息
}
/**
*
* @param msg
* @param e
*/
public EIException(String msg, Throwable e) {
super(msg, e); // 调用父类构造函数
this.msg = msg; // 设置异常消息
}
/**
*
* @param msg
* @param code
*/
public EIException(String msg, int code) {
super(msg); // 调用父类构造函数
this.msg = msg; // 设置异常消息
this.code = code; // 设置异常代码
}
/**
*
* @param msg
* @param code
* @param e
*/
public EIException(String msg, int code, Throwable e) {
super(msg, e); // 调用父类构造函数
this.msg = msg; // 设置异常消息
this.code = code; // 设置异常代码
}
/**
*
* @return
*/
public String getMsg() {
return msg;
}
/**
*
* @param msg
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
*
* @return
*/
public int getCode() {
return code;
}
/**
*
* @param code
*/
public void setCode(int code) {
this.code = code;
}
}

@ -0,0 +1,352 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("forum")
// 指定数据库表名为forum
public class ForumEntity<T> implements Serializable {
// 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L;
// 序列化版本号
// 无参构造函数
public ForumEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public ForumEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
// 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
// 指定主键自增
@ColumnInfo(comment = "主键", type = "int(11)")
// 自定义注解,描述字段信息
@TableField(value = "id")
// 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment = "帖子标题", type = "varchar(200)")
// 自定义注解,描述字段信息
@TableField(value = "forum_name")
// 指定数据库字段名为forum_name
private String forumName;
/**
*
*/
@ColumnInfo(comment = "用户", type = "int(11)")
// 自定义注解,描述字段信息
@TableField(value = "yonghu_id")
// 指定数据库字段名为yonghu_id
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment = "管理员", type = "int(11)")
// 自定义注解,描述字段信息
@TableField(value = "users_id")
// 指定数据库字段名为users_id
private Integer usersId;
/**
*
*/
@ColumnInfo(comment = "发布内容", type = "longtext")
// 自定义注解,描述字段信息
@TableField(value = "forum_content")
// 指定数据库字段名为forum_content
private String forumContent;
/**
* id
*/
@ColumnInfo(comment = "父id", type = "int(11)")
// 自定义注解,描述字段信息
@TableField(value = "super_ids")
// 指定数据库字段名为super_ids
private Integer superIds;
/**
*
*/
@ColumnInfo(comment = "帖子状态", type = "int(11)")
// 自定义注解,描述字段信息
@TableField(value = "forum_state_types")
// 指定数据库字段名为forum_state_types
private Integer forumStateTypes;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// JSON日期格式化
@DateTimeFormat
// 日期格式化注解
@ColumnInfo(comment = "发帖时间", type = "timestamp")
// 自定义注解,描述字段信息
@TableField(value = "insert_time", fill = FieldFill.INSERT)
// 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// JSON日期格式化
@DateTimeFormat
// 日期格式化注解
@ColumnInfo(comment = "修改时间", type = "timestamp")
// 自定义注解,描述字段信息
@TableField(value = "update_time", fill = FieldFill.UPDATE)
// 指定数据库字段名为update_time并在更新时自动填充
private Date updateTime;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat
// 日期格式化注解
@ColumnInfo(comment = "创建时间", type = "timestamp")
// 自定义注解,描述字段信息
@TableField(value = "create_time", fill = FieldFill.INSERT)
// 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getForumName() {
return forumName;
}
/**
*
*/
public void setForumName(String forumName) {
this.forumName = forumName;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getUsersId() {
return usersId;
}
/**
*
*/
public void setUsersId(Integer usersId) {
this.usersId = usersId;
}
/**
*
*/
public String getForumContent() {
return forumContent;
}
/**
*
*/
public void setForumContent(String forumContent) {
this.forumContent = forumContent;
}
/**
* id
*/
public Integer getSuperIds() {
return superIds;
}
/**
* id
*/
public void setSuperIds(Integer superIds) {
this.superIds = superIds;
}
/**
*
*/
public Integer getForumStateTypes() {
return forumStateTypes;
}
/**
*
*/
public void setForumStateTypes(Integer forumStateTypes) {
this.forumStateTypes = forumStateTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写Object类的toString方法用于返回对象的字符串表示
public String toString() {
// 返回一个包含对象属性的字符串
return "Forum{" +
// 添加主键id
", id=" + id +
// 添加帖子标题forumName
", forumName=" + forumName +
// 添加用户yonghuId
", yonghuId=" + yonghuId +
// 添加管理员usersId
", usersId=" + usersId +
// 添加发布内容forumContent
", forumContent=" + forumContent +
// 添加父id superIds
", superIds=" + superIds +
// 添加帖子状态forumStateTypes
", forumStateTypes=" + forumStateTypes +
// 添加发帖时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime, "yyyy-MM-dd") +
// 添加修改时间updateTime并使用DateUtil格式化日期
", updateTime=" + DateUtil.convertString(updateTime, "yyyy-MM-dd") +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,324 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("gerentizheng") // 指定数据库表名为gerentizheng
public class GerentizhengEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
// 无参构造函数
public GerentizhengEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public GerentizhengEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 指定主键自增
@ColumnInfo(comment="主键",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "id") // 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment="用户",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "yonghu_id") // 指定数据库字段名为yonghu_id
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment="当前身高",type="decimal(10,2)") // 自定义注解,描述字段信息
@TableField(value = "gerentizheng_num") // 指定数据库字段名为gerentizheng_num
private Double gerentizhengNum;
/**
*
*/
@ColumnInfo(comment="当前体重",type="decimal(10,2)") // 自定义注解,描述字段信息
@TableField(value = "tizhong_num") // 指定数据库字段名为tizhong_num
private Double tizhongNum;
/**
*
*/
@ColumnInfo(comment="身体状况",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "shenti_types") // 指定数据库字段名为shenti_types
private Integer shentiTypes;
/**
*
*/
@ColumnInfo(comment="饮食照片",type="varchar(200)") // 自定义注解,描述字段信息
@TableField(value = "meishi_photo") // 指定数据库字段名为meishi_photo
private String meishiPhoto;
/**
*
*/
@ColumnInfo(comment="备注",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "gerentizheng_content") // 指定数据库字段名为gerentizheng_content
private String gerentizhengContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="下次体检时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "gerentizheng_time") // 指定数据库字段名为gerentizheng_time
private Date gerentizhengTime;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "gerentizheng_delete") // 指定数据库字段名为gerentizheng_delete
private Integer gerentizhengDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="添加时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "insert_time",fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
* listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="创建时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "create_time",fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Double getGerentizhengNum() {
return gerentizhengNum;
}
/**
*
*/
public void setGerentizhengNum(Double gerentizhengNum) {
this.gerentizhengNum = gerentizhengNum;
}
/**
*
*/
public Double getTizhongNum() {
return tizhongNum;
}
/**
*
*/
public void setTizhongNum(Double tizhongNum) {
this.tizhongNum = tizhongNum;
}
/**
*
*/
public Integer getShentiTypes() {
return shentiTypes;
}
/**
*
*/
public void setShentiTypes(Integer shentiTypes) {
this.shentiTypes = shentiTypes;
}
/**
*
*/
public String getMeishiPhoto() {
return meishiPhoto;
}
/**
*
*/
public void setMeishiPhoto(String meishiPhoto) {
this.meishiPhoto = meishiPhoto;
}
/**
*
*/
public String getGerentizhengContent() {
return gerentizhengContent;
}
/**
*
*/
public void setGerentizhengContent(String gerentizhengContent) {
this.gerentizhengContent = gerentizhengContent;
}
/**
*
*/
public Date getGerentizhengTime() {
return gerentizhengTime;
}
/**
*
*/
public void setGerentizhengTime(Date gerentizhengTime) {
this.gerentizhengTime = gerentizhengTime;
}
/**
*
*/
public Integer getGerentizhengDelete() {
return gerentizhengDelete;
}
/**
*
*/
public void setGerentizhengDelete(Integer gerentizhengDelete) {
this.gerentizhengDelete = gerentizhengDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写toString方法便于调试和日志输出
public String toString() {
return "Gerentizheng{" +
// 添加主键id
", id=" + id +
// 添加用户yonghuId
", yonghuId=" + yonghuId +
// 添加当前身高gerentizhengNum
", gerentizhengNum=" + gerentizhengNum +
// 添加当前体重tizhongNum
", tizhongNum=" + tizhongNum +
// 添加身体状况shentiTypes
", shentiTypes=" + shentiTypes +
// 添加饮食照片meishiPhoto
", meishiPhoto=" + meishiPhoto +
// 添加备注gerentizhengContent
", gerentizhengContent=" + gerentizhengContent +
// 添加下次体检时间gerentizhengTime并使用DateUtil格式化日期
", gerentizhengTime=" + DateUtil.convertString(gerentizhengTime,"yyyy-MM-dd") +
// 添加逻辑删除gerentizhengDelete
", gerentizhengDelete=" + gerentizhengDelete +
// 添加添加时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,249 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("jiankangtieshi")
// 指定数据库表名为jiankangtieshi
public class JiankangtieshiEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L;
// 序列化版本号
// 无参构造函数
public JiankangtieshiEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public JiankangtieshiEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
// 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
// 指定主键自增
@ColumnInfo(comment="主键",type="int(11)")
// 自定义注解,描述字段信息
@TableField(value = "id")
// 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment="贴士标题",type="varchar(200)")
// 自定义注解,描述字段信息
@TableField(value = "jiankangtieshi_name")
// 指定数据库字段名为jiankangtieshi_name
private String jiankangtieshiName;
/**
*
*/
@ColumnInfo(comment="贴士类型",type="int(11)")
// 自定义注解,描述字段信息
@TableField(value = "jiankangtieshi_types")
// 指定数据库字段名为jiankangtieshi_types
private Integer jiankangtieshiTypes;
/**
*
*/
@ColumnInfo(comment="贴士图片",type="varchar(200)")
// 自定义注解,描述字段信息
@TableField(value = "jiankangtieshi_photo")
// 指定数据库字段名为jiankangtieshi_photo
private String jiankangtieshiPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="添加时间",type="timestamp")
// 自定义注解,描述字段信息
@TableField(value = "insert_time",fill = FieldFill.INSERT)
// 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
*
*/
@ColumnInfo(comment="贴士详情",type="longtext")
// 自定义注解,描述字段信息
@TableField(value = "jiankangtieshi_content")
// 指定数据库字段名为jiankangtieshi_content
private String jiankangtieshiContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat
// 日期格式化注解
@ColumnInfo(comment="创建时间",type="timestamp")
// 自定义注解,描述字段信息
@TableField(value = "create_time",fill = FieldFill.INSERT)
// 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getJiankangtieshiName() {
return jiankangtieshiName;
}
/**
*
*/
public void setJiankangtieshiName(String jiankangtieshiName) {
this.jiankangtieshiName = jiankangtieshiName;
}
/**
*
*/
public Integer getJiankangtieshiTypes() {
return jiankangtieshiTypes;
}
/**
*
*/
public void setJiankangtieshiTypes(Integer jiankangtieshiTypes) {
this.jiankangtieshiTypes = jiankangtieshiTypes;
}
/**
*
*/
public String getJiankangtieshiPhoto() {
return jiankangtieshiPhoto;
}
/**
*
*/
public void setJiankangtieshiPhoto(String jiankangtieshiPhoto) {
this.jiankangtieshiPhoto = jiankangtieshiPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getJiankangtieshiContent() {
return jiankangtieshiContent;
}
/**
*
*/
public void setJiankangtieshiContent(String jiankangtieshiContent) {
this.jiankangtieshiContent = jiankangtieshiContent;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写toString方法便于调试和日志输出
public String toString() {
return "Jiankangtieshi{" +
// 添加主键id
", id=" + id +
// 添加贴士标题jiankangtieshiName
", jiankangtieshiName=" + jiankangtieshiName +
// 添加贴士类型jiankangtieshiTypes
", jiankangtieshiTypes=" + jiankangtieshiTypes +
// 添加贴士图片jiankangtieshiPhoto
", jiankangtieshiPhoto=" + jiankangtieshiPhoto +
// 添加添加时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
// 添加贴士详情jiankangtieshiContent
", jiankangtieshiContent=" + jiankangtieshiContent +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,324 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("meirijihua") // 指定数据库表名为meirijihua
public class MeirijihuaEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
// 无参构造函数
public MeirijihuaEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public MeirijihuaEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 指定主键自增
@ColumnInfo(comment="主键",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "id") // 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment="用户",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "yonghu_id") // 指定数据库字段名为yonghu_id
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment="计划标题",type="varchar(200)") // 自定义注解,描述字段信息
@TableField(value = "meirijihua_name") // 指定数据库字段名为meirijihua_name
private String meirijihuaName;
/**
*
*/
@ColumnInfo(comment="饮食计划",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "yinshi_text") // 指定数据库字段名为yinshi_text
private String yinshiText;
/**
*
*/
@ColumnInfo(comment="运动计划",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "yundong_text") // 指定数据库字段名为yundong_text
private String yundongText;
/**
*
*/
@ColumnInfo(comment="药品计划",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "yaopin_text") // 指定数据库字段名为yaopin_text
private String yaopinText;
/**
*
*/
@ColumnInfo(comment="备注",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "meirijihua_content") // 指定数据库字段名为meirijihua_content
private String meirijihuaContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="计划时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "meirijihua_time") // 指定数据库字段名为meirijihua_time
private Date meirijihuaTime;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "meirijihua_delete") // 指定数据库字段名为meirijihua_delete
private Integer meirijihuaDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="添加时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "insert_time",fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
* listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="创建时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "create_time",fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getMeirijihuaName() {
return meirijihuaName;
}
/**
*
*/
public void setMeirijihuaName(String meirijihuaName) {
this.meirijihuaName = meirijihuaName;
}
/**
*
*/
public String getYinshiText() {
return yinshiText;
}
/**
*
*/
public void setYinshiText(String yinshiText) {
this.yinshiText = yinshiText;
}
/**
*
*/
public String getYundongText() {
return yundongText;
}
/**
*
*/
public void setYundongText(String yundongText) {
this.yundongText = yundongText;
}
/**
*
*/
public String getYaopinText() {
return yaopinText;
}
/**
*
*/
public void setYaopinText(String yaopinText) {
this.yaopinText = yaopinText;
}
/**
*
*/
public String getMeirijihuaContent() {
return meirijihuaContent;
}
/**
*
*/
public void setMeirijihuaContent(String meirijihuaContent) {
this.meirijihuaContent = meirijihuaContent;
}
/**
*
*/
public Date getMeirijihuaTime() {
return meirijihuaTime;
}
/**
*
*/
public void setMeirijihuaTime(Date meirijihuaTime) {
this.meirijihuaTime = meirijihuaTime;
}
/**
*
*/
public Integer getMeirijihuaDelete() {
return meirijihuaDelete;
}
/**
*
*/
public void setMeirijihuaDelete(Integer meirijihuaDelete) {
this.meirijihuaDelete = meirijihuaDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写toString方法便于调试和日志输出
public String toString() {
return "Meirijihua{" +
// 添加主键id
", id=" + id +
// 添加用户yonghuId
", yonghuId=" + yonghuId +
// 添加计划标题meirijihuaName
", meirijihuaName=" + meirijihuaName +
// 添加饮食计划yinshiText
", yinshiText=" + yinshiText +
// 添加运动计划yundongText
", yundongText=" + yundongText +
// 添加药品计划yaopinText
", yaopinText=" + yaopinText +
// 添加备注meirijihuaContent
", meirijihuaContent=" + meirijihuaContent +
// 添加计划时间meirijihuaTime并使用DateUtil格式化日期
", meirijihuaTime=" + DateUtil.convertString(meirijihuaTime,"yyyy-MM-dd") +
// 添加逻辑删除meirijihuaDelete
", meirijihuaDelete=" + meirijihuaDelete +
// 添加添加时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,207 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("meishi_collection") // 指定数据库表名为meishi_collection
public class MeishiCollectionEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
// 无参构造函数
public MeishiCollectionEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public MeishiCollectionEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 指定主键自增
@ColumnInfo(comment="主键",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "id") // 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment="健康食谱",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "meishi_id") // 指定数据库字段名为meishi_id
private Integer meishiId;
/**
*
*/
@ColumnInfo(comment="用户",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "yonghu_id") // 指定数据库字段名为yonghu_id
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment="类型",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "meishi_collection_types") // 指定数据库字段名为meishi_collection_types
private Integer meishiCollectionTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="收藏时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "insert_time",fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="创建时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "create_time",fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getMeishiId() {
return meishiId;
}
/**
*
*/
public void setMeishiId(Integer meishiId) {
this.meishiId = meishiId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getMeishiCollectionTypes() {
return meishiCollectionTypes;
}
/**
*
*/
public void setMeishiCollectionTypes(Integer meishiCollectionTypes) {
this.meishiCollectionTypes = meishiCollectionTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写toString方法便于调试和日志输出
public String toString() {
return "MeishiCollection{" +
// 添加主键id
", id=" + id +
// 添加健康食谱meishiId
", meishiId=" + meishiId +
// 添加用户yonghuId
", yonghuId=" + yonghuId +
// 添加类型meishiCollectionTypes
", meishiCollectionTypes=" + meishiCollectionTypes +
// 添加收藏时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,322 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("meishi") // 指定数据库表名为meishi
public class MeishiEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
// 无参构造函数
public MeishiEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public MeishiEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 指定主键自增
@ColumnInfo(comment="主键",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "id") // 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment="食谱标题",type="varchar(200)") // 自定义注解,描述字段信息
@TableField(value = "meishi_name") // 指定数据库字段名为meishi_name
private String meishiName;
/**
*
*/
@ColumnInfo(comment="食谱照片",type="varchar(200)") // 自定义注解,描述字段信息
@TableField(value = "meishi_photo") // 指定数据库字段名为meishi_photo
private String meishiPhoto;
/**
*
*/
@ColumnInfo(comment="食谱类型",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "meishi_types") // 指定数据库字段名为meishi_types
private Integer meishiTypes;
/**
*
*/
@ColumnInfo(comment="所含热量",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "meishi_num") // 指定数据库字段名为meishi_num
private Integer meishiNum;
/**
*
*/
@ColumnInfo(comment="赞",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "zan_number") // 指定数据库字段名为zan_number
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment="踩",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "cai_number") // 指定数据库字段名为cai_number
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment="制作教程",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "meishi_content") // 指定数据库字段名为meishi_content
private String meishiContent;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "meishi_delete") // 指定数据库字段名为meishi_delete
private Integer meishiDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="录入时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "insert_time",fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="创建时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "create_time",fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getMeishiName() {
return meishiName;
}
/**
*
*/
public void setMeishiName(String meishiName) {
this.meishiName = meishiName;
}
/**
*
*/
public String getMeishiPhoto() {
return meishiPhoto;
}
/**
*
*/
public void setMeishiPhoto(String meishiPhoto) {
this.meishiPhoto = meishiPhoto;
}
/**
*
*/
public Integer getMeishiTypes() {
return meishiTypes;
}
/**
*
*/
public void setMeishiTypes(Integer meishiTypes) {
this.meishiTypes = meishiTypes;
}
/**
*
*/
public Integer getMeishiNum() {
return meishiNum;
}
/**
*
*/
public void setMeishiNum(Integer meishiNum) {
this.meishiNum = meishiNum;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public String getMeishiContent() {
return meishiContent;
}
/**
*
*/
public void setMeishiContent(String meishiContent) {
this.meishiContent = meishiContent;
}
/**
*
*/
public Integer getMeishiDelete() {
return meishiDelete;
}
/**
*
*/
public void setMeishiDelete(Integer meishiDelete) {
this.meishiDelete = meishiDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写toString方法便于调试和日志输出
public String toString() {
return "Meishi{" +
// 添加主键id
", id=" + id +
// 添加食谱标题meishiName
", meishiName=" + meishiName +
// 添加食谱照片meishiPhoto
", meishiPhoto=" + meishiPhoto +
// 添加食谱类型meishiTypes
", meishiTypes=" + meishiTypes +
// 添加所含热量meishiNum
", meishiNum=" + meishiNum +
// 添加赞zanNumber
", zanNumber=" + zanNumber +
// 添加踩caiNumber
", caiNumber=" + caiNumber +
// 添加制作教程meishiContent
", meishiContent=" + meishiContent +
// 添加逻辑删除meishiDelete
", meishiDelete=" + meishiDelete +
// 添加录入时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,255 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("meishi_liuyan") // 指定数据库表名为meishi_liuyan
public class MeishiLiuyanEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
// 无参构造函数
public MeishiLiuyanEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public MeishiLiuyanEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 指定主键自增
@ColumnInfo(comment="主键",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "id") // 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment="健康食谱",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "meishi_id") // 指定数据库字段名为meishi_id
private Integer meishiId;
/**
*
*/
@ColumnInfo(comment="用户",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "yonghu_id") // 指定数据库字段名为yonghu_id
private Integer yonghuId;
/**
*
*/
@ColumnInfo(comment="留言内容",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "meishi_liuyan_text") // 指定数据库字段名为meishi_liuyan_text
private String meishiLiuyanText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="留言时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "insert_time",fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
*
*/
@ColumnInfo(comment="回复内容",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "reply_text") // 指定数据库字段名为reply_text
private String replyText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="回复时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "update_time",fill = FieldFill.UPDATE) // 指定数据库字段名为update_time并在更新时自动填充
private Date updateTime;
/**
* listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="创建时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "create_time",fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getMeishiId() {
return meishiId;
}
/**
*
*/
public void setMeishiId(Integer meishiId) {
this.meishiId = meishiId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getMeishiLiuyanText() {
return meishiLiuyanText;
}
/**
*
*/
public void setMeishiLiuyanText(String meishiLiuyanText) {
this.meishiLiuyanText = meishiLiuyanText;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getReplyText() {
return replyText;
}
/**
*
*/
public void setReplyText(String replyText) {
this.replyText = replyText;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写toString方法便于调试和日志输出
public String toString() {
return "MeishiLiuyan{" +
// 添加主键id
", id=" + id +
// 添加健康食谱meishiId
", meishiId=" + meishiId +
// 添加用户yonghuId
", yonghuId=" + yonghuId +
// 添加留言内容meishiLiuyanText
", meishiLiuyanText=" + meishiLiuyanText +
// 添加留言时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
// 添加回复内容replyText
", replyText=" + replyText +
// 添加回复时间updateTime并使用DateUtil格式化日期
", updateTime=" + DateUtil.convertString(updateTime,"yyyy-MM-dd") +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,230 @@
package com.entity;
// 自定义注解,用于字段信息描述
import com.annotation.ColumnInfo;
// 用于字段验证的注解
import javax.validation.constraints.*;
// 忽略JSON序列化时的某些属性
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
// 反射工具类
import java.lang.reflect.InvocationTargetException;
// 序列化接口
import java.io.Serializable;
// 集合工具类
import java.util.*;
// 日期工具类
import org.apache.tools.ant.util.DateUtils;
// 日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// JSON日期格式化注解
import com.fasterxml.jackson.annotation.JsonFormat;
// BeanUtils工具类用于对象属性复制
import org.apache.commons.beanutils.BeanUtils;
// MyBatis-Plus注解用于标识实体类对应的数据库表
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
// 日期工具类
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("news") // 指定数据库表名为news
public class NewsEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
// 无参构造函数
public NewsEntity() {
}
// 带参数的构造函数,用于从其他对象复制属性
public NewsEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并打印异常
e.printStackTrace();
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 指定主键自增
@ColumnInfo(comment="主键",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "id") // 指定数据库字段名为id
private Integer id;
/**
*
*/
@ColumnInfo(comment="公告标题",type="varchar(200)") // 自定义注解,描述字段信息
@TableField(value = "news_name") // 指定数据库字段名为news_name
private String newsName;
/**
*
*/
@ColumnInfo(comment="公告类型",type="int(11)") // 自定义注解,描述字段信息
@TableField(value = "news_types") // 指定数据库字段名为news_types
private Integer newsTypes;
/**
*
*/
@ColumnInfo(comment="公告图片",type="varchar(200)") // 自定义注解,描述字段信息
@TableField(value = "news_photo") // 指定数据库字段名为news_photo
private String newsPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="添加时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "insert_time",fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime;
/**
*
*/
@ColumnInfo(comment="公告详情",type="longtext") // 自定义注解,描述字段信息
@TableField(value = "news_content") // 指定数据库字段名为news_content
private String newsContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") // JSON日期格式化
@DateTimeFormat // 日期格式化注解
@ColumnInfo(comment="创建时间",type="timestamp") // 自定义注解,描述字段信息
@TableField(value = "create_time",fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getNewsName() {
return newsName;
}
/**
*
*/
public void setNewsName(String newsName) {
this.newsName = newsName;
}
/**
*
*/
public Integer getNewsTypes() {
return newsTypes;
}
/**
*
*/
public void setNewsTypes(Integer newsTypes) {
this.newsTypes = newsTypes;
}
/**
*
*/
public String getNewsPhoto() {
return newsPhoto;
}
/**
*
*/
public void setNewsPhoto(String newsPhoto) {
this.newsPhoto = newsPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getNewsContent() {
return newsContent;
}
/**
*
*/
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
// 重写toString方法便于调试和日志输出
public String toString() {
return "News{" +
// 添加主键id
", id=" + id +
// 添加公告标题newsName
", newsName=" + newsName +
// 添加公告类型newsTypes
", newsTypes=" + newsTypes +
// 添加公告图片newsPhoto
", newsPhoto=" + newsPhoto +
// 添加添加时间insertTime并使用DateUtil格式化日期
", insertTime=" + DateUtil.convertString(insertTime,"yyyy-MM-dd") +
// 添加公告详情newsContent
", newsContent=" + newsContent +
// 添加创建时间createTime并使用DateUtil格式化日期
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") +
"}";
}
}

@ -0,0 +1,169 @@
package com.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* token
*/
@TableName("token")
// 指定数据库表名为token
public class TokenEntity implements Serializable {
// 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L;
// 序列化版本号
@TableId(type = IdType.AUTO)
// 主键自增
private Integer id;
// 主键ID
/**
* id
*/
private Integer userid;
// 用户ID
/**
*
*/
private String username;
// 用户名
/**
*
*/
private String tablename;
// 表名
/**
*
*/
private String role;
// 角色
/**
* token
*/
private String token;
// token字符串
/**
*
*/
private Date expiratedtime;
// token过期时间
/**
*
*/
private Date addtime;
// token新增时间
public Integer getId() {
return id;
// 获取主键ID
}
public void setId(Integer id) {
this.id = id;
// 设置主键ID
}
public Integer getUserid() {
return userid;
// 获取用户ID
}
public void setUserid(Integer userid) {
this.userid = userid;
// 设置用户ID
}
public String getRole() {
return role;
// 获取角色
}
public void setRole(String role) {
this.role = role;
// 设置角色
}
public String getToken() {
return token;
// 获取token
}
public String getTablename() {
return tablename;
// 获取表名
}
public void setTablename(String tablename) {
this.tablename = tablename;
// 设置表名
}
public void setToken(String token) {
this.token = token;
// 设置token
}
public Date getExpiratedtime() {
return expiratedtime;
// 获取过期时间
}
public void setExpiratedtime(Date expiratedtime) {
this.expiratedtime = expiratedtime;
// 设置过期时间
}
public Date getAddtime() {
return addtime;
// 获取新增时间
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
// 设置新增时间
}
public String getUsername() {
return username;
// 获取用户名
}
public void setUsername(String username) {
this.username = username;
// 设置用户名
}
public TokenEntity(Integer userid, String username, String tablename,String role, String token, Date expiratedtime) {
super();
// 调用父类构造方法
this.userid = userid;
// 初始化用户ID
this.username = username;
// 初始化用户名
this.tablename = tablename;
// 初始化表名
this.role = role;
// 初始化角色
this.token = token;
// 初始化token
this.expiratedtime = expiratedtime;
// 初始化过期时间
}
public TokenEntity() {
// 默认构造方法
}
}

@ -0,0 +1,77 @@
package com.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*/
@TableName("users") // 指定数据库表名为users
public class UsersEntity implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
@TableId(type = IdType.AUTO) // 主键自增
private Integer id; // 主键ID
/**
*
*/
private String username; // 用户账号
/**
*
*/
private String password; // 用户密码
/**
*
*/
private String role; // 用户角色
private Date addtime; // 用户新增时间
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 getRole() {
return role; // 获取用户角色
}
public void setRole(String role) {
this.role = role; // 设置用户角色
}
public Date getAddtime() {
return addtime; // 获取用户新增时间
}
public void setAddtime(Date addtime) {
this.addtime = addtime; // 设置用户新增时间
}
public Integer getId() {
return id; // 获取主键ID
}
public void setId(Integer id) {
this.id = id; // 设置主键ID
}
}

@ -0,0 +1,293 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("yaopin") // 指定数据库表名为yaopin
public class YaopinEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
public YaopinEntity() {
// 默认构造方法
}
public YaopinEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace(); // 打印异常堆栈信息
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 主键自增
@ColumnInfo(comment = "主键", type = "int(11)") // 字段注释和类型
@TableField(value = "id") // 指定数据库字段名为id
private Integer id; // 主键ID
/**
*
*/
@ColumnInfo(comment = "药品名称", type = "varchar(200)") // 字段注释和类型
@TableField(value = "yaopin_name") // 指定数据库字段名为yaopin_name
private String yaopinName; // 药品名称
/**
*
*/
@ColumnInfo(comment = "药品照片", type = "varchar(200)") // 字段注释和类型
@TableField(value = "yaopin_photo") // 指定数据库字段名为yaopin_photo
private String yaopinPhoto; // 药品照片路径
/**
*
*/
@ColumnInfo(comment = "药品类型", type = "int(11)") // 字段注释和类型
@TableField(value = "yaopin_types") // 指定数据库字段名为yaopin_types
private Integer yaopinTypes; // 药品类型
/**
*
*/
@ColumnInfo(comment = "药品作用", type = "varchar(200)") // 字段注释和类型
@TableField(value = "yaopin_zuoyng") // 指定数据库字段名为yaopin_zuoyng
private String yaopinZuoyng; // 药品作用
/**
*
*/
@ColumnInfo(comment = "药品成分", type = "varchar(200)") // 字段注释和类型
@TableField(value = "yaopin_chengfen") // 指定数据库字段名为yaopin_chengfen
private String yaopinChengfen; // 药品成分
/**
*
*/
@ColumnInfo(comment = "药品详情", type = "longtext") // 字段注释和类型
@TableField(value = "yaopin_content") // 指定数据库字段名为yaopin_content
private String yaopinContent; // 药品详情
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)") // 字段注释和类型
@TableField(value = "yaopin_delete") // 指定数据库字段名为yaopin_delete
private Integer yaopinDelete; // 逻辑删除标志
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "录入时间", type = "timestamp") // 字段注释和类型
@TableField(value = "insert_time", fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime; // 录入时间
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "创建时间", type = "timestamp") // 字段注释和类型
@TableField(value = "create_time", fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime; // 创建时间
/**
*
*/
public Integer getId() {
return id; // 获取主键ID
}
/**
*
*/
public void setId(Integer id) {
this.id = id; // 设置主键ID
}
/**
*
*/
public String getYaopinName() {
return yaopinName; // 获取药品名称
}
/**
*
*/
public void setYaopinName(String yaopinName) {
this.yaopinName = yaopinName; // 设置药品名称
}
/**
*
*/
public String getYaopinPhoto() {
return yaopinPhoto; // 获取药品照片路径
}
/**
*
*/
public void setYaopinPhoto(String yaopinPhoto) {
this.yaopinPhoto = yaopinPhoto; // 设置药品照片路径
}
/**
*
*/
public Integer getYaopinTypes() {
return yaopinTypes; // 获取药品类型
}
/**
*
*/
public void setYaopinTypes(Integer yaopinTypes) {
this.yaopinTypes = yaopinTypes; // 设置药品类型
}
/**
*
*/
public String getYaopinZuoyng() {
return yaopinZuoyng; // 获取药品作用
}
/**
*
*/
public void setYaopinZuoyng(String yaopinZuoyng) {
this.yaopinZuoyng = yaopinZuoyng; // 设置药品作用
}
/**
*
*/
public String getYaopinChengfen() {
return yaopinChengfen; // 获取药品成分
}
/**
*
*/
public void setYaopinChengfen(String yaopinChengfen) {
this.yaopinChengfen = yaopinChengfen; // 设置药品成分
}
/**
*
*/
public String getYaopinContent() {
return yaopinContent; // 获取药品详情
}
/**
*
*/
public void setYaopinContent(String yaopinContent) {
this.yaopinContent = yaopinContent; // 设置药品详情
}
/**
*
*/
public Integer getYaopinDelete() {
return yaopinDelete; // 获取逻辑删除标志
}
/**
*
*/
public void setYaopinDelete(Integer yaopinDelete) {
this.yaopinDelete = yaopinDelete; // 设置逻辑删除标志
}
/**
*
*/
public Date getInsertTime() {
return insertTime; // 获取录入时间
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime; // 设置录入时间
}
/**
*
*/
public Date getCreateTime() {
return createTime; // 获取创建时间
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime; // 设置创建时间
}
@Override
public String toString() {
return "Yaopin{" + // 开始构建对象的字符串表示
", id=" + id + // 添加主键ID
", yaopinName=" + yaopinName + // 添加药品名称
", yaopinPhoto=" + yaopinPhoto + // 添加药品照片路径
", yaopinTypes=" + yaopinTypes + // 添加药品类型
", yaopinZuoyng=" + yaopinZuoyng + // 添加药品作用
", yaopinChengfen=" + yaopinChengfen + // 添加药品成分
", yaopinContent=" + yaopinContent + // 添加药品详情
", yaopinDelete=" + yaopinDelete + // 添加逻辑删除标志
", insertTime=" + DateUtil.convertString(insertTime, "yyyy-MM-dd") + // 格式化录入时间为字符串并添加
", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") + // 格式化创建时间为字符串并添加
"}"; // 结束构建对象的字符串表示并返回
}
}

@ -0,0 +1,371 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("yonghu")
// 指定数据库表名为yonghu
public class YonghuEntity<T> implements Serializable {
// 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L;
// 序列化版本号
public YonghuEntity() {
// 默认构造方法
}
public YonghuEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
// 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
/**
*
*/
@TableId(type = IdType.AUTO)
// 主键自增
@ColumnInfo(comment="主键",type="int(11)")
// 字段注释和类型
@TableField(value = "id")
// 指定数据库字段名为id
private Integer id;
// 主键ID
/**
*
*/
@ColumnInfo(comment="账户",type="varchar(200)")
// 字段注释和类型
@TableField(value = "username")
// 指定数据库字段名为username
private String username;
// 用户账户
/**
*
*/
@ColumnInfo(comment="密码",type="varchar(200)")
// 字段注释和类型
@TableField(value = "password")
// 指定数据库字段名为password
private String password;
// 用户密码
/**
*
*/
@ColumnInfo(comment="用户姓名",type="varchar(200)")
// 字段注释和类型
@TableField(value = "yonghu_name")
// 指定数据库字段名为yonghu_name
private String yonghuName;
// 用户姓名
/**
*
*/
@ColumnInfo(comment="性别",type="int(11)")
// 字段注释和类型
@TableField(value = "sex_types")
// 指定数据库字段名为sex_types
private Integer sexTypes;
// 用户性别
/**
*
*/
@ColumnInfo(comment="头像",type="varchar(200)")
// 字段注释和类型
@TableField(value = "yonghu_photo")
// 指定数据库字段名为yonghu_photo
private String yonghuPhoto;
// 用户头像路径
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
// 字段注释和类型
@TableField(value = "yonghu_id_number")
// 指定数据库字段名为yonghu_id_number
private String yonghuIdNumber;
// 用户身份证号
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
// 字段注释和类型
@TableField(value = "yonghu_phone")
// 指定数据库字段名为yonghu_phone
private String yonghuPhone;
// 用户联系方式
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
// 字段注释和类型
@TableField(value = "yonghu_email")
// 指定数据库字段名为yonghu_email
private String yonghuEmail;
// 用户电子邮箱
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
// 字段注释和类型
@TableField(value = "yonghu_delete")
// 指定数据库字段名为yonghu_delete
private Integer yonghuDelete;
// 逻辑删除标志
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
// JSON格式化
@DateTimeFormat
// 日期时间格式化
@ColumnInfo(comment="创建时间",type="timestamp")
// 字段注释和类型
@TableField(value = "create_time",fill = FieldFill.INSERT)
// 指定数据库字段名为create_time并在插入时自动填充
private Date createTime;
// 创建时间
/**
*
*/
public Integer getId() {
return id;
// 获取主键ID
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
// 设置主键ID
}
/**
*
*/
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 getYonghuName() {
return yonghuName;
// 获取用户姓名
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
// 设置用户姓名
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
// 获取用户性别
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
// 设置用户性别
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
// 获取用户头像路径
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
// 设置用户头像路径
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
// 获取用户身份证号
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
// 设置用户身份证号
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
// 获取用户联系方式
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
// 设置用户联系方式
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
// 获取用户电子邮箱
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
// 设置用户电子邮箱
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
// 获取逻辑删除标志
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
// 设置逻辑删除标志
}
/**
*
*/
public Date getCreateTime() {
return createTime;
// 获取创建时间
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
// 设置创建时间
}
@Override
public String toString() {
return "Yonghu{" +
// 开始构建对象的字符串表示
", id=" + id +
// 添加主键ID
", username=" + username +
// 添加用户账户
", password=" + password +
// 添加用户密码
", yonghuName=" + yonghuName +
// 添加用户姓名
", sexTypes=" + sexTypes +
// 添加用户性别
", yonghuPhoto=" + yonghuPhoto +
// 添加用户头像路径
", yonghuIdNumber=" + yonghuIdNumber +
// 添加用户身份证号
", yonghuPhone=" + yonghuPhone +
// 添加用户联系方式
", yonghuEmail=" + yonghuEmail +
// 添加用户电子邮箱
", yonghuDelete=" + yonghuDelete +
// 添加逻辑删除标志
", createTime=" + DateUtil.convertString(createTime,"yyyy-MM-dd") + // 格式化创建时间为字符串并添加
"}";
// 结束构建对象的字符串表示并返回
}
}

@ -0,0 +1,206 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("yundong_collection") // 指定数据库表名为yundong_collection
public class YundongCollectionEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
public YundongCollectionEntity() {
// 默认构造方法
}
public YundongCollectionEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace(); // 打印异常堆栈信息
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 主键自增
@ColumnInfo(comment = "主键", type = "int(11)") // 字段注释和类型
@TableField(value = "id") // 指定数据库字段名为id
private Integer id; // 主键ID
/**
*
*/
@ColumnInfo(comment = "运动教程", type = "int(11)") // 字段注释和类型
@TableField(value = "yundong_id") // 指定数据库字段名为yundong_id
private Integer yundongId; // 运动教程ID
/**
*
*/
@ColumnInfo(comment = "用户", type = "int(11)") // 字段注释和类型
@TableField(value = "yonghu_id") // 指定数据库字段名为yonghu_id
private Integer yonghuId; // 用户ID
/**
*
*/
@ColumnInfo(comment = "类型", type = "int(11)") // 字段注释和类型
@TableField(value = "yundong_collection_types") // 指定数据库字段名为yundong_collection_types
private Integer yundongCollectionTypes; // 收藏类型
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "收藏时间", type = "timestamp") // 字段注释和类型
@TableField(value = "insert_time", fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime; // 收藏时间
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "创建时间", type = "timestamp") // 字段注释和类型
@TableField(value = "create_time", fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime; // 创建时间
/**
*
*/
public Integer getId() {
return id; // 获取主键ID
}
/**
*
*/
public void setId(Integer id) {
this.id = id; // 设置主键ID
}
/**
*
*/
public Integer getYundongId() {
return yundongId; // 获取运动教程ID
}
/**
*
*/
public void setYundongId(Integer yundongId) {
this.yundongId = yundongId; // 设置运动教程ID
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId; // 获取用户ID
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId; // 设置用户ID
}
/**
*
*/
public Integer getYundongCollectionTypes() {
return yundongCollectionTypes; // 获取收藏类型
}
/**
*
*/
public void setYundongCollectionTypes(Integer yundongCollectionTypes) {
this.yundongCollectionTypes = yundongCollectionTypes; // 设置收藏类型
}
/**
*
*/
public Date getInsertTime() {
return insertTime; // 获取收藏时间
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime; // 设置收藏时间
}
/**
*
*/
public Date getCreateTime() {
return createTime; // 获取创建时间
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime; // 设置创建时间
}
@Override
public String toString() {
return "YundongCollection{" +
// 开始构建对象的字符串表示
", id=" + id +
// 添加主键ID
", yundongId=" + yundongId +
// 添加运动教程ID
", yonghuId=" + yonghuId +
// 添加用户ID
", yundongCollectionTypes=" + yundongCollectionTypes +
// 添加收藏类型
", insertTime=" + DateUtil.convertString(insertTime, "yyyy-MM-dd") +
// 格式化收藏时间为字符串并添加
", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
// 格式化创建时间为字符串并添加
"}";
// 结束构建对象的字符串表示并返回
}
}

@ -0,0 +1,355 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("yundong") // 指定数据库表名为yundong
public class YundongEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
public YundongEntity() {
// 默认构造方法
}
public YundongEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace(); // 打印异常堆栈信息
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 主键自增
@ColumnInfo(comment = "主键", type = "int(11)") // 字段注释和类型
@TableField(value = "id") // 指定数据库字段名为id
private Integer id; // 主键ID
/**
*
*/
@ColumnInfo(comment = "标题", type = "varchar(200)") // 字段注释和类型
@TableField(value = "yundong_name") // 指定数据库字段名为yundong_name
private String yundongName; // 运动教程标题
/**
*
*/
@ColumnInfo(comment = "运动照片", type = "varchar(200)") // 字段注释和类型
@TableField(value = "yundong_photo") // 指定数据库字段名为yundong_photo
private String yundongPhoto; // 运动照片路径
/**
*
*/
@ColumnInfo(comment = "运动类型", type = "int(11)") // 字段注释和类型
@TableField(value = "yundong_types") // 指定数据库字段名为yundong_types
private Integer yundongTypes; // 运动类型
/**
*
*/
@ColumnInfo(comment = "运动视频", type = "varchar(200)") // 字段注释和类型
@TableField(value = "yundong_video") // 指定数据库字段名为yundong_video
private String yundongVideo; // 运动视频路径
/**
*
*/
@ColumnInfo(comment = "消耗热量", type = "int(11)") // 字段注释和类型
@TableField(value = "yundong_num") // 指定数据库字段名为yundong_num
private Integer yundongNum; // 消耗热量
/**
*
*/
@ColumnInfo(comment = "赞", type = "int(11)") // 字段注释和类型
@TableField(value = "zan_number") // 指定数据库字段名为zan_number
private Integer zanNumber; // 赞的数量
/**
*
*/
@ColumnInfo(comment = "踩", type = "int(11)") // 字段注释和类型
@TableField(value = "cai_number") // 指定数据库字段名为cai_number
private Integer caiNumber; // 踩的数量
/**
*
*/
@ColumnInfo(comment = "运动介绍", type = "longtext") // 字段注释和类型
@TableField(value = "yundong_content") // 指定数据库字段名为yundong_content
private String yundongContent; // 运动介绍
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)") // 字段注释和类型
@TableField(value = "yundong_delete") // 指定数据库字段名为yundong_delete
private Integer yundongDelete; // 逻辑删除标志
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "录入时间", type = "timestamp") // 字段注释和类型
@TableField(value = "insert_time", fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime; // 录入时间
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "创建时间", type = "timestamp") // 字段注释和类型
@TableField(value = "create_time", fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime; // 创建时间
/**
*
*/
public Integer getId() {
return id; // 获取主键ID
}
/**
*
*/
public void setId(Integer id) {
this.id = id; // 设置主键ID
}
/**
*
*/
public String getYundongName() {
return yundongName; // 获取运动教程标题
}
/**
*
*/
public void setYundongName(String yundongName) {
this.yundongName = yundongName; // 设置运动教程标题
}
/**
*
*/
public String getYundongPhoto() {
return yundongPhoto; // 获取运动照片路径
}
/**
*
*/
public void setYundongPhoto(String yundongPhoto) {
this.yundongPhoto = yundongPhoto; // 设置运动照片路径
}
/**
*
*/
public Integer getYundongTypes() {
return yundongTypes; // 获取运动类型
}
/**
*
*/
public void setYundongTypes(Integer yundongTypes) {
this.yundongTypes = yundongTypes; // 设置运动类型
}
/**
*
*/
public String getYundongVideo() {
return yundongVideo; // 获取运动视频路径
}
/**
*
*/
public void setYundongVideo(String yundongVideo) {
this.yundongVideo = yundongVideo; // 设置运动视频路径
}
/**
*
*/
public Integer getYundongNum() {
return yundongNum; // 获取消耗热量
}
/**
*
*/
public void setYundongNum(Integer yundongNum) {
this.yundongNum = yundongNum; // 设置消耗热量
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber; // 获取赞的数量
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber; // 设置赞的数量
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber; // 获取踩的数量
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber; // 设置踩的数量
}
/**
*
*/
public String getYundongContent() {
return yundongContent; // 获取运动介绍
}
/**
*
*/
public void setYundongContent(String yundongContent) {
this.yundongContent = yidongContent; // 设置运动介绍
}
/**
*
*/
public Integer getYundongDelete() {
return yundongDelete; // 获取逻辑删除标志
}
/**
*
*/
public void setYundongDelete(Integer yundongDelete) {
this.yundongDelete = yundongDelete; // 设置逻辑删除标志
}
/**
*
*/
public Date getInsertTime() {
return insertTime; // 获取录入时间
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime; // 设置录入时间
}
/**
*
*/
public Date getCreateTime() {
return createTime; // 获取创建时间
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime; // 设置创建时间
}
@Override
public String toString() {
return "Yundong{" +
// 开始构建对象的字符串表示
", id=" + id + // 添加主键ID
", yundongName=" + yundongName +
// 添加运动教程标题
", yundongPhoto=" + yundongPhoto +
// 添加运动照片路径
", yundongTypes=" + yundongTypes +
// 添加运动类型
", yundongVideo=" + yundongVideo +
// 添加运动视频路径
", yundongNum=" + yundongNum +
// 添加消耗热量
", zanNumber=" + zanNumber +
// 添加赞的数量
", caiNumber=" + caiNumber +
// 添加踩的数量
", yundongContent=" + yundongContent +
// 添加运动介绍
", yundongDelete=" + yundongDelete +
// 添加逻辑删除标志
", insertTime=" + DateUtil.convertString(insertTime, "yyyy-MM-dd") +
// 格式化录入时间为字符串并添加
", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
// 格式化创建时间为字符串并添加
"}";
// 结束构建对象的字符串表示并返回
}
}

@ -0,0 +1,257 @@
package com.entity;
import com.annotation.ColumnInfo;
import javax.validation.constraints.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.*;
import org.apache.tools.ant.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.beanutils.BeanUtils;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.utils.DateUtil;
/**
*
*
* @author
* @email
*/
@TableName("yundong_liuyan") // 指定数据库表名为yundong_liuyan
public class YundongLiuyanEntity<T> implements Serializable { // 实现Serializable接口以支持序列化
private static final long serialVersionUID = 1L; // 序列化版本号
public YundongLiuyanEntity() {
// 默认构造方法
}
public YundongLiuyanEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用BeanUtils复制属性
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace(); // 打印异常堆栈信息
}
}
/**
*
*/
@TableId(type = IdType.AUTO) // 主键自增
@ColumnInfo(comment = "主键", type = "int(11)") // 字段注释和类型
@TableField(value = "id") // 指定数据库字段名为id
private Integer id; // 主键ID
/**
*
*/
@ColumnInfo(comment = "运动教程", type = "int(11)") // 字段注释和类型
@TableField(value = "yundong_id") // 指定数据库字段名为yundong_id
private Integer yundongId; // 运动教程ID
/**
*
*/
@ColumnInfo(comment = "用户", type = "int(11)") // 字段注释和类型
@TableField(value = "yonghu_id") // 指定数据库字段名为yonghu_id
private Integer yonghuId; // 用户ID
/**
*
*/
@ColumnInfo(comment = "留言内容", type = "longtext") // 字段注释和类型
@TableField(value = "yundong_liuyan_text") // 指定数据库字段名为yundong_liuyan_text
private String yundongLiuyanText; // 留言内容
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "留言时间", type = "timestamp") // 字段注释和类型
@TableField(value = "insert_time", fill = FieldFill.INSERT) // 指定数据库字段名为insert_time并在插入时自动填充
private Date insertTime; // 留言时间
/**
*
*/
@ColumnInfo(comment = "回复内容", type = "longtext") // 字段注释和类型
@TableField(value = "reply_text") // 指定数据库字段名为reply_text
private String replyText; // 回复内容
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "回复时间", type = "timestamp") // 字段注释和类型
@TableField(value = "update_time", fill = FieldFill.UPDATE) // 指定数据库字段名为update_time并在更新时自动填充
private Date updateTime; // 回复时间
/**
* listShow
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // JSON格式化
@DateTimeFormat // 日期时间格式化
@ColumnInfo(comment = "创建时间", type = "timestamp") // 字段注释和类型
@TableField(value = "create_time", fill = FieldFill.INSERT) // 指定数据库字段名为create_time并在插入时自动填充
private Date createTime; // 创建时间
/**
*
*/
public Integer getId() {
return id; // 获取主键ID
}
/**
*
*/
public void setId(Integer id) {
this.id = id; // 设置主键ID
}
/**
*
*/
public Integer getYundongId() {
return yundongId; // 获取运动教程ID
}
/**
*
*/
public void setYundongId(Integer yundongId) {
this.yundongId = yundongId; // 设置运动教程ID
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId; // 获取用户ID
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId; // 设置用户ID
}
/**
*
*/
public String getYundongLiuyanText() {
return yundongLiuyanText; // 获取留言内容
}
/**
*
*/
public void setYundongLiuyanText(String yundongLiuyanText) {
this.yundongLiuyanText = yundongLiuyanText; // 设置留言内容
}
/**
*
*/
public Date getInsertTime() {
return insertTime; // 获取留言时间
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime; // 设置留言时间
}
/**
*
*/
public String getReplyText() {
return replyText; // 获取回复内容
}
/**
*
*/
public void setReplyText(String replyText) {
this.replyText = replyText; // 设置回复内容
}
/**
*
*/
public Date getUpdateTime() {
return updateTime; // 获取回复时间
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime; // 设置回复时间
}
/**
* listShow
*/
public Date getCreateTime() {
return createTime; // 获取创建时间
}
/**
* listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime; // 设置创建时间
}
@Override
public String toString() {
return "YundongLiuyan{" +
// 开始构建对象的字符串表示
", id=" + id +
// 添加主键ID
", yundongId=" + yundongId +
// 添加运动教程ID
", yonghuId=" + yonghuId +
// 添加用户ID
", yundongLiuyanText=" + yundongLiuyanText +
// 添加留言内容
", insertTime=" + DateUtil.convertString(insertTime, "yyyy-MM-dd") +
// 格式化留言时间为字符串并添加
", replyText=" + replyText +
// 添加回复内容
", updateTime=" + DateUtil.convertString(updateTime, "yyyy-MM-dd") +
// 格式化回复时间为字符串并添加
", createTime=" + DateUtil.convertString(createTime, "yyyy-MM-dd") +
// 格式化创建时间为字符串并添加
"}"; // 结束构建对象的字符串表示并返回
}
}

@ -0,0 +1,187 @@
package com.entity.model;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class DictionaryModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
*
*/
private String dicCode;
/**
*
*/
private String dicName;
/**
*
*/
private Integer codeIndex;
/**
*
*/
private String indexName;
/**
* id
*/
private Integer superId;
/**
*
*/
private String beizhu;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Long getId() {
return id;
}
/**
*
*/
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,231 @@
package com.entity.model;
import com.entity.ForumEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class ForumModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String forumName;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Integer usersId;
/**
*
*/
private String forumContent;
/**
* id
*/
private Integer superIds;
/**
*
*/
private Integer forumStateTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date updateTime;
/**
* show2
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getForumName() {
return forumName;
}
/**
*
*/
public void setForumName(String forumName) {
this.forumName = forumName;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getUsersId() {
return usersId;
}
/**
*
*/
public void setUsersId(Integer usersId) {
this.usersId = usersId;
}
/**
*
*/
public String getForumContent() {
return forumContent;
}
/**
*
*/
public void setForumContent(String forumContent) {
this.forumContent = forumContent;
}
/**
* id
*/
public Integer getSuperIds() {
return superIds;
}
/**
* id
*/
public void setSuperIds(Integer superIds) {
this.superIds = superIds;
}
/**
*
*/
public Integer getForumStateTypes() {
return forumStateTypes;
}
/**
*
*/
public void setForumStateTypes(Integer forumStateTypes) {
this.forumStateTypes = forumStateTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* show2
*/
public Date getCreateTime() {
return createTime;
}
/**
* show2
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,251 @@
package com.entity.model;
import com.entity.GerentizhengEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class GerentizhengModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Double gerentizhengNum;
/**
*
*/
private Double tizhongNum;
/**
*
*/
private Integer shentiTypes;
/**
*
*/
private String meishiPhoto;
/**
*
*/
private String gerentizhengContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date gerentizhengTime;
/**
*
*/
private Integer gerentizhengDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show3 listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Double getGerentizhengNum() {
return gerentizhengNum;
}
/**
*
*/
public void setGerentizhengNum(Double gerentizhengNum) {
this.gerentizhengNum = gerentizhengNum;
}
/**
*
*/
public Double getTizhongNum() {
return tizhongNum;
}
/**
*
*/
public void setTizhongNum(Double tizhongNum) {
this.tizhongNum = tizhongNum;
}
/**
*
*/
public Integer getShentiTypes() {
return shentiTypes;
}
/**
*
*/
public void setShentiTypes(Integer shentiTypes) {
this.shentiTypes = shentiTypes;
}
/**
*
*/
public String getMeishiPhoto() {
return meishiPhoto;
}
/**
*
*/
public void setMeishiPhoto(String meishiPhoto) {
this.meishiPhoto = meishiPhoto;
}
/**
*
*/
public String getGerentizhengContent() {
return gerentizhengContent;
}
/**
*
*/
public void setGerentizhengContent(String gerentizhengContent) {
this.gerentizhengContent = gerentizhengContent;
}
/**
*
*/
public Date getGerentizhengTime() {
return gerentizhengTime;
}
/**
*
*/
public void setGerentizhengTime(Date gerentizhengTime) {
this.gerentizhengTime = gerentizhengTime;
}
/**
*
*/
public Integer getGerentizhengDelete() {
return gerentizhengDelete;
}
/**
*
*/
public void setGerentizhengDelete(Integer gerentizhengDelete) {
this.gerentizhengDelete = gerentizhengDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show3 listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,169 @@
package com.entity.model;
import com.entity.JiankangtieshiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class JiankangtieshiModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String jiankangtieshiName;
/**
*
*/
private Integer jiankangtieshiTypes;
/**
*
*/
private String jiankangtieshiPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String jiankangtieshiContent;
/**
* show1 show2 nameShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getJiankangtieshiName() {
return jiankangtieshiName;
}
/**
*
*/
public void setJiankangtieshiName(String jiankangtieshiName) {
this.jiankangtieshiName = jiankangtieshiName;
}
/**
*
*/
public Integer getJiankangtieshiTypes() {
return jiankangtieshiTypes;
}
/**
*
*/
public void setJiankangtieshiTypes(Integer jiankangtieshiTypes) {
this.jiankangtieshiTypes = jiankangtieshiTypes;
}
/**
*
*/
public String getJiankangtieshiPhoto() {
return jiankangtieshiPhoto;
}
/**
*
*/
public void setJiankangtieshiPhoto(String jiankangtieshiPhoto) {
this.jiankangtieshiPhoto = jiankangtieshiPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getJiankangtieshiContent() {
return jiankangtieshiContent;
}
/**
*
*/
public void setJiankangtieshiContent(String jiankangtieshiContent) {
this.jiankangtieshiContent = jiankangtieshiContent;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,251 @@
package com.entity.model;
import com.entity.MeirijihuaEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class MeirijihuaModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private String meirijihuaName;
/**
*
*/
private String yinshiText;
/**
*
*/
private String yundongText;
/**
*
*/
private String yaopinText;
/**
*
*/
private String meirijihuaContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date meirijihuaTime;
/**
*
*/
private Integer meirijihuaDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show3 listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getMeirijihuaName() {
return meirijihuaName;
}
/**
*
*/
public void setMeirijihuaName(String meirijihuaName) {
this.meirijihuaName = meirijihuaName;
}
/**
*
*/
public String getYinshiText() {
return yinshiText;
}
/**
*
*/
public void setYinshiText(String yinshiText) {
this.yinshiText = yinshiText;
}
/**
*
*/
public String getYundongText() {
return yundongText;
}
/**
*
*/
public void setYundongText(String yundongText) {
this.yundongText = yundongText;
}
/**
*
*/
public String getYaopinText() {
return yaopinText;
}
/**
*
*/
public void setYaopinText(String yaopinText) {
this.yaopinText = yaopinText;
}
/**
*
*/
public String getMeirijihuaContent() {
return meirijihuaContent;
}
/**
*
*/
public void setMeirijihuaContent(String meirijihuaContent) {
this.meirijihuaContent = meirijihuaContent;
}
/**
*
*/
public Date getMeirijihuaTime() {
return meirijihuaTime;
}
/**
*
*/
public void setMeirijihuaTime(Date meirijihuaTime) {
this.meirijihuaTime = meirijihuaTime;
}
/**
*
*/
public Integer getMeirijihuaDelete() {
return meirijihuaDelete;
}
/**
*
*/
public void setMeirijihuaDelete(Integer meirijihuaDelete) {
this.meirijihuaDelete = meirijihuaDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show3 listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,149 @@
package com.entity.model;
import com.entity.MeishiCollectionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class MeishiCollectionModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer meishiId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Integer meishiCollectionTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show3 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getMeishiId() {
return meishiId;
}
/**
*
*/
public void setMeishiId(Integer meishiId) {
this.meishiId = meishiId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getMeishiCollectionTypes() {
return meishiCollectionTypes;
}
/**
*
*/
public void setMeishiCollectionTypes(Integer meishiCollectionTypes) {
this.meishiCollectionTypes = meishiCollectionTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show3 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,191 @@
package com.entity.model;
import com.entity.MeishiLiuyanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class MeishiLiuyanModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer meishiId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private String meishiLiuyanText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String replyText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date updateTime;
/**
* show3 listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getMeishiId() {
return meishiId;
}
/**
*
*/
public void setMeishiId(Integer meishiId) {
this.meishiId = meishiId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getMeishiLiuyanText() {
return meishiLiuyanText;
}
/**
*
*/
public void setMeishiLiuyanText(String meishiLiuyanText) {
this.meishiLiuyanText = meishiLiuyanText;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getReplyText() {
return replyText;
}
/**
*
*/
public void setReplyText(String replyText) {
this.replyText = replyText;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* show3 listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,249 @@
package com.entity.model;
import com.entity.MeishiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class MeishiModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String meishiName;
/**
*
*/
private String meishiPhoto;
/**
*
*/
private Integer meishiTypes;
/**
*
*/
private Integer meishiNum;
/**
*
*/
private Integer zanNumber;
/**
*
*/
private Integer caiNumber;
/**
*
*/
private String meishiContent;
/**
*
*/
private Integer meishiDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show1 show2 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getMeishiName() {
return meishiName;
}
/**
*
*/
public void setMeishiName(String meishiName) {
this.meishiName = meishiName;
}
/**
*
*/
public String getMeishiPhoto() {
return meishiPhoto;
}
/**
*
*/
public void setMeishiPhoto(String meishiPhoto) {
this.meishiPhoto = meishiPhoto;
}
/**
*
*/
public Integer getMeishiTypes() {
return meishiTypes;
}
/**
*
*/
public void setMeishiTypes(Integer meishiTypes) {
this.meishiTypes = meishiTypes;
}
/**
*
*/
public Integer getMeishiNum() {
return meishiNum;
}
/**
*
*/
public void setMeishiNum(Integer meishiNum) {
this.meishiNum = meishiNum;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public String getMeishiContent() {
return meishiContent;
}
/**
*
*/
public void setMeishiContent(String meishiContent) {
this.meishiContent = meishiContent;
}
/**
*
*/
public Integer getMeishiDelete() {
return meishiDelete;
}
/**
*
*/
public void setMeishiDelete(Integer meishiDelete) {
this.meishiDelete = meishiDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show1 show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,169 @@
package com.entity.model;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class NewsModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String newsName;
/**
*
*/
private Integer newsTypes;
/**
*
*/
private String newsPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String newsContent;
/**
* show1 show2 nameShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getNewsName() {
return newsName;
}
/**
*
*/
public void setNewsName(String newsName) {
this.newsName = newsName;
}
/**
*
*/
public Integer getNewsTypes() {
return newsTypes;
}
/**
*
*/
public void setNewsTypes(Integer newsTypes) {
this.newsTypes = newsTypes;
}
/**
*
*/
public String getNewsPhoto() {
return newsPhoto;
}
/**
*
*/
public void setNewsPhoto(String newsPhoto) {
this.newsPhoto = newsPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getNewsContent() {
return newsContent;
}
/**
*
*/
public void setNewsContent(String newsContent) {
this.newsContent = newsContent;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,229 @@
package com.entity.model;
import com.entity.YaopinEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class YaopinModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String yaopinName;
/**
*
*/
private String yaopinPhoto;
/**
*
*/
private Integer yaopinTypes;
/**
*
*/
private String yaopinZuoyng;
/**
*
*/
private String yaopinChengfen;
/**
*
*/
private String yaopinContent;
/**
*
*/
private Integer yaopinDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show1 show2 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getYaopinName() {
return yaopinName;
}
/**
*
*/
public void setYaopinName(String yaopinName) {
this.yaopinName = yaopinName;
}
/**
*
*/
public String getYaopinPhoto() {
return yaopinPhoto;
}
/**
*
*/
public void setYaopinPhoto(String yaopinPhoto) {
this.yaopinPhoto = yaopinPhoto;
}
/**
*
*/
public Integer getYaopinTypes() {
return yaopinTypes;
}
/**
*
*/
public void setYaopinTypes(Integer yaopinTypes) {
this.yaopinTypes = yaopinTypes;
}
/**
*
*/
public String getYaopinZuoyng() {
return yaopinZuoyng;
}
/**
*
*/
public void setYaopinZuoyng(String yaopinZuoyng) {
this.yaopinZuoyng = yaopinZuoyng;
}
/**
*
*/
public String getYaopinChengfen() {
return yaopinChengfen;
}
/**
*
*/
public void setYaopinChengfen(String yaopinChengfen) {
this.yaopinChengfen = yaopinChengfen;
}
/**
*
*/
public String getYaopinContent() {
return yaopinContent;
}
/**
*
*/
public void setYaopinContent(String yaopinContent) {
this.yaopinContent = yaopinContent;
}
/**
*
*/
public Integer getYaopinDelete() {
return yaopinDelete;
}
/**
*
*/
public void setYaopinDelete(Integer yaopinDelete) {
this.yaopinDelete = yaopinDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show1 show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,247 @@
package com.entity.model;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class YonghuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String yonghuName;
/**
*
*/
private Integer sexTypes;
/**
*
*/
private String yonghuPhoto;
/**
*
*/
private String yonghuIdNumber;
/**
*
*/
private String yonghuPhone;
/**
*
*/
private String yonghuEmail;
/**
*
*/
private Integer yonghuDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
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 getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public Integer getSexTypes() {
return sexTypes;
}
/**
*
*/
public void setSexTypes(Integer sexTypes) {
this.sexTypes = sexTypes;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,149 @@
package com.entity.model;
import com.entity.YundongCollectionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class YundongCollectionModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer yundongId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private Integer yundongCollectionTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show3 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYundongId() {
return yundongId;
}
/**
*
*/
public void setYundongId(Integer yundongId) {
this.yundongId = yundongId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getYundongCollectionTypes() {
return yundongCollectionTypes;
}
/**
*
*/
public void setYundongCollectionTypes(Integer yundongCollectionTypes) {
this.yundongCollectionTypes = yundongCollectionTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show3 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,191 @@
package com.entity.model;
import com.entity.YundongLiuyanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class YundongLiuyanModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private Integer yundongId;
/**
*
*/
private Integer yonghuId;
/**
*
*/
private String yundongLiuyanText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
*
*/
private String replyText;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date updateTime;
/**
* show3 listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYundongId() {
return yundongId;
}
/**
*
*/
public void setYundongId(Integer yundongId) {
this.yundongId = yundongId;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public String getYundongLiuyanText() {
return yundongLiuyanText;
}
/**
*
*/
public void setYundongLiuyanText(String yundongLiuyanText) {
this.yundongLiuyanText = yundongLiuyanText;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getReplyText() {
return replyText;
}
/**
*
*/
public void setReplyText(String replyText) {
this.replyText = replyText;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* show3 listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,269 @@
package com.entity.model;
import com.entity.YundongEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
*/
public class YundongModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
*
*/
private String yundongName;
/**
*
*/
private String yundongPhoto;
/**
*
*/
private Integer yundongTypes;
/**
*
*/
private String yundongVideo;
/**
*
*/
private Integer yundongNum;
/**
*
*/
private Integer zanNumber;
/**
*
*/
private Integer caiNumber;
/**
*
*/
private String yundongContent;
/**
*
*/
private Integer yundongDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date insertTime;
/**
* show1 show2 photoShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getYundongName() {
return yundongName;
}
/**
*
*/
public void setYundongName(String yundongName) {
this.yundongName = yundongName;
}
/**
*
*/
public String getYundongPhoto() {
return yundongPhoto;
}
/**
*
*/
public void setYundongPhoto(String yundongPhoto) {
this.yundongPhoto = yundongPhoto;
}
/**
*
*/
public Integer getYundongTypes() {
return yundongTypes;
}
/**
*
*/
public void setYundongTypes(Integer yundongTypes) {
this.yundongTypes = yundongTypes;
}
/**
*
*/
public String getYundongVideo() {
return yundongVideo;
}
/**
*
*/
public void setYundongVideo(String yundongVideo) {
this.yundongVideo = yundongVideo;
}
/**
*
*/
public Integer getYundongNum() {
return yundongNum;
}
/**
*
*/
public void setYundongNum(Integer yundongNum) {
this.yundongNum = yundongNum;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public String getYundongContent() {
return yundongContent;
}
/**
*
*/
public void setYundongContent(String yundongContent) {
this.yundongContent = yundongContent;
}
/**
*
*/
public Integer getYundongDelete() {
return yundongDelete;
}
/**
*
*/
public void setYundongDelete(Integer yundongDelete) {
this.yundongDelete = yundongDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show1 show2 photoShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 photoShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,48 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("dictionary")
public class DictionaryView extends DictionaryEntity implements Serializable {
private static final long serialVersionUID = 1L;
// 定义序列化版本号
// 当前表
public DictionaryView() {
// 默认构造函数
}
public DictionaryView(DictionaryEntity dictionaryEntity) {
try {
BeanUtils.copyProperties(this, dictionaryEntity);
// 将传入的DictionaryEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
@Override
public String toString() {
return "DictionaryView{" +
"} " + super.toString();
// 重写toString方法返回当前对象的字符串表示
}
}

@ -0,0 +1,288 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.ForumEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("forum")
public class ForumView extends ForumEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "帖子状态的字典表值", type = "varchar(200)")
private String forumStateValue;
//级联表 用户
/**
*
*/
@ColumnInfo(comment = "用户姓名", type = "varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment = "头像", type = "varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment = "身份证号", type = "varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment = "联系方式", type = "varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment = "电子邮箱", type = "varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yonghuDelete;
//级联表 管理员
/**
*
*/
@ColumnInfo(comment = "用户名", type = "varchar(100)")
private String uusername;
/**
*
*/
@ColumnInfo(comment = "密码", type = "varchar(100)")
private String upassword;
/**
*
*/
@ColumnInfo(comment = "角色", type = "varchar(100)")
private String urole;
/**
*
*/
@ColumnInfo(comment = "新增时间", type = "timestamp")
private Date uaddtime;
public ForumView() {
}
public ForumView(ForumEntity forumEntity) {
try {
BeanUtils.copyProperties(this, forumEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//当前表的
/**
*
*/
public String getForumStateValue() {
return forumStateValue;
}
/**
*
*/
public void setForumStateValue(String forumStateValue) {
this.forumStateValue = forumStateValue;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
//级联表的get和set 管理员
/**
*
*/
public String getUusername() {
return uusername;
}
/**
*
*/
public void setUusername(String uusername) {
this.uusername = uusername;
}
/**
*
*/
public String getUpassword() {
return upassword;
}
/**
*
*/
public void setUpassword(String upassword) {
this.upassword = upassword;
}
/**
*
*/
public String getUrole() {
return urole;
}
/**
*
*/
public void setUrole(String urole) {
this.urole = urole;
}
/**
*
*/
public Date getUaddtime() {
return uaddtime;
}
/**
*
*/
public void setUaddtime(Date uaddtime) {
this.uaddtime = uaddtime;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "ForumView{" +
// 开始构建字符串表示
", forumStateValue=" + forumStateValue +
// 添加forumStateValue字段的值
", yonghuName=" + yonghuName +
// 添加yonghuName字段的值
", yonghuPhoto=" + yonghuPhoto +
// 添加yonghuPhoto字段的值
", yonghuIdNumber=" + yonghuIdNumber +
// 添加yonghuIdNumber字段的值
", yonghuPhone=" + yonghuPhone +
// 添加yonghuPhone字段的值
", yonghuEmail=" + yonghuEmail +
// 添加yonghuEmail字段的值
", yonghuDelete=" + yonghuDelete +
// 添加yonghuDelete字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,208 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.GerentizhengEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("gerentizheng")
public class GerentizhengView extends GerentizhengEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment="身体状况的字典表值",type="varchar(200)")
private String shentiValue;
//级联表 用户
/**
*
*/
@ColumnInfo(comment="用户姓名",type="varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment="头像",type="varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment="身份证号",type="varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment="联系方式",type="varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment="电子邮箱",type="varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment="逻辑删除",type="int(11)")
private Integer yonghuDelete;
public GerentizhengView() {
// 默认构造函数
}
public GerentizhengView(GerentizhengEntity gerentizhengEntity) {
// 带参数的构造函数用于从GerentizhengEntity对象复制属性
try {
BeanUtils.copyProperties(this, gerentizhengEntity);
// 使用BeanUtils工具将传入的GerentizhengEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getShentiValue() {
return shentiValue;
}
/**
*
*/
public void setShentiValue(String shentiValue) {
this.shentiValue = shentiValue;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "GerentizhengView{" +
// 开始构建字符串表示
", shentiValue=" + shentiValue +
// 添加shentiValue字段的值
", yonghuName=" + yonghuName +
// 添加yonghuName字段的值
", yonghuPhoto=" + yonghuPhoto +
// 添加yonghuPhoto字段的值
", yonghuIdNumber=" + yonghuIdNumber +
// 添加yonghuIdNumber字段的值
", yonghuPhone=" + yonghuPhone +
// 添加yonghuPhone字段的值
", yonghuEmail=" + yonghuEmail +
// 添加yonghuEmail字段的值
", yonghuDelete=" + yonghuDelete +
// 添加yonghuDelete字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,72 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.JiankangtieshiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("jiankangtieshi")
public class JiankangtieshiView extends JiankangtieshiEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment="贴士类型的字典表值",type="varchar(200)")
private String jiankangtieshiValue;
public JiankangtieshiView() {
}
public JiankangtieshiView(JiankangtieshiEntity jiankangtieshiEntity) {
try {
BeanUtils.copyProperties(this, jiankangtieshiEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
//当前表的
/**
*
*/
public String getJiankangtieshiValue() {
return jiankangtieshiValue;
}
/**
*
*/
public void setJiankangtieshiValue(String jiankangtieshiValue) {
this.jiankangtieshiValue = jiankangtieshiValue;
}
@Override
public String toString() {
return "JiankangtieshiView{" +
", jiankangtieshiValue=" + jiankangtieshiValue +
"} " + super.toString();
}
}

@ -0,0 +1,190 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.MeirijihuaEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("meirijihua")
public class MeirijihuaView extends MeirijihuaEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
//级联表 用户
/**
*
*/
@ColumnInfo(comment = "用户姓名", type = "varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment = "头像", type = "varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment = "身份证号", type = "varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment = "联系方式", type = "varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment = "电子邮箱", type = "varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yonghuDelete;
public MeirijihuaView() {
// 默认构造函数
}
public MeirijihuaView(MeirijihuaEntity meirijihuaEntity) {
// 带参数的构造函数用于从MeirijihuaEntity对象复制属性
try {
BeanUtils.copyProperties(this, meirijihuaEntity);
// 使用BeanUtils工具将传入的MeirijihuaEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "MeirijihuaView{" +
// 开始构建字符串表示
", yonghuName=" + yonghuName +
// 添加yonghuName字段的值
", yonghuPhoto=" + yonghuPhoto +
// 添加yonghuPhoto字段的值
", yonghuIdNumber=" + yonghuIdNumber +
// 添加yonghuIdNumber字段的值
", yonghuPhone=" + yonghuPhone +
// 添加yonghuPhone字段的值
", yonghuEmail=" + yonghuEmail +
// 添加yonghuEmail字段的值
", yonghuDelete=" + yonghuDelete +
// 添加yonghuDelete字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,373 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.MeishiCollectionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("meishi_collection")
public class MeishiCollectionView extends MeishiCollectionEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "类型的字典表值", type = "varchar(200)")
private String meishiCollectionValue;
//级联表 健康食谱
/**
*
*/
@ColumnInfo(comment = "食谱标题", type = "varchar(200)")
private String meishiName;
/**
*
*/
@ColumnInfo(comment = "食谱照片", type = "varchar(200)")
private String meishiPhoto;
/**
*
*/
@ColumnInfo(comment = "食谱类型", type = "int(11)")
private Integer meishiTypes;
/**
*
*/
@ColumnInfo(comment = "食谱类型的字典表值", type = "varchar(200)")
private String meishiValue;
/**
*
*/
@ColumnInfo(comment = "所含热量", type = "int(11)")
private Integer meishiNum;
/**
*
*/
@ColumnInfo(comment = "赞", type = "int(11)")
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment = "踩", type = "int(11)")
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment = "制作教程", type = "longtext")
private String meishiContent;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer meishiDelete;
//级联表 用户
/**
*
*/
@ColumnInfo(comment = "用户姓名", type = "varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment = "头像", type = "varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment = "身份证号", type = "varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment = "联系方式", type = "varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment = "电子邮箱", type = "varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yonghuDelete;
public MeishiCollectionView() {
// 默认构造函数
}
public MeishiCollectionView(MeishiCollectionEntity meishiCollectionEntity) {
// 带参数的构造函数用于从MeishiCollectionEntity对象复制属性
try {
BeanUtils.copyProperties(this, meishiCollectionEntity);
// 使用BeanUtils工具将传入的MeishiCollectionEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getMeishiCollectionValue() {
return meishiCollectionValue;
}
/**
*
*/
public void setMeishiCollectionValue(String meishiCollectionValue) {
this.meishiCollectionValue = meishiCollectionValue;
}
//级联表的get和set 健康食谱
/**
*
*/
public String getMeishiName() {
return meishiName;
}
/**
*
*/
public void setMeishiName(String meishiName) {
this.meishiName = meishiName;
}
/**
*
*/
public String getMeishiPhoto() {
return meishiPhoto;
}
/**
*
*/
public void setMeishiPhoto(String meishiPhoto) {
this.meishiPhoto = meishiPhoto;
}
/**
*
*/
public Integer getMeishiTypes() {
return meishiTypes;
}
/**
*
*/
public void setMeishiTypes(Integer meishiTypes) {
this.meishiTypes = meishiTypes;
}
/**
*
*/
public String getMeishiValue() {
return meishiValue;
}
/**
*
*/
public void setMeishiValue(String meishiValue) {
this.meishiValue = meishiValue;
}
/**
*
*/
public Integer getMeishiNum() {
return meishiNum;
}
/**
*
*/
public void setMeishiNum(Integer meishiNum) {
this.meishiNum = meishiNum;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public String getMeishiContent() {
return meishiContent;
}
/**
*
*/
public void setMeishiContent(String meishiContent) {
this.meishiContent = meishiContent;
}
/**
*
*/
public Integer getMeishiDelete() {
return meishiDelete;
}
/**
*
*/
public void setMeishiDelete(Integer meishiDelete) {
this.meishiDelete = meishiDelete;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
}

@ -0,0 +1,385 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.MeishiLiuyanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("meishi_liuyan")
public class MeishiLiuyanView extends MeishiLiuyanEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
//级联表 健康食谱
/**
*
*/
@ColumnInfo(comment = "食谱标题", type = "varchar(200)")
private String meishiName;
/**
*
*/
@ColumnInfo(comment = "食谱照片", type = "varchar(200)")
private String meishiPhoto;
/**
*
*/
@ColumnInfo(comment = "食谱类型", type = "int(11)")
private Integer meishiTypes;
/**
*
*/
@ColumnInfo(comment = "食谱类型的字典表值", type = "varchar(200)")
private String meishiValue;
/**
*
*/
@ColumnInfo(comment = "所含热量", type = "int(11)")
private Integer meishiNum;
/**
*
*/
@ColumnInfo(comment = "赞", type = "int(11)")
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment = "踩", type = "int(11)")
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment = "制作教程", type = "longtext")
private String meishiContent;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer meishiDelete;
//级联表 用户
/**
*
*/
@ColumnInfo(comment = "用户姓名", type = "varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment = "头像", type = "varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment = "身份证号", type = "varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment = "联系方式", type = "varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment = "电子邮箱", type = "varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yonghuDelete;
public MeishiLiuyanView() {
// 默认构造函数
}
public MeishiLiuyanView(MeishiLiuyanEntity meishiLiuyanEntity) {
// 带参数的构造函数用于从MeishiLiuyanEntity对象复制属性
try {
BeanUtils.copyProperties(this, meishiLiuyanEntity);
// 使用BeanUtils工具将传入的MeishiLiuyanEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//级联表的get和set 健康食谱
/**
*
*/
public String getMeishiName() {
return meishiName;
}
/**
*
*/
public void setMeishiName(String meishiName) {
this.meishiName = meishiName;
}
/**
*
*/
public String getMeishiPhoto() {
return meishiPhoto;
}
/**
*
*/
public void setMeishiPhoto(String meishiPhoto) {
this.meishiPhoto = meishiPhoto;
}
/**
*
*/
public Integer getMeishiTypes() {
return meishiTypes;
}
/**
*
*/
public void setMeishiTypes(Integer meishiTypes) {
this.meishiTypes = meishiTypes;
}
/**
*
*/
public String getMeishiValue() {
return meishiValue;
}
/**
*
*/
public void setMeishiValue(String meishiValue) {
this.meishiValue = meishiValue;
}
/**
*
*/
public Integer getMeishiNum() {
return meishiNum;
}
/**
*
*/
public void setMeishiNum(Integer meishiNum) {
this.meishiNum = meishiNum;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public String getMeishiContent() {
return meishiContent;
}
/**
*
*/
public void setMeishiContent(String meishiContent) {
this.meishiContent = meishiContent;
}
/**
*
*/
public Integer getMeishiDelete() {
return meishiDelete;
}
/**
*
*/
public void setMeishiDelete(Integer meishiDelete) {
this.meishiDelete = meishiDelete;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "MeishiLiuyanView{" +
// 开始构建字符串表示
", meishiName=" + meishiName +
// 添加meishiName字段的值
", meishiPhoto=" + meishiPhoto +
// 添加meishiPhoto字段的值
", meishiNum=" + meishiNum +
// 添加meishiNum字段的值
", zanNumber=" + zanNumber +
// 添加zanNumber字段的值
", caiNumber=" + caiNumber +
// 添加caiNumber字段的值
", meishiContent=" + meishiContent +
// 添加meishiContent字段的值
", meishiDelete=" + meishiDelete +
// 添加meishiDelete字段的值
", yonghuName=" + yonghuName +
// 添加yonghuName字段的值
", yonghuPhoto=" + yonghuPhoto +
// 添加yonghuPhoto字段的值
", yonghuIdNumber=" + yonghuIdNumber +
// 添加yonghuIdNumber字段的值
", yonghuPhone=" + yonghuPhone +
// 添加yonghuPhone字段的值
", yonghuEmail=" + yonghuEmail +
// 添加yonghuEmail字段的值
", yonghuDelete=" + yonghuDelete +
// 添加yonghuDelete字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,77 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.MeishiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("meishi")
public class MeishiView extends MeishiEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "食谱类型的字典表值", type = "varchar(200)")
private String meishiValue;
public MeishiView() {
// 默认构造函数
}
public MeishiView(MeishiEntity meishiEntity) {
// 带参数的构造函数用于从MeishiEntity对象复制属性
try {
BeanUtils.copyProperties(this, meishiEntity);
// 使用BeanUtils工具将传入的MeishiEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getMeishiValue() {
return meishiValue;
}
/**
*
*/
public void setMeishiValue(String meishiValue) {
this.meishiValue = meishiValue;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "MeishiView{" +
// 开始构建字符串表示
", meishiValue=" + meishiValue +
// 添加meishiValue字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,78 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("news")
public class NewsView extends NewsEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "公告类型的字典表值", type = "varchar(200)")
private String newsValue;
public NewsView() {
// 默认构造函数
}
public NewsView(NewsEntity newsEntity) {
// 带参数的构造函数用于从NewsEntity对象复制属性
try {
BeanUtils.copyProperties(this, newsEntity);
// 使用BeanUtils工具将传入的NewsEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getNewsValue() {
return newsValue;
}
/**
*
*/
public void setNewsValue(String newsValue) {
this.newsValue = newsValue;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "NewsView{" +
// 开始构建字符串表示
", newsValue=" + newsValue +
// 添加newsValue字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,77 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.YaopinEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("yaopin")
public class YaopinView extends YaopinEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "药品类型的字典表值", type = "varchar(200)")
private String yaopinValue;
public YaopinView() {
// 默认构造函数
}
public YaopinView(YaopinEntity yaopinEntity) {
// 带参数的构造函数用于从YaopinEntity对象复制属性
try {
BeanUtils.copyProperties(this, yaopinEntity);
// 使用BeanUtils工具将传入的YaopinEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getYaopinValue() {
return yaopinValue;
}
/**
*
*/
public void setYaopinValue(String yaopinValue) {
this.yaopinValue = yaopinValue;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "YaopinView{" +
// 开始构建字符串表示
", yaopinValue=" + yaopinValue +
// 添加yaopinValue字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,78 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("yonghu")
public class YonghuView extends YonghuEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "性别的字典表值", type = "varchar(200)")
private String sexValue;
public YonghuView() {
// 默认构造函数
}
public YonghuView(YonghuEntity yonghuEntity) {
// 带参数的构造函数用于从YonghuEntity对象复制属性
try {
BeanUtils.copyProperties(this, yonghuEntity);
// 使用BeanUtils工具将传入的YonghuEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getSexValue() {
return sexValue;
}
/**
*
*/
public void setSexValue(String sexValue) {
this.sexValue = sexValue;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "YonghuView{" +
// 开始构建字符串表示
", sexValue=" + sexValue +
// 添加sexValue字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,432 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.YundongCollectionEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("yundong_collection")
public class YundongCollectionView extends YundongCollectionEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "类型的字典表值", type = "varchar(200)")
private String yundongCollectionValue;
//级联表 用户
/**
*
*/
@ColumnInfo(comment = "用户姓名", type = "varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment = "头像", type = "varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment = "身份证号", type = "varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment = "联系方式", type = "varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment = "电子邮箱", type = "varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yonghuDelete;
//级联表 运动教程
/**
*
*/
@ColumnInfo(comment = "标题", type = "varchar(200)")
private String yundongName;
/**
*
*/
@ColumnInfo(comment = "运动照片", type = "varchar(200)")
private String yundongPhoto;
/**
*
*/
@ColumnInfo(comment = "运动类型", type = "int(11)")
private Integer yundongTypes;
/**
*
*/
@ColumnInfo(comment = "运动类型的字典表值", type = "varchar(200)")
private String yundongValue;
/**
*
*/
@ColumnInfo(comment = "运动视频", type = "varchar(200)")
private String yundongVideo;
/**
*
*/
@ColumnInfo(comment = "消耗热量", type = "int(11)")
private Integer yundongNum;
/**
*
*/
@ColumnInfo(comment = "赞", type = "int(11)")
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment = "踩", type = "int(11)")
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment = "运动介绍", type = "longtext")
private String yundongContent;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yundongDelete;
public YundongCollectionView() {
// 默认构造函数
}
public YundongCollectionView(YundongCollectionEntity yundongCollectionEntity) {
// 带参数的构造函数用于从YundongCollectionEntity对象复制属性
try {
BeanUtils.copyProperties(this, yundongCollectionEntity);
// 使用BeanUtils工具将传入的YundongCollectionEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getYundongCollectionValue() {
return yundongCollectionValue;
}
/**
*
*/
public void setYundongCollectionValue(String yundongCollectionValue) {
this.yundongCollectionValue = yundongCollectionValue;
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
//级联表的get和set 运动教程
/**
*
*/
public String getYundongName() {
return yundongName;
}
/**
*
*/
public void setYundongName(String yundongName) {
this.yundongName = yundongName;
}
/**
*
*/
public String getYundongPhoto() {
return yundongPhoto;
}
/**
*
*/
public void setYundongPhoto(String yundongPhoto) {
this.yundongPhoto = yundongPhoto;
}
/**
*
*/
public Integer getYundongTypes() {
return yundongTypes;
}
/**
*
*/
public void setYundongTypes(Integer yundongTypes) {
this.yundongTypes = yundongTypes;
}
/**
*
*/
public String getYundongValue() {
return yundongValue;
}
/**
*
*/
public void setYundongValue(String yundongValue) {
this.yundongValue = yundongValue;
}
/**
*
*/
public String getYundongVideo() {
return yundongVideo;
}
/**
*
*/
public void setYundongVideo(String yundongVideo) {
this.yundongVideo = yundongVideo;
}
/**
*
*/
public Integer getYundongNum() {
return yundongNum;
}
/**
*
*/
public void setYundongNum(Integer yundongNum) {
this.yundongNum = yundongNum;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public String getYundongContent() {
return yundongContent;
}
/**
*
*/
public void setYundongContent(String yundongContent) {
this.yundongContent = yundongContent;
}
/**
*
*/
public Integer getYundongDelete() {
return yundongDelete;
}
/**
*
*/
public void setYundongDelete(Integer yundongDelete) {
this.yundongDelete = yundongDelete;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "YundongCollectionView{" +
// 开始构建字符串表示
", yundongCollectionValue=" + yundongCollectionValue +
// 添加yundongCollectionValue字段的值
", yundongName=" + yundongName +
// 添加yundongName字段的值
", yundongPhoto=" + yundongPhoto +
// 添加yundongPhoto字段的值
", yundongVideo=" + yundongVideo +
// 添加yundongVideo字段的值
", yundongNum=" + yundongNum +
// 添加yundongNum字段的值
", zanNumber=" + zanNumber +
// 添加zanNumber字段的值
", caiNumber=" + caiNumber +
// 添加caiNumber字段的值
", yundongContent=" + yundongContent +
// 添加yundongContent字段的值
", yundongDelete=" + yundongDelete +
// 添加yundongDelete字段的值
", yonghuName=" + yonghuName +
// 添加yonghuName字段的值
", yonghuPhoto=" + yonghuPhoto +
// 添加yonghuPhoto字段的值
", yonghuIdNumber=" + yonghuIdNumber +
// 添加yonghuIdNumber字段的值
", yonghuPhone=" + yonghuPhone +
// 添加yonghuPhone字段的值
", yonghuEmail=" + yonghuEmail +
// 添加yonghuEmail字段的值
", yonghuDelete=" + yonghuDelete +
// 添加yonghuDelete字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,408 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.YundongLiuyanEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("yundong_liuyan")
public class YundongLiuyanView extends YundongLiuyanEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
//级联表 用户
/**
*
*/
@ColumnInfo(comment = "用户姓名", type = "varchar(200)")
private String yonghuName;
/**
*
*/
@ColumnInfo(comment = "头像", type = "varchar(200)")
private String yonghuPhoto;
/**
*
*/
@ColumnInfo(comment = "身份证号", type = "varchar(200)")
private String yonghuIdNumber;
/**
*
*/
@ColumnInfo(comment = "联系方式", type = "varchar(200)")
private String yonghuPhone;
/**
*
*/
@ColumnInfo(comment = "电子邮箱", type = "varchar(200)")
private String yonghuEmail;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yonghuDelete;
//级联表 运动教程
/**
*
*/
@ColumnInfo(comment = "标题", type = "varchar(200)")
private String yundongName;
/**
*
*/
@ColumnInfo(comment = "运动照片", type = "varchar(200)")
private String yundongPhoto;
/**
*
*/
@ColumnInfo(comment = "运动类型", type = "int(11)")
private Integer yundongTypes;
/**
*
*/
@ColumnInfo(comment = "运动类型的字典表值", type = "varchar(200)")
private String yundongValue;
/**
*
*/
@ColumnInfo(comment = "运动视频", type = "varchar(200)")
private String yundongVideo;
/**
*
*/
@ColumnInfo(comment = "消耗热量", type = "int(11)")
private Integer yundongNum;
/**
*
*/
@ColumnInfo(comment = "赞", type = "int(11)")
private Integer zanNumber;
/**
*
*/
@ColumnInfo(comment = "踩", type = "int(11)")
private Integer caiNumber;
/**
*
*/
@ColumnInfo(comment = "运动介绍", type = "longtext")
private String yundongContent;
/**
*
*/
@ColumnInfo(comment = "逻辑删除", type = "int(11)")
private Integer yundongDelete;
public YundongLiuyanView() {
// 默认构造函数
}
public YundongLiuyanView(YundongLiuyanEntity yundongLiuyanEntity) {
// 带参数的构造函数用于从YundongLiuyanEntity对象复制属性
try {
BeanUtils.copyProperties(this, yundongLiuyanEntity);
// 使用BeanUtils工具将传入的YundongLiuyanEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//级联表的get和set 用户
/**
*
*/
public String getYonghuName() {
return yonghuName;
}
/**
*
*/
public void setYonghuName(String yonghuName) {
this.yonghuName = yonghuName;
}
/**
*
*/
public String getYonghuPhoto() {
return yonghuPhoto;
}
/**
*
*/
public void setYonghuPhoto(String yonghuPhoto) {
this.yonghuPhoto = yonghuPhoto;
}
/**
*
*/
public String getYonghuIdNumber() {
return yonghuIdNumber;
}
/**
*
*/
public void setYonghuIdNumber(String yonghuIdNumber) {
this.yonghuIdNumber = yonghuIdNumber;
}
/**
*
*/
public String getYonghuPhone() {
return yonghuPhone;
}
/**
*
*/
public void setYonghuPhone(String yonghuPhone) {
this.yonghuPhone = yonghuPhone;
}
/**
*
*/
public String getYonghuEmail() {
return yonghuEmail;
}
/**
*
*/
public void setYonghuEmail(String yonghuEmail) {
this.yonghuEmail = yonghuEmail;
}
/**
*
*/
public Integer getYonghuDelete() {
return yonghuDelete;
}
/**
*
*/
public void setYonghuDelete(Integer yonghuDelete) {
this.yonghuDelete = yonghuDelete;
}
//级联表的get和set 运动教程
/**
*
*/
public String getYundongName() {
return yundongName;
}
/**
*
*/
public void setYundongName(String yundongName) {
this.yundongName = yundongName;
}
/**
*
*/
public String getYundongPhoto() {
return yundongPhoto;
}
/**
*
*/
public void setYundongPhoto(String yundongPhoto) {
this.yundongPhoto = yundongPhoto;
}
/**
*
*/
public Integer getYundongTypes() {
return yundongTypes;
}
/**
*
*/
public void setYundongTypes(Integer yundongTypes) {
this.yundongTypes = yundongTypes;
}
/**
*
*/
public String getYundongValue() {
return yundongValue;
}
/**
*
*/
public void setYundongValue(String yundongValue) {
this.yundongValue = yundongValue;
}
/**
*
*/
public String getYundongVideo() {
return yundongVideo;
}
/**
*
*/
public void setYundongVideo(String yundongVideo) {
this.yundongVideo = yundongVideo;
}
/**
*
*/
public Integer getYundongNum() {
return yundongNum;
}
/**
*
*/
public void setYundongNum(Integer yundongNum) {
this.yundongNum = yundongNum;
}
/**
*
*/
public Integer getZanNumber() {
return zanNumber;
}
/**
*
*/
public void setZanNumber(Integer zanNumber) {
this.zanNumber = zanNumber;
}
/**
*
*/
public Integer getCaiNumber() {
return caiNumber;
}
/**
*
*/
public void setCaiNumber(Integer caiNumber) {
this.caiNumber = caiNumber;
}
/**
*
*/
public String getYundongContent() {
return yundongContent;
}
/**
*
*/
public void setYundongContent(String yundongContent) {
this.yundongContent = yundongContent;
}
/**
*
*/
public Integer getYundongDelete() {
return yundongDelete;
}
/**
*
*/
public void setYundongDelete(Integer yundongDelete) {
this.yundongDelete = yundongDelete;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "YundongLiuyanView{" +
// 开始构建字符串表示
", yundongName=" + yundongName +
// 添加yundongName字段的值
", yundongPhoto=" + yundongPhoto +
// 添加yundongPhoto字段的值
", yundongVideo=" + yundongVideo +
// 添加yundongVideo字段的值
", yundongNum=" + yundongNum +
// 添加yundongNum字段的值
", zanNumber=" + zanNumber +
// 添加zanNumber字段的值
", caiNumber=" + caiNumber +
// 添加caiNumber字段的值
", yundongContent=" + yundongContent +
// 添加yundongContent字段的值
", yundongDelete=" + yundongDelete +
// 添加yundongDelete字段的值
", yonghuName=" + yonghuName +
// 添加yonghuName字段的值
", yonghuPhoto=" + yonghuPhoto +
// 添加yonghuPhoto字段的值
", yonghuIdNumber=" + yonghuIdNumber +
// 添加yonghuIdNumber字段的值
", yonghuPhone=" + yonghuPhone +
// 添加yonghuPhone字段的值
", yonghuEmail=" + yonghuEmail +
// 添加yonghuEmail字段的值
", yonghuDelete=" + yonghuDelete +
// 添加yonghuDelete字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,78 @@
package com.entity.view;
import org.apache.tools.ant.util.DateUtils;
import com.annotation.ColumnInfo;
import com.entity.YundongEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
import com.utils.DateUtil;
/**
*
*
* 使
*/
@TableName("yundong")
public class YundongView extends YundongEntity implements Serializable {
private static final long serialVersionUID = 1L;
//当前表
/**
*
*/
@ColumnInfo(comment = "运动类型的字典表值", type = "varchar(200)")
private String yundongValue;
public YundongView() {
// 默认构造函数
}
public YundongView(YundongEntity yundongEntity) {
// 带参数的构造函数用于从YundongEntity对象复制属性
try {
BeanUtils.copyProperties(this, yundongEntity);
// 使用BeanUtils工具将传入的YundongEntity对象的属性复制到当前对象中
} catch (IllegalAccessException | InvocationTargetException e) {
// 捕获并处理IllegalAccessException和InvocationTargetException异常
// TODO Auto-generated catch block
e.printStackTrace();
// 打印异常堆栈信息
}
}
//当前表的
/**
*
*/
public String getYundongValue() {
return yundongValue;
}
/**
*
*/
public void setYundongValue(String yundongValue) {
this.yundongValue = yundongValue;
}
@Override
public String toString() {
// 重写toString方法返回当前对象的字符串表示
return "YundongView{" +
// 开始构建字符串表示
", yundongValue=" + yundongValue +
// 添加yundongValue字段的值
"} " + super.toString();
// 结束字符串表示并调用父类的toString方法
}
}

@ -0,0 +1,209 @@
package com.entity.vo;
import com.entity.DictionaryEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
*/
@TableName("dictionary")
public class DictionaryVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Long id;
/**
*
*/
@TableField(value = "dic_code")
private String dicCode;
/**
*
*/
@TableField(value = "dic_name")
private String dicName;
/**
*
*/
@TableField(value = "code_index")
private Integer codeIndex;
/**
*
*/
@TableField(value = "index_name")
private String indexName;
/**
* id
*/
@TableField(value = "super_id")
private Integer superId;
/**
*
*/
@TableField(value = "beizhu")
private String beizhu;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "create_time")
private Date createTime;
/**
*
*/
public Long getId() {
return id;
}
/**
*
*/
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public String getDicCode() {
return dicCode;
}
/**
*
*/
public void setDicCode(String dicCode) {
this.dicCode = dicCode;
}
/**
*
*/
public String getDicName() {
return dicName;
}
/**
*
*/
public void setDicName(String dicName) {
this.dicName = dicName;
}
/**
*
*/
public Integer getCodeIndex() {
return codeIndex;
}
/**
*
*/
public void setCodeIndex(Integer codeIndex) {
this.codeIndex = codeIndex;
}
/**
*
*/
public String getIndexName() {
return indexName;
}
/**
*
*/
public void setIndexName(String indexName) {
this.indexName = indexName;
}
/**
* id
*/
public Integer getSuperId() {
return superId;
}
/**
* id
*/
public void setSuperId(Integer superId) {
this.superId = superId;
}
/**
*
*/
public String getBeizhu() {
return beizhu;
}
/**
*
*/
public void setBeizhu(String beizhu) {
this.beizhu = beizhu;
}
/**
*
*/
public Date getCreateTime() {
return createTime;
}
/**
*
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,259 @@
package com.entity.vo;
import com.entity.ForumEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
*/
@TableName("forum")
public class ForumVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "forum_name")
private String forumName;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "users_id")
private Integer usersId;
/**
*
*/
@TableField(value = "forum_content")
private String forumContent;
/**
* id
*/
@TableField(value = "super_ids")
private Integer superIds;
/**
*
*/
@TableField(value = "forum_state_types")
private Integer forumStateTypes;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time")
private Date insertTime;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "update_time")
private Date updateTime;
/**
* show2
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "create_time")
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getForumName() {
return forumName;
}
/**
*
*/
public void setForumName(String forumName) {
this.forumName = forumName;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Integer getUsersId() {
return usersId;
}
/**
*
*/
public void setUsersId(Integer usersId) {
this.usersId = usersId;
}
/**
*
*/
public String getForumContent() {
return forumContent;
}
/**
*
*/
public void setForumContent(String forumContent) {
this.forumContent = forumContent;
}
/**
* id
*/
public Integer getSuperIds() {
return superIds;
}
/**
* id
*/
public void setSuperIds(Integer superIds) {
this.superIds = superIds;
}
/**
*
*/
public Integer getForumStateTypes() {
return forumStateTypes;
}
/**
*
*/
public void setForumStateTypes(Integer forumStateTypes) {
this.forumStateTypes = forumStateTypes;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public Date getUpdateTime() {
return updateTime;
}
/**
*
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* show2
*/
public Date getCreateTime() {
return createTime;
}
/**
* show2
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,282 @@
package com.entity.vo;
import com.entity.GerentizhengEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
*/
@TableName("gerentizheng")
public class GerentizhengVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "yonghu_id")
private Integer yonghuId;
/**
*
*/
@TableField(value = "gerentizheng_num")
private Double gerentizhengNum;
/**
*
*/
@TableField(value = "tizhong_num")
private Double tizhongNum;
/**
*
*/
@TableField(value = "shenti_types")
private Integer shentiTypes;
/**
*
*/
@TableField(value = "meishi_photo")
private String meishiPhoto;
/**
*
*/
@TableField(value = "gerentizheng_content")
private String gerentizhengContent;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "gerentizheng_time")
private Date gerentizhengTime;
/**
*
*/
@TableField(value = "gerentizheng_delete")
private Integer gerentizhengDelete;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time")
private Date insertTime;
/**
* show3 listShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "create_time")
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public Integer getYonghuId() {
return yonghuId;
}
/**
*
*/
public void setYonghuId(Integer yonghuId) {
this.yonghuId = yonghuId;
}
/**
*
*/
public Double getGerentizhengNum() {
return gerentizhengNum;
}
/**
*
*/
public void setGerentizhengNum(Double gerentizhengNum) {
this.gerentizhengNum = gerentizhengNum;
}
/**
*
*/
public Double getTizhongNum() {
return tizhongNum;
}
/**
*
*/
public void setTizhongNum(Double tizhongNum) {
this.tizhongNum = tizhongNum;
}
/**
*
*/
public Integer getShentiTypes() {
return shentiTypes;
}
/**
*
*/
public void setShentiTypes(Integer shentiTypes) {
this.shentiTypes = shentiTypes;
}
/**
*
*/
public String getMeishiPhoto() {
return meishiPhoto;
}
/**
*
*/
public void setMeishiPhoto(String meishiPhoto) {
this.meishiPhoto = meishiPhoto;
}
/**
*
*/
public String getGerentizhengContent() {
return gerentizhengContent;
}
/**
*
*/
public void setGerentizhengContent(String gerentizhengContent) {
this.gerentizhengContent = gerentizhengContent;
}
/**
*
*/
public Date getGerentizhengTime() {
return gerentizhengTime;
}
/**
*
*/
public void setGerentizhengTime(Date gerentizhengTime) {
this.gerentizhengTime = gerentizhengTime;
}
/**
*
*/
public Integer getGerentizhengDelete() {
return gerentizhengDelete;
}
/**
*
*/
public void setGerentizhengDelete(Integer gerentizhengDelete) {
this.gerentizhengDelete = gerentizhengDelete;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
* show3 listShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show3 listShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

@ -0,0 +1,188 @@
package com.entity.vo;
import com.entity.JiankangtieshiEntity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
*
*
*
*/
@TableName("jiankangtieshi")
public class JiankangtieshiVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableField(value = "id")
private Integer id;
/**
*
*/
@TableField(value = "jiankangtieshi_name")
private String jiankangtieshiName;
/**
*
*/
@TableField(value = "jiankangtieshi_types")
private Integer jiankangtieshiTypes;
/**
*
*/
@TableField(value = "jiankangtieshi_photo")
private String jiankangtieshiPhoto;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "insert_time")
private Date insertTime;
/**
*
*/
@TableField(value = "jiankangtieshi_content")
private String jiankangtieshiContent;
/**
* show1 show2 nameShow
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
@TableField(value = "create_time")
private Date createTime;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
*
*/
public String getJiankangtieshiName() {
return jiankangtieshiName;
}
/**
*
*/
public void setJiankangtieshiName(String jiankangtieshiName) {
this.jiankangtieshiName = jiankangtieshiName;
}
/**
*
*/
public Integer getJiankangtieshiTypes() {
return jiankangtieshiTypes;
}
/**
*
*/
public void setJiankangtieshiTypes(Integer jiankangtieshiTypes) {
this.jiankangtieshiTypes = jiankangtieshiTypes;
}
/**
*
*/
public String getJiankangtieshiPhoto() {
return jiankangtieshiPhoto;
}
/**
*
*/
public void setJiankangtieshiPhoto(String jiankangtieshiPhoto) {
this.jiankangtieshiPhoto = jiankangtieshiPhoto;
}
/**
*
*/
public Date getInsertTime() {
return insertTime;
}
/**
*
*/
public void setInsertTime(Date insertTime) {
this.insertTime = insertTime;
}
/**
*
*/
public String getJiankangtieshiContent() {
return jiankangtieshiContent;
}
/**
*
*/
public void setJiankangtieshiContent(String jiankangtieshiContent) {
this.jiankangtieshiContent = jiankangtieshiContent;
}
/**
* show1 show2 nameShow
*/
public Date getCreateTime() {
return createTime;
}
/**
* show1 show2 nameShow
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save