Sun. 9 months ago
commit 8fb6dc9d3e

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/../../../../../../:\Users\16684\Desktop\springboot45y5d\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -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="springboot45y5d" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="springboot45y5d" 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,25 @@
<?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="https://repo.maven.apache.org/maven2" />
</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>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://maven.aliyun.com/repository/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,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/springboot45y5d.iml" filepath="$PROJECT_DIR$/springboot45y5d.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

Binary file not shown.

@ -0,0 +1,151 @@
<?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>springboot45y5d</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springboot-schema</name>
<description>springboot学习框架</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>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</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.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.0.jre8</version>
<scope>runtime</scope>
</dependency>
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</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,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
</module>

@ -0,0 +1,21 @@
package com;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
@MapperScan(basePackages = {"com.dao"})
public class SpringbootSchemaApplication extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(SpringbootSchemaApplication.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
return applicationBuilder.sources(SpringbootSchemaApplication.class);
}
}

@ -0,0 +1,15 @@
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 {
}

@ -0,0 +1,13 @@
package com.annotation;
import java.lang.annotation.*;
/**
* Token
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IgnoreAuth {
}

@ -0,0 +1,15 @@
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 LoginUser {
}

@ -0,0 +1,18 @@
package com.config;
import java.io.FileWriter;
import java.io.IOException;
/* *
*AlipayConfig
*
*
*2017-04-05
*
*便,使
*使
*/
public class AlipayConfig {
}

@ -0,0 +1,38 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import com.interceptor.AuthorizationInterceptor;
@Configuration
public class InterceptorConfig extends WebMvcConfigurationSupport{
@Bean
public AuthorizationInterceptor getAuthorizationInterceptor() {
return new AuthorizationInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**");
super.addInterceptors(registry);
}
/**
* springboot 2.0WebMvcConfigurationSupport访addResourceHandlers
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/resources/")
.addResourceLocations("classpath:/static/")
.addResourceLocations("classpath:/admin/")
.addResourceLocations("classpath:/front/")
.addResourceLocations("classpath:/public/");
super.addResourceHandlers(registry);
}
}

@ -0,0 +1,24 @@
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
*/
@Configuration
public class MybatisPlusConfig {
/**
*
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -0,0 +1,302 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.BozhuEntity;
import com.entity.view.BozhuView;
import com.service.BozhuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@RestController
@RequestMapping("/bozhu")
public class BozhuController {
@Autowired
private BozhuService bozhuService;
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
BozhuEntity user = bozhuService.selectOne(new EntityWrapper<BozhuEntity>().eq("bozhuhao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"bozhu", "博主" );
return R.ok().put("token", token);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody BozhuEntity bozhu){
//ValidatorUtils.validateEntity(bozhu);
BozhuEntity user = bozhuService.selectOne(new EntityWrapper<BozhuEntity>().eq("bozhuhao", bozhu.getBozhuhao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
bozhu.setId(uId);
bozhuService.insert(bozhu);
return R.ok();
}
/**
* 退
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
BozhuEntity user = bozhuService.selectById(id);
return R.ok().put("data", user);
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
BozhuEntity user = bozhuService.selectOne(new EntityWrapper<BozhuEntity>().eq("bozhuhao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
bozhuService.updateById(user);
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,BozhuEntity bozhu,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("bozhu")) {
bozhu.setBozhuhao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<BozhuEntity> ew = new EntityWrapper<BozhuEntity>();
PageUtils page = bozhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhu), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,BozhuEntity bozhu,
HttpServletRequest request){
EntityWrapper<BozhuEntity> ew = new EntityWrapper<BozhuEntity>();
PageUtils page = bozhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhu), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/lists")
public R list( BozhuEntity bozhu){
EntityWrapper<BozhuEntity> ew = new EntityWrapper<BozhuEntity>();
ew.allEq(MPUtil.allEQMapPre( bozhu, "bozhu"));
return R.ok().put("data", bozhuService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/query")
public R query(BozhuEntity bozhu){
EntityWrapper< BozhuEntity> ew = new EntityWrapper< BozhuEntity>();
ew.allEq(MPUtil.allEQMapPre( bozhu, "bozhu"));
BozhuView bozhuView = bozhuService.selectView(ew);
return R.ok("查询博主成功").put("data", bozhuView);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
BozhuEntity bozhu = bozhuService.selectById(id);
return R.ok().put("data", bozhu);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
BozhuEntity bozhu = bozhuService.selectById(id);
return R.ok().put("data", bozhu);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody BozhuEntity bozhu, HttpServletRequest request){
bozhu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(bozhu);
BozhuEntity user = bozhuService.selectOne(new EntityWrapper<BozhuEntity>().eq("bozhuhao", bozhu.getBozhuhao()));
if(user!=null) {
return R.error("用户已存在");
}
bozhu.setId(new Date().getTime());
bozhuService.insert(bozhu);
return R.ok();
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody BozhuEntity bozhu, HttpServletRequest request){
bozhu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(bozhu);
BozhuEntity user = bozhuService.selectOne(new EntityWrapper<BozhuEntity>().eq("bozhuhao", bozhu.getBozhuhao()));
if(user!=null) {
return R.error("用户已存在");
}
bozhu.setId(new Date().getTime());
bozhuService.insert(bozhu);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody BozhuEntity bozhu, HttpServletRequest request){
//ValidatorUtils.validateEntity(bozhu);
bozhuService.updateById(bozhu);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
bozhuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<BozhuEntity> wrapper = new EntityWrapper<BozhuEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("bozhu")) {
wrapper.eq("bozhuhao", (String)request.getSession().getAttribute("username"));
}
int count = bozhuService.selectCount(wrapper);
return R.ok().put("count", count);
}
}

@ -0,0 +1,274 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.BozhuwenzhangEntity;
import com.entity.view.BozhuwenzhangView;
import com.service.BozhuwenzhangService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
import com.service.StoreupService;
import com.entity.StoreupEntity;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@RestController
@RequestMapping("/bozhuwenzhang")
public class BozhuwenzhangController {
@Autowired
private BozhuwenzhangService bozhuwenzhangService;
@Autowired
private StoreupService storeupService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,BozhuwenzhangEntity bozhuwenzhang,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("bozhu")) {
bozhuwenzhang.setBozhuhao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
PageUtils page = bozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhuwenzhang), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,BozhuwenzhangEntity bozhuwenzhang,
HttpServletRequest request){
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
PageUtils page = bozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhuwenzhang), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/lists")
public R list( BozhuwenzhangEntity bozhuwenzhang){
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( bozhuwenzhang, "bozhuwenzhang"));
return R.ok().put("data", bozhuwenzhangService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/query")
public R query(BozhuwenzhangEntity bozhuwenzhang){
EntityWrapper< BozhuwenzhangEntity> ew = new EntityWrapper< BozhuwenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( bozhuwenzhang, "bozhuwenzhang"));
BozhuwenzhangView bozhuwenzhangView = bozhuwenzhangService.selectView(ew);
return R.ok("查询博主文章成功").put("data", bozhuwenzhangView);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
BozhuwenzhangEntity bozhuwenzhang = bozhuwenzhangService.selectById(id);
bozhuwenzhang.setClicknum(bozhuwenzhang.getClicknum()+1);
bozhuwenzhang.setClicktime(new Date());
bozhuwenzhangService.updateById(bozhuwenzhang);
return R.ok().put("data", bozhuwenzhang);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
BozhuwenzhangEntity bozhuwenzhang = bozhuwenzhangService.selectById(id);
bozhuwenzhang.setClicknum(bozhuwenzhang.getClicknum()+1);
bozhuwenzhang.setClicktime(new Date());
bozhuwenzhangService.updateById(bozhuwenzhang);
return R.ok().put("data", bozhuwenzhang);
}
/**
*
*/
@RequestMapping("/thumbsup/{id}")
public R vote(@PathVariable("id") String id,String type){
BozhuwenzhangEntity bozhuwenzhang = bozhuwenzhangService.selectById(id);
if(type.equals("1")) {
bozhuwenzhang.setThumbsupnum(bozhuwenzhang.getThumbsupnum()+1);
} else {
bozhuwenzhang.setCrazilynum(bozhuwenzhang.getCrazilynum()+1);
}
bozhuwenzhangService.updateById(bozhuwenzhang);
return R.ok("投票成功");
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request){
bozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(bozhuwenzhang);
bozhuwenzhangService.insert(bozhuwenzhang);
return R.ok();
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request){
bozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(bozhuwenzhang);
bozhuwenzhangService.insert(bozhuwenzhang);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request){
//ValidatorUtils.validateEntity(bozhuwenzhang);
bozhuwenzhangService.updateById(bozhuwenzhang);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
bozhuwenzhangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<BozhuwenzhangEntity> wrapper = new EntityWrapper<BozhuwenzhangEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("bozhu")) {
wrapper.eq("bozhuhao", (String)request.getSession().getAttribute("username"));
}
int count = bozhuwenzhangService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,BozhuwenzhangEntity bozhuwenzhang, HttpServletRequest request,String pre){
EntityWrapper<BozhuwenzhangEntity> ew = new EntityWrapper<BozhuwenzhangEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = bozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, bozhuwenzhang), params), params));
return R.ok().put("data", page);
}
}

@ -0,0 +1,269 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
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 com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*/
@RestController
public class CommonController{
@Autowired
private CommonService commonService;
private static AipFace client = null;
@Autowired
private ConfigService configService;
/**
* tablecolumn()
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/option/{tableName}/{columnName}")
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* tablecolumn
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/follow/{tableName}/{columnName}")
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* tablesfsh
* @param table
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
*
* @param tableName
* @param columnName
* @param type 1: 2:
* @param map
* @return
*/
@IgnoreAuth
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/cal/{tableName}/{columnName}")
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/group/{tableName}/{columnName}")
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}/{timeStatType}")
public R valueDay(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
params.put("timeStatType", timeStatType);
List<Map<String, Object>> result = commonService.selectTimeStatValue(params);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k)));
}
}
}
return R.ok().put("data", result);
}
/**
*
*
* @param face1 1
* @param face2 2
* @return
*/
@RequestMapping("/matchFace")
@IgnoreAuth
public R matchFace(String face1, String face2,HttpServletRequest request) {
if(client==null) {
/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if(token==null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
}
JSONObject res = null;
try {
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
if(!path.exists()) {
path = new File("");
}
File upload = new File(path.getAbsolutePath(),"/upload/");
File file1 = new File(upload.getAbsolutePath()+"/"+face1);
File file2 = new File(upload.getAbsolutePath()+"/"+face2);
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
res = client.match(requests);
System.out.println(res.get("result"));
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在");
} catch (IOException e) {
e.printStackTrace();
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
}

@ -0,0 +1,112 @@
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.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
@RequestMapping("config")
@RestController
public class ConfigController{
@Autowired
private ConfigService configService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") String id){
ConfigEntity config = configService.selectById(id);
return R.ok().put("data", config);
}
/**
* name
*/
@RequestMapping("/info")
public R infoByName(@RequestParam String name){
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
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,215 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.DiscussbozhuwenzhangEntity;
import com.entity.view.DiscussbozhuwenzhangView;
import com.service.DiscussbozhuwenzhangService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@RestController
@RequestMapping("/discussbozhuwenzhang")
public class DiscussbozhuwenzhangController {
@Autowired
private DiscussbozhuwenzhangService discussbozhuwenzhangService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,DiscussbozhuwenzhangEntity discussbozhuwenzhang,
HttpServletRequest request){
EntityWrapper<DiscussbozhuwenzhangEntity> ew = new EntityWrapper<DiscussbozhuwenzhangEntity>();
PageUtils page = discussbozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussbozhuwenzhang), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,DiscussbozhuwenzhangEntity discussbozhuwenzhang,
HttpServletRequest request){
EntityWrapper<DiscussbozhuwenzhangEntity> ew = new EntityWrapper<DiscussbozhuwenzhangEntity>();
PageUtils page = discussbozhuwenzhangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussbozhuwenzhang), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/lists")
public R list( DiscussbozhuwenzhangEntity discussbozhuwenzhang){
EntityWrapper<DiscussbozhuwenzhangEntity> ew = new EntityWrapper<DiscussbozhuwenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( discussbozhuwenzhang, "discussbozhuwenzhang"));
return R.ok().put("data", discussbozhuwenzhangService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/query")
public R query(DiscussbozhuwenzhangEntity discussbozhuwenzhang){
EntityWrapper< DiscussbozhuwenzhangEntity> ew = new EntityWrapper< DiscussbozhuwenzhangEntity>();
ew.allEq(MPUtil.allEQMapPre( discussbozhuwenzhang, "discussbozhuwenzhang"));
DiscussbozhuwenzhangView discussbozhuwenzhangView = discussbozhuwenzhangService.selectView(ew);
return R.ok("查询博主文章评论表成功").put("data", discussbozhuwenzhangView);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
DiscussbozhuwenzhangEntity discussbozhuwenzhang = discussbozhuwenzhangService.selectById(id);
return R.ok().put("data", discussbozhuwenzhang);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DiscussbozhuwenzhangEntity discussbozhuwenzhang = discussbozhuwenzhangService.selectById(id);
return R.ok().put("data", discussbozhuwenzhang);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody DiscussbozhuwenzhangEntity discussbozhuwenzhang, HttpServletRequest request){
discussbozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussbozhuwenzhang);
discussbozhuwenzhangService.insert(discussbozhuwenzhang);
return R.ok();
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody DiscussbozhuwenzhangEntity discussbozhuwenzhang, HttpServletRequest request){
discussbozhuwenzhang.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(discussbozhuwenzhang);
discussbozhuwenzhangService.insert(discussbozhuwenzhang);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody DiscussbozhuwenzhangEntity discussbozhuwenzhang, HttpServletRequest request){
//ValidatorUtils.validateEntity(discussbozhuwenzhang);
discussbozhuwenzhangService.updateById(discussbozhuwenzhang);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
discussbozhuwenzhangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<DiscussbozhuwenzhangEntity> wrapper = new EntityWrapper<DiscussbozhuwenzhangEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = discussbozhuwenzhangService.selectCount(wrapper);
return R.ok().put("count", count);
}
}

@ -0,0 +1,116 @@
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{
@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);
/**
* 使ideaeclipse
* "D:\\springbootq33sd\\src\\main\\resources\\static\\upload"upload
*
*/
// FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/
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);
}*/
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,215 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.NewsEntity;
import com.entity.view.NewsView;
import com.service.NewsService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@RestController
@RequestMapping("/news")
public class NewsController {
@Autowired
private NewsService newsService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,NewsEntity news,
HttpServletRequest request){
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,NewsEntity news,
HttpServletRequest request){
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/lists")
public R list( NewsEntity news){
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
ew.allEq(MPUtil.allEQMapPre( news, "news"));
return R.ok().put("data", newsService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/query")
public R query(NewsEntity news){
EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();
ew.allEq(MPUtil.allEQMapPre( news, "news"));
NewsView newsView = newsService.selectView(ew);
return R.ok("查询系统公告成功").put("data", newsView);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
NewsEntity news = newsService.selectById(id);
return R.ok().put("data", news);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
NewsEntity news = newsService.selectById(id);
return R.ok().put("data", news);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody NewsEntity news, HttpServletRequest request){
news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(news);
newsService.insert(news);
return R.ok();
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody NewsEntity news, HttpServletRequest request){
news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(news);
newsService.insert(news);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody NewsEntity news, HttpServletRequest request){
//ValidatorUtils.validateEntity(news);
newsService.updateById(news);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
newsService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = newsService.selectCount(wrapper);
return R.ok().put("count", count);
}
}

@ -0,0 +1,225 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.StoreupEntity;
import com.entity.view.StoreupView;
import com.service.StoreupService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@RestController
@RequestMapping("/storeup")
public class StoreupController {
@Autowired
private StoreupService storeupService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,StoreupEntity storeup,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,StoreupEntity storeup,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/lists")
public R list( StoreupEntity storeup){
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
return R.ok().put("data", storeupService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/query")
public R query(StoreupEntity storeup){
EntityWrapper< StoreupEntity> ew = new EntityWrapper< StoreupEntity>();
ew.allEq(MPUtil.allEQMapPre( storeup, "storeup"));
StoreupView storeupView = storeupService.selectView(ew);
return R.ok("查询收藏表成功").put("data", storeupView);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
StoreupEntity storeup = storeupService.selectById(id);
return R.ok().put("data", storeup);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
StoreupEntity storeup = storeupService.selectById(id);
return R.ok().put("data", storeup);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody StoreupEntity storeup, HttpServletRequest request){
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(storeup);
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
storeupService.insert(storeup);
return R.ok();
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody StoreupEntity storeup, HttpServletRequest request){
storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(storeup);
storeup.setUserid((Long)request.getSession().getAttribute("userId"));
storeupService.insert(storeup);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody StoreupEntity storeup, HttpServletRequest request){
//ValidatorUtils.validateEntity(storeup);
storeupService.updateById(storeup);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
storeupService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<StoreupEntity> wrapper = new EntityWrapper<StoreupEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
}
int count = storeupService.selectCount(wrapper);
return R.ok().put("count", count);
}
}

@ -0,0 +1,174 @@
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null || !user.getPassword().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/**
*
*/
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
* 退
*/
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("账号不存在");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/**
*
*/
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
return R.error("用户已存在");
}
userService.insert(user);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
return R.error("用户名已存在。");
}
userService.updateById(user);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}

@ -0,0 +1,215 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.WenzhangfenleiEntity;
import com.entity.view.WenzhangfenleiView;
import com.service.WenzhangfenleiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@RestController
@RequestMapping("/wenzhangfenlei")
public class WenzhangfenleiController {
@Autowired
private WenzhangfenleiService wenzhangfenleiService;
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,WenzhangfenleiEntity wenzhangfenlei,
HttpServletRequest request){
EntityWrapper<WenzhangfenleiEntity> ew = new EntityWrapper<WenzhangfenleiEntity>();
PageUtils page = wenzhangfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenzhangfenlei), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,WenzhangfenleiEntity wenzhangfenlei,
HttpServletRequest request){
EntityWrapper<WenzhangfenleiEntity> ew = new EntityWrapper<WenzhangfenleiEntity>();
PageUtils page = wenzhangfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, wenzhangfenlei), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/lists")
public R list( WenzhangfenleiEntity wenzhangfenlei){
EntityWrapper<WenzhangfenleiEntity> ew = new EntityWrapper<WenzhangfenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( wenzhangfenlei, "wenzhangfenlei"));
return R.ok().put("data", wenzhangfenleiService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/query")
public R query(WenzhangfenleiEntity wenzhangfenlei){
EntityWrapper< WenzhangfenleiEntity> ew = new EntityWrapper< WenzhangfenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( wenzhangfenlei, "wenzhangfenlei"));
WenzhangfenleiView wenzhangfenleiView = wenzhangfenleiService.selectView(ew);
return R.ok("查询文章分类成功").put("data", wenzhangfenleiView);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
WenzhangfenleiEntity wenzhangfenlei = wenzhangfenleiService.selectById(id);
return R.ok().put("data", wenzhangfenlei);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
WenzhangfenleiEntity wenzhangfenlei = wenzhangfenleiService.selectById(id);
return R.ok().put("data", wenzhangfenlei);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody WenzhangfenleiEntity wenzhangfenlei, HttpServletRequest request){
wenzhangfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wenzhangfenlei);
wenzhangfenleiService.insert(wenzhangfenlei);
return R.ok();
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody WenzhangfenleiEntity wenzhangfenlei, HttpServletRequest request){
wenzhangfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(wenzhangfenlei);
wenzhangfenleiService.insert(wenzhangfenlei);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody WenzhangfenleiEntity wenzhangfenlei, HttpServletRequest request){
//ValidatorUtils.validateEntity(wenzhangfenlei);
wenzhangfenleiService.updateById(wenzhangfenlei);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
wenzhangfenleiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<WenzhangfenleiEntity> wrapper = new EntityWrapper<WenzhangfenleiEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = wenzhangfenleiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}

@ -0,0 +1,294 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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 com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.YonghuEntity;
import com.entity.view.YonghuView;
import com.service.YonghuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@RestController
@RequestMapping("/yonghu")
public class YonghuController {
@Autowired
private YonghuService yonghuService;
@Autowired
private TokenService tokenService;
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"yonghu", "用户" );
return R.ok().put("token", token);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody YonghuEntity yonghu){
//ValidatorUtils.validateEntity(yonghu);
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
yonghu.setId(uId);
yonghuService.insert(yonghu);
return R.ok();
}
/**
* 退
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* session
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
YonghuEntity user = yonghuService.selectById(id);
return R.ok().put("data", user);
}
/**
*
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
yonghuService.updateById(user);
return R.ok("密码已重置为123456");
}
/**
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,YonghuEntity yonghu,
HttpServletRequest request){
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();
PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,YonghuEntity yonghu,
HttpServletRequest request){
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();
PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params));
return R.ok().put("data", page);
}
/**
*
*/
@RequestMapping("/lists")
public R list( YonghuEntity yonghu){
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();
ew.allEq(MPUtil.allEQMapPre( yonghu, "yonghu"));
return R.ok().put("data", yonghuService.selectListView(ew));
}
/**
*
*/
@RequestMapping("/query")
public R query(YonghuEntity yonghu){
EntityWrapper< YonghuEntity> ew = new EntityWrapper< YonghuEntity>();
ew.allEq(MPUtil.allEQMapPre( yonghu, "yonghu"));
YonghuView yonghuView = yonghuService.selectView(ew);
return R.ok("查询用户成功").put("data", yonghuView);
}
/**
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
YonghuEntity yonghu = yonghuService.selectById(id);
return R.ok().put("data", yonghu);
}
/**
*
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YonghuEntity yonghu = yonghuService.selectById(id);
return R.ok().put("data", yonghu);
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
yonghu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yonghu);
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming()));
if(user!=null) {
return R.error("用户已存在");
}
yonghu.setId(new Date().getTime());
yonghuService.insert(yonghu);
return R.ok();
}
/**
*
*/
@RequestMapping("/add")
public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
yonghu.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yonghu);
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming()));
if(user!=null) {
return R.error("用户已存在");
}
yonghu.setId(new Date().getTime());
yonghuService.insert(yonghu);
return R.ok();
}
/**
*
*/
@RequestMapping("/update")
public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request){
//ValidatorUtils.validateEntity(yonghu);
yonghuService.updateById(yonghu);//全部更新
return R.ok();
}
/**
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
yonghuService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
*
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<YonghuEntity> wrapper = new EntityWrapper<YonghuEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = yonghuService.selectCount(wrapper);
return R.ok().put("count", count);
}
}

@ -0,0 +1,35 @@
package com.dao;
import com.entity.BozhuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.BozhuVO;
import com.entity.view.BozhuView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface BozhuDao extends BaseMapper<BozhuEntity> {
List<BozhuVO> selectListVO(@Param("ew") Wrapper<BozhuEntity> wrapper);
BozhuVO selectVO(@Param("ew") Wrapper<BozhuEntity> wrapper);
List<BozhuView> selectListView(@Param("ew") Wrapper<BozhuEntity> wrapper);
List<BozhuView> selectListView(Pagination page,@Param("ew") Wrapper<BozhuEntity> wrapper);
BozhuView selectView(@Param("ew") Wrapper<BozhuEntity> wrapper);
}

@ -0,0 +1,35 @@
package com.dao;
import com.entity.BozhuwenzhangEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.BozhuwenzhangVO;
import com.entity.view.BozhuwenzhangView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface BozhuwenzhangDao extends BaseMapper<BozhuwenzhangEntity> {
List<BozhuwenzhangVO> selectListVO(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
BozhuwenzhangVO selectVO(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
List<BozhuwenzhangView> selectListView(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
List<BozhuwenzhangView> selectListView(Pagination page,@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
BozhuwenzhangView selectView(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
}

@ -0,0 +1,28 @@
package com.dao;
import java.util.List;
import java.util.Map;
/**
*
*/
public interface CommonDao{
List<String> getOption(Map<String, Object> params);
Map<String, Object> getFollowByOption(Map<String, Object> params);
List<String> getFollowByOption2(Map<String, Object> params);
void sh(Map<String, Object> params);
int remindCount(Map<String, Object> params);
Map<String, Object> selectCal(Map<String, Object> params);
List<Map<String, Object>> selectGroup(Map<String, Object> params);
List<Map<String, Object>> selectValue(Map<String, Object> params);
List<Map<String, Object>> selectTimeStatValue(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,35 @@
package com.dao;
import com.entity.DiscussbozhuwenzhangEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.DiscussbozhuwenzhangVO;
import com.entity.view.DiscussbozhuwenzhangView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface DiscussbozhuwenzhangDao extends BaseMapper<DiscussbozhuwenzhangEntity> {
List<DiscussbozhuwenzhangVO> selectListVO(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
DiscussbozhuwenzhangVO selectVO(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
List<DiscussbozhuwenzhangView> selectListView(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
List<DiscussbozhuwenzhangView> selectListView(Pagination page,@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
DiscussbozhuwenzhangView selectView(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
}

@ -0,0 +1,35 @@
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.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.NewsVO;
import com.entity.view.NewsView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsVO> selectListVO(@Param("ew") Wrapper<NewsEntity> wrapper);
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
List<NewsView> selectListView(@Param("ew") Wrapper<NewsEntity> wrapper);
List<NewsView> selectListView(Pagination page,@Param("ew") Wrapper<NewsEntity> wrapper);
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
}

@ -0,0 +1,35 @@
package com.dao;
import com.entity.StoreupEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.StoreupVO;
import com.entity.view.StoreupView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface StoreupDao extends BaseMapper<StoreupEntity> {
List<StoreupVO> selectListVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
List<StoreupView> selectListView(@Param("ew") Wrapper<StoreupEntity> wrapper);
List<StoreupView> selectListView(Pagination page,@Param("ew") Wrapper<StoreupEntity> wrapper);
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> 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.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.UserEntity;
/**
*
*/
public interface UserDao extends BaseMapper<UserEntity> {
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
List<UserEntity> selectListView(Pagination page,@Param("ew") Wrapper<UserEntity> wrapper);
}

@ -0,0 +1,35 @@
package com.dao;
import com.entity.WenzhangfenleiEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.WenzhangfenleiVO;
import com.entity.view.WenzhangfenleiView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface WenzhangfenleiDao extends BaseMapper<WenzhangfenleiEntity> {
List<WenzhangfenleiVO> selectListVO(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
WenzhangfenleiVO selectVO(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
List<WenzhangfenleiView> selectListView(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
List<WenzhangfenleiView> selectListView(Pagination page,@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
WenzhangfenleiView selectView(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
}

@ -0,0 +1,35 @@
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.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.YonghuVO;
import com.entity.view.YonghuView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface YonghuDao extends BaseMapper<YonghuEntity> {
List<YonghuVO> selectListVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
List<YonghuView> selectListView(@Param("ew") Wrapper<YonghuEntity> wrapper);
List<YonghuView> selectListView(Pagination page,@Param("ew") Wrapper<YonghuEntity> wrapper);
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
}

@ -0,0 +1,236 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("bozhu")
public class BozhuEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public BozhuEntity() {
}
public BozhuEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String bozhuhao;
/**
*
*/
private String bozhuming;
/**
*
*/
private String mima;
/**
*
*/
private String xingbie;
/**
*
*/
private Integer nianling;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String dianziyouxiang;
/**
*
*/
private String touxiang;
/**
*
*/
private String jianjie;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date addtime;
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setBozhuhao(String bozhuhao) {
this.bozhuhao = bozhuhao;
}
/**
*
*/
public String getBozhuhao() {
return bozhuhao;
}
/**
*
*/
public void setBozhuming(String bozhuming) {
this.bozhuming = bozhuming;
}
/**
*
*/
public String getBozhuming() {
return bozhuming;
}
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setNianling(Integer nianling) {
this.nianling = nianling;
}
/**
*
*/
public Integer getNianling() {
return nianling;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setDianziyouxiang(String dianziyouxiang) {
this.dianziyouxiang = dianziyouxiang;
}
/**
*
*/
public String getDianziyouxiang() {
return dianziyouxiang;
}
/**
*
*/
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
/**
*
*/
public String getTouxiang() {
return touxiang;
}
/**
*
*/
public void setJianjie(String jianjie) {
this.jianjie = jianjie;
}
/**
*
*/
public String getJianjie() {
return jianjie;
}
}

@ -0,0 +1,294 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("bozhuwenzhang")
public class BozhuwenzhangEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public BozhuwenzhangEntity() {
}
public BozhuwenzhangEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String wenzhangbiaoti;
/**
*
*/
private String wenzhangfenlei;
/**
*
*/
private String tupian;
/**
*
*/
private String bozhuhao;
/**
*
*/
private String bozhuming;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date fabushijian;
/**
*
*/
private String jianshu;
/**
*
*/
private String wenzhangneirong;
/**
*
*/
private Integer thumbsupnum;
/**
*
*/
private Integer crazilynum;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date clicktime;
/**
*
*/
private Integer clicknum;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date addtime;
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setWenzhangbiaoti(String wenzhangbiaoti) {
this.wenzhangbiaoti = wenzhangbiaoti;
}
/**
*
*/
public String getWenzhangbiaoti() {
return wenzhangbiaoti;
}
/**
*
*/
public void setWenzhangfenlei(String wenzhangfenlei) {
this.wenzhangfenlei = wenzhangfenlei;
}
/**
*
*/
public String getWenzhangfenlei() {
return wenzhangfenlei;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setBozhuhao(String bozhuhao) {
this.bozhuhao = bozhuhao;
}
/**
*
*/
public String getBozhuhao() {
return bozhuhao;
}
/**
*
*/
public void setBozhuming(String bozhuming) {
this.bozhuming = bozhuming;
}
/**
*
*/
public String getBozhuming() {
return bozhuming;
}
/**
*
*/
public void setFabushijian(Date fabushijian) {
this.fabushijian = fabushijian;
}
/**
*
*/
public Date getFabushijian() {
return fabushijian;
}
/**
*
*/
public void setJianshu(String jianshu) {
this.jianshu = jianshu;
}
/**
*
*/
public String getJianshu() {
return jianshu;
}
/**
*
*/
public void setWenzhangneirong(String wenzhangneirong) {
this.wenzhangneirong = wenzhangneirong;
}
/**
*
*/
public String getWenzhangneirong() {
return wenzhangneirong;
}
/**
*
*/
public void setThumbsupnum(Integer thumbsupnum) {
this.thumbsupnum = thumbsupnum;
}
/**
*
*/
public Integer getThumbsupnum() {
return thumbsupnum;
}
/**
*
*/
public void setCrazilynum(Integer crazilynum) {
this.crazilynum = crazilynum;
}
/**
*
*/
public Integer getCrazilynum() {
return crazilynum;
}
/**
*
*/
public void setClicktime(Date clicktime) {
this.clicktime = clicktime;
}
/**
*
*/
public Date getClicktime() {
return clicktime;
}
/**
*
*/
public void setClicknum(Integer clicknum) {
this.clicknum = clicknum;
}
/**
*
*/
public Integer getClicknum() {
return clicknum;
}
}

@ -0,0 +1,53 @@
package com.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* :
*/
@TableName("config")
public class ConfigEntity implements Serializable{
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
/**
* key
*/
private String name;
/**
* value
*/
private String value;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

@ -0,0 +1,164 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("discussbozhuwenzhang")
public class DiscussbozhuwenzhangEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public DiscussbozhuwenzhangEntity() {
}
public DiscussbozhuwenzhangEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long refid;
/**
* id
*/
private Long userid;
/**
*
*/
private String nickname;
/**
*
*/
private String content;
/**
*
*/
private String reply;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date addtime;
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setNickname(String nickname) {
this.nickname = nickname;
}
/**
*
*/
public String getNickname() {
return nickname;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,52 @@
package com.entity;
/**
*
*/
public class EIException extends RuntimeException {
private static final long serialVersionUID = 1L;
private String msg;
private int code = 500;
public EIException(String msg) {
super(msg);
this.msg = msg;
}
public EIException(String msg, Throwable e) {
super(msg, e);
this.msg = msg;
}
public EIException(String msg, int code) {
super(msg);
this.msg = msg;
this.code = code;
}
public EIException(String msg, int code, Throwable e) {
super(msg, e);
this.msg = msg;
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}

@ -0,0 +1,146 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("news")
public class NewsEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public NewsEntity() {
}
public NewsEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String title;
/**
*
*/
private String introduction;
/**
*
*/
private String picture;
/**
*
*/
private String content;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date addtime;
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setTitle(String title) {
this.title = title;
}
/**
*
*/
public String getTitle() {
return title;
}
/**
*
*/
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
/**
*
*/
public String getIntroduction() {
return introduction;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
}

@ -0,0 +1,200 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("storeup")
public class StoreupEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public StoreupEntity() {
}
public StoreupEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId
private Long id;
/**
* id
*/
private Long userid;
/**
* id
*/
private Long refid;
/**
*
*/
private String tablename;
/**
*
*/
private String name;
/**
*
*/
private String picture;
/**
* (1:,21:,22:)
*/
private String type;
/**
*
*/
private String inteltype;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date addtime;
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
*
*/
public void setTablename(String tablename) {
this.tablename = tablename;
}
/**
*
*/
public String getTablename() {
return tablename;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
* (1:,21:,22:)
*/
public void setType(String type) {
this.type = type;
}
/**
* (1:,21:,22:)
*/
public String getType() {
return type;
}
/**
*
*/
public void setInteltype(String inteltype) {
this.inteltype = inteltype;
}
/**
*
*/
public String getInteltype() {
return inteltype;
}
}

@ -0,0 +1,132 @@
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")
public class TokenEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long id;
/**
* id
*/
private Long userid;
/**
*
*/
private String username;
/**
*
*/
private String tablename;
/**
*
*/
private String role;
/**
* token
*/
private String token;
/**
*
*/
private Date expiratedtime;
/**
*
*/
private Date addtime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserid() {
return userid;
}
public void setUserid(Long userid) {
this.userid = userid;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getToken() {
return token;
}
public String getTablename() {
return tablename;
}
public void setTablename(String tablename) {
this.tablename = tablename;
}
public void setToken(String token) {
this.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(Long userid, String username, String tablename,String role, String token, Date expiratedtime) {
super();
this.userid = userid;
this.username = username;
this.tablename = tablename;
this.role = role;
this.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")
public class UserEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Long 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 Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}

@ -0,0 +1,92 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("wenzhangfenlei")
public class WenzhangfenleiEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public WenzhangfenleiEntity() {
}
public WenzhangfenleiEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String wenzhangfenlei;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date addtime;
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setWenzhangfenlei(String wenzhangfenlei) {
this.wenzhangfenlei = wenzhangfenlei;
}
/**
*
*/
public String getWenzhangfenlei() {
return wenzhangfenlei;
}
}

@ -0,0 +1,182 @@
package com.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("yonghu")
public class YonghuEntity<T> implements Serializable {
private static final long serialVersionUID = 1L;
public YonghuEntity() {
}
public YonghuEntity(T t) {
try {
BeanUtils.copyProperties(this, t);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* id
*/
@TableId
private Long id;
/**
*
*/
private String yonghuming;
/**
*
*/
private String xingming;
/**
*
*/
private String mima;
/**
*
*/
private String xingbie;
/**
*
*/
private Integer nianling;
/**
*
*/
private String shoujihao;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date addtime;
public Date getAddtime() {
return addtime;
}
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
*/
public String getXingming() {
return xingming;
}
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setNianling(Integer nianling) {
this.nianling = nianling;
}
/**
*
*/
public Integer getNianling() {
return nianling;
}
/**
*
*/
public void setShoujihao(String shoujihao) {
this.shoujihao = shoujihao;
}
/**
*
*/
public String getShoujihao() {
return shoujihao;
}
}

@ -0,0 +1,202 @@
package com.entity.model;
import com.entity.BozhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class BozhuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String bozhuming;
/**
*
*/
private String mima;
/**
*
*/
private String xingbie;
/**
*
*/
private Integer nianling;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String dianziyouxiang;
/**
*
*/
private String touxiang;
/**
*
*/
private String jianjie;
/**
*
*/
public void setBozhuming(String bozhuming) {
this.bozhuming = bozhuming;
}
/**
*
*/
public String getBozhuming() {
return bozhuming;
}
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setNianling(Integer nianling) {
this.nianling = nianling;
}
/**
*
*/
public Integer getNianling() {
return nianling;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setDianziyouxiang(String dianziyouxiang) {
this.dianziyouxiang = dianziyouxiang;
}
/**
*
*/
public String getDianziyouxiang() {
return dianziyouxiang;
}
/**
*
*/
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
/**
*
*/
public String getTouxiang() {
return touxiang;
}
/**
*
*/
public void setJianjie(String jianjie) {
this.jianjie = jianjie;
}
/**
*
*/
public String getJianjie() {
return jianjie;
}
}

@ -0,0 +1,272 @@
package com.entity.model;
import com.entity.BozhuwenzhangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class BozhuwenzhangModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String wenzhangfenlei;
/**
*
*/
private String tupian;
/**
*
*/
private String bozhuhao;
/**
*
*/
private String bozhuming;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date fabushijian;
/**
*
*/
private String jianshu;
/**
*
*/
private String wenzhangneirong;
/**
*
*/
private Integer thumbsupnum;
/**
*
*/
private Integer crazilynum;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date clicktime;
/**
*
*/
private Integer clicknum;
/**
*
*/
public void setWenzhangfenlei(String wenzhangfenlei) {
this.wenzhangfenlei = wenzhangfenlei;
}
/**
*
*/
public String getWenzhangfenlei() {
return wenzhangfenlei;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setBozhuhao(String bozhuhao) {
this.bozhuhao = bozhuhao;
}
/**
*
*/
public String getBozhuhao() {
return bozhuhao;
}
/**
*
*/
public void setBozhuming(String bozhuming) {
this.bozhuming = bozhuming;
}
/**
*
*/
public String getBozhuming() {
return bozhuming;
}
/**
*
*/
public void setFabushijian(Date fabushijian) {
this.fabushijian = fabushijian;
}
/**
*
*/
public Date getFabushijian() {
return fabushijian;
}
/**
*
*/
public void setJianshu(String jianshu) {
this.jianshu = jianshu;
}
/**
*
*/
public String getJianshu() {
return jianshu;
}
/**
*
*/
public void setWenzhangneirong(String wenzhangneirong) {
this.wenzhangneirong = wenzhangneirong;
}
/**
*
*/
public String getWenzhangneirong() {
return wenzhangneirong;
}
/**
*
*/
public void setThumbsupnum(Integer thumbsupnum) {
this.thumbsupnum = thumbsupnum;
}
/**
*
*/
public Integer getThumbsupnum() {
return thumbsupnum;
}
/**
*
*/
public void setCrazilynum(Integer crazilynum) {
this.crazilynum = crazilynum;
}
/**
*
*/
public Integer getCrazilynum() {
return crazilynum;
}
/**
*
*/
public void setClicktime(Date clicktime) {
this.clicktime = clicktime;
}
/**
*
*/
public Date getClicktime() {
return clicktime;
}
/**
*
*/
public void setClicknum(Integer clicknum) {
this.clicknum = clicknum;
}
/**
*
*/
public Integer getClicknum() {
return clicknum;
}
}

@ -0,0 +1,114 @@
package com.entity.model;
import com.entity.DiscussbozhuwenzhangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class DiscussbozhuwenzhangModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long userid;
/**
*
*/
private String nickname;
/**
*
*/
private String content;
/**
*
*/
private String reply;
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setNickname(String nickname) {
this.nickname = nickname;
}
/**
*
*/
public String getNickname() {
return nickname;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,92 @@
package com.entity.model;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class NewsModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String introduction;
/**
*
*/
private String picture;
/**
*
*/
private String content;
/**
*
*/
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
/**
*
*/
public String getIntroduction() {
return introduction;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
}

@ -0,0 +1,158 @@
package com.entity.model;
import com.entity.StoreupEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class StoreupModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long refid;
/**
*
*/
private String tablename;
/**
*
*/
private String name;
/**
*
*/
private String picture;
/**
* (1:,21:,22:)
*/
private String type;
/**
*
*/
private String inteltype;
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
*
*/
public void setTablename(String tablename) {
this.tablename = tablename;
}
/**
*
*/
public String getTablename() {
return tablename;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
* (1:,21:,22:)
*/
public void setType(String type) {
this.type = type;
}
/**
* (1:,21:,22:)
*/
public String getType() {
return type;
}
/**
*
*/
public void setInteltype(String inteltype) {
this.inteltype = inteltype;
}
/**
*
*/
public String getInteltype() {
return inteltype;
}
}

@ -0,0 +1,26 @@
package com.entity.model;
import com.entity.WenzhangfenleiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class WenzhangfenleiModel implements Serializable {
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,136 @@
package com.entity.model;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class YonghuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String xingming;
/**
*
*/
private String mima;
/**
*
*/
private String xingbie;
/**
*
*/
private Integer nianling;
/**
*
*/
private String shoujihao;
/**
*
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
*/
public String getXingming() {
return xingming;
}
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setNianling(Integer nianling) {
this.nianling = nianling;
}
/**
*
*/
public Integer getNianling() {
return nianling;
}
/**
*
*/
public void setShoujihao(String shoujihao) {
this.shoujihao = shoujihao;
}
/**
*
*/
public String getShoujihao() {
return shoujihao;
}
}

@ -0,0 +1,36 @@
package com.entity.view;
import com.entity.BozhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("bozhu")
public class BozhuView extends BozhuEntity implements Serializable {
private static final long serialVersionUID = 1L;
public BozhuView(){
}
public BozhuView(BozhuEntity bozhuEntity){
try {
BeanUtils.copyProperties(this, bozhuEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,36 @@
package com.entity.view;
import com.entity.BozhuwenzhangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("bozhuwenzhang")
public class BozhuwenzhangView extends BozhuwenzhangEntity implements Serializable {
private static final long serialVersionUID = 1L;
public BozhuwenzhangView(){
}
public BozhuwenzhangView(BozhuwenzhangEntity bozhuwenzhangEntity){
try {
BeanUtils.copyProperties(this, bozhuwenzhangEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,36 @@
package com.entity.view;
import com.entity.DiscussbozhuwenzhangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("discussbozhuwenzhang")
public class DiscussbozhuwenzhangView extends DiscussbozhuwenzhangEntity implements Serializable {
private static final long serialVersionUID = 1L;
public DiscussbozhuwenzhangView(){
}
public DiscussbozhuwenzhangView(DiscussbozhuwenzhangEntity discussbozhuwenzhangEntity){
try {
BeanUtils.copyProperties(this, discussbozhuwenzhangEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,36 @@
package com.entity.view;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("news")
public class NewsView extends NewsEntity implements Serializable {
private static final long serialVersionUID = 1L;
public NewsView(){
}
public NewsView(NewsEntity newsEntity){
try {
BeanUtils.copyProperties(this, newsEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,36 @@
package com.entity.view;
import com.entity.StoreupEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("storeup")
public class StoreupView extends StoreupEntity implements Serializable {
private static final long serialVersionUID = 1L;
public StoreupView(){
}
public StoreupView(StoreupEntity storeupEntity){
try {
BeanUtils.copyProperties(this, storeupEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,36 @@
package com.entity.view;
import com.entity.WenzhangfenleiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("wenzhangfenlei")
public class WenzhangfenleiView extends WenzhangfenleiEntity implements Serializable {
private static final long serialVersionUID = 1L;
public WenzhangfenleiView(){
}
public WenzhangfenleiView(WenzhangfenleiEntity wenzhangfenleiEntity){
try {
BeanUtils.copyProperties(this, wenzhangfenleiEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,36 @@
package com.entity.view;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2022-03-29 01:13:41
*/
@TableName("yonghu")
public class YonghuView extends YonghuEntity implements Serializable {
private static final long serialVersionUID = 1L;
public YonghuView(){
}
public YonghuView(YonghuEntity yonghuEntity){
try {
BeanUtils.copyProperties(this, yonghuEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

@ -0,0 +1,201 @@
package com.entity.vo;
import com.entity.BozhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class BozhuVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String bozhuming;
/**
*
*/
private String mima;
/**
*
*/
private String xingbie;
/**
*
*/
private Integer nianling;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String dianziyouxiang;
/**
*
*/
private String touxiang;
/**
*
*/
private String jianjie;
/**
*
*/
public void setBozhuming(String bozhuming) {
this.bozhuming = bozhuming;
}
/**
*
*/
public String getBozhuming() {
return bozhuming;
}
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setNianling(Integer nianling) {
this.nianling = nianling;
}
/**
*
*/
public Integer getNianling() {
return nianling;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setDianziyouxiang(String dianziyouxiang) {
this.dianziyouxiang = dianziyouxiang;
}
/**
*
*/
public String getDianziyouxiang() {
return dianziyouxiang;
}
/**
*
*/
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
/**
*
*/
public String getTouxiang() {
return touxiang;
}
/**
*
*/
public void setJianjie(String jianjie) {
this.jianjie = jianjie;
}
/**
*
*/
public String getJianjie() {
return jianjie;
}
}

@ -0,0 +1,271 @@
package com.entity.vo;
import com.entity.BozhuwenzhangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class BozhuwenzhangVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String wenzhangfenlei;
/**
*
*/
private String tupian;
/**
*
*/
private String bozhuhao;
/**
*
*/
private String bozhuming;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date fabushijian;
/**
*
*/
private String jianshu;
/**
*
*/
private String wenzhangneirong;
/**
*
*/
private Integer thumbsupnum;
/**
*
*/
private Integer crazilynum;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date clicktime;
/**
*
*/
private Integer clicknum;
/**
*
*/
public void setWenzhangfenlei(String wenzhangfenlei) {
this.wenzhangfenlei = wenzhangfenlei;
}
/**
*
*/
public String getWenzhangfenlei() {
return wenzhangfenlei;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setBozhuhao(String bozhuhao) {
this.bozhuhao = bozhuhao;
}
/**
*
*/
public String getBozhuhao() {
return bozhuhao;
}
/**
*
*/
public void setBozhuming(String bozhuming) {
this.bozhuming = bozhuming;
}
/**
*
*/
public String getBozhuming() {
return bozhuming;
}
/**
*
*/
public void setFabushijian(Date fabushijian) {
this.fabushijian = fabushijian;
}
/**
*
*/
public Date getFabushijian() {
return fabushijian;
}
/**
*
*/
public void setJianshu(String jianshu) {
this.jianshu = jianshu;
}
/**
*
*/
public String getJianshu() {
return jianshu;
}
/**
*
*/
public void setWenzhangneirong(String wenzhangneirong) {
this.wenzhangneirong = wenzhangneirong;
}
/**
*
*/
public String getWenzhangneirong() {
return wenzhangneirong;
}
/**
*
*/
public void setThumbsupnum(Integer thumbsupnum) {
this.thumbsupnum = thumbsupnum;
}
/**
*
*/
public Integer getThumbsupnum() {
return thumbsupnum;
}
/**
*
*/
public void setCrazilynum(Integer crazilynum) {
this.crazilynum = crazilynum;
}
/**
*
*/
public Integer getCrazilynum() {
return crazilynum;
}
/**
*
*/
public void setClicktime(Date clicktime) {
this.clicktime = clicktime;
}
/**
*
*/
public Date getClicktime() {
return clicktime;
}
/**
*
*/
public void setClicknum(Integer clicknum) {
this.clicknum = clicknum;
}
/**
*
*/
public Integer getClicknum() {
return clicknum;
}
}

@ -0,0 +1,113 @@
package com.entity.vo;
import com.entity.DiscussbozhuwenzhangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class DiscussbozhuwenzhangVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long userid;
/**
*
*/
private String nickname;
/**
*
*/
private String content;
/**
*
*/
private String reply;
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setNickname(String nickname) {
this.nickname = nickname;
}
/**
*
*/
public String getNickname() {
return nickname;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,91 @@
package com.entity.vo;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class NewsVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String introduction;
/**
*
*/
private String picture;
/**
*
*/
private String content;
/**
*
*/
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
/**
*
*/
public String getIntroduction() {
return introduction;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
}

@ -0,0 +1,157 @@
package com.entity.vo;
import com.entity.StoreupEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class StoreupVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long refid;
/**
*
*/
private String tablename;
/**
*
*/
private String name;
/**
*
*/
private String picture;
/**
* (1:,21:,22:)
*/
private String type;
/**
*
*/
private String inteltype;
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
*
*/
public void setTablename(String tablename) {
this.tablename = tablename;
}
/**
*
*/
public String getTablename() {
return tablename;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
* (1:,21:,22:)
*/
public void setType(String type) {
this.type = type;
}
/**
* (1:,21:,22:)
*/
public String getType() {
return type;
}
/**
*
*/
public void setInteltype(String inteltype) {
this.inteltype = inteltype;
}
/**
*
*/
public String getInteltype() {
return inteltype;
}
}

@ -0,0 +1,25 @@
package com.entity.vo;
import com.entity.WenzhangfenleiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class WenzhangfenleiVO implements Serializable {
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,135 @@
package com.entity.vo;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public class YonghuVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String xingming;
/**
*
*/
private String mima;
/**
*
*/
private String xingbie;
/**
*
*/
private Integer nianling;
/**
*
*/
private String shoujihao;
/**
*
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
*/
public String getXingming() {
return xingming;
}
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setNianling(Integer nianling) {
this.nianling = nianling;
}
/**
*
*/
public Integer getNianling() {
return nianling;
}
/**
*
*/
public void setShoujihao(String shoujihao) {
this.shoujihao = shoujihao;
}
/**
*
*/
public String getShoujihao() {
return shoujihao;
}
}

@ -0,0 +1,95 @@
package com.interceptor;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.http.HttpStatus;
import com.annotation.IgnoreAuth;
import com.entity.EIException;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.R;
/**
* (Token)
*/
@Component
public class AuthorizationInterceptor implements HandlerInterceptor {
public static final String LOGIN_TOKEN_KEY = "Token";
@Autowired
private TokenService tokenService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//支持跨域请求
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
// 跨域时会首先发送一个OPTIONS请求这里我们给OPTIONS请求直接返回正常状态
if (request.getMethod().equals(RequestMethod.OPTIONS.name())) {
response.setStatus(HttpStatus.OK.value());
return false;
}
IgnoreAuth annotation;
if (handler instanceof HandlerMethod) {
annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
} else {
return true;
}
//从header中获取token
String token = request.getHeader(LOGIN_TOKEN_KEY);
/**
*
*/
if(annotation!=null) {
return true;
}
TokenEntity tokenEntity = null;
if(StringUtils.isNotBlank(token)) {
tokenEntity = tokenService.getTokenEntity(token);
}
if(tokenEntity != null) {
request.getSession().setAttribute("userId", tokenEntity.getUserid());
request.getSession().setAttribute("role", tokenEntity.getRole());
request.getSession().setAttribute("tableName", tokenEntity.getTablename());
request.getSession().setAttribute("username", tokenEntity.getUsername());
return true;
}
PrintWriter writer = null;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
try {
writer = response.getWriter();
writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
} finally {
if(writer != null){
writer.close();
}
}
// throw new EIException("请先登录", 401);
return false;
}
}

@ -0,0 +1,37 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.BozhuEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.BozhuVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.BozhuView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface BozhuService extends IService<BozhuEntity> {
PageUtils queryPage(Map<String, Object> params);
List<BozhuVO> selectListVO(Wrapper<BozhuEntity> wrapper);
BozhuVO selectVO(@Param("ew") Wrapper<BozhuEntity> wrapper);
List<BozhuView> selectListView(Wrapper<BozhuEntity> wrapper);
BozhuView selectView(@Param("ew") Wrapper<BozhuEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<BozhuEntity> wrapper);
}

@ -0,0 +1,37 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.BozhuwenzhangEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.BozhuwenzhangVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.BozhuwenzhangView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface BozhuwenzhangService extends IService<BozhuwenzhangEntity> {
PageUtils queryPage(Map<String, Object> params);
List<BozhuwenzhangVO> selectListVO(Wrapper<BozhuwenzhangEntity> wrapper);
BozhuwenzhangVO selectVO(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
List<BozhuwenzhangView> selectListView(Wrapper<BozhuwenzhangEntity> wrapper);
BozhuwenzhangView selectView(@Param("ew") Wrapper<BozhuwenzhangEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<BozhuwenzhangEntity> wrapper);
}

@ -0,0 +1,22 @@
package com.service;
import java.util.List;
import java.util.Map;
public interface CommonService {
List<String> getOption(Map<String, Object> params);
Map<String, Object> getFollowByOption(Map<String, Object> params);
void sh(Map<String, Object> params);
int remindCount(Map<String, Object> params);
Map<String, Object> selectCal(Map<String, Object> params);
List<Map<String, Object>> selectGroup(Map<String, Object> params);
List<Map<String, Object>> selectValue(Map<String, Object> params);
List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params);
}

@ -0,0 +1,17 @@
package com.service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.ConfigEntity;
import com.utils.PageUtils;
/**
*
*/
public interface ConfigService extends IService<ConfigEntity> {
PageUtils queryPage(Map<String, Object> params,Wrapper<ConfigEntity> wrapper);
}

@ -0,0 +1,37 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.DiscussbozhuwenzhangEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.DiscussbozhuwenzhangVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.DiscussbozhuwenzhangView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface DiscussbozhuwenzhangService extends IService<DiscussbozhuwenzhangEntity> {
PageUtils queryPage(Map<String, Object> params);
List<DiscussbozhuwenzhangVO> selectListVO(Wrapper<DiscussbozhuwenzhangEntity> wrapper);
DiscussbozhuwenzhangVO selectVO(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
List<DiscussbozhuwenzhangView> selectListView(Wrapper<DiscussbozhuwenzhangEntity> wrapper);
DiscussbozhuwenzhangView selectView(@Param("ew") Wrapper<DiscussbozhuwenzhangEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<DiscussbozhuwenzhangEntity> wrapper);
}

@ -0,0 +1,37 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.NewsEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.NewsVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.NewsView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface NewsService extends IService<NewsEntity> {
PageUtils queryPage(Map<String, Object> params);
List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper);
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
List<NewsView> selectListView(Wrapper<NewsEntity> wrapper);
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<NewsEntity> wrapper);
}

@ -0,0 +1,37 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.StoreupEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.StoreupVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.StoreupView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface StoreupService extends IService<StoreupEntity> {
PageUtils queryPage(Map<String, Object> params);
List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper);
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper);
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<StoreupEntity> wrapper);
}

@ -0,0 +1,26 @@
package com.service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.TokenEntity;
import com.utils.PageUtils;
/**
* token
*/
public interface TokenService extends IService<TokenEntity> {
PageUtils queryPage(Map<String, Object> params);
List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<TokenEntity> wrapper);
String generateToken(Long userid,String username,String tableName, String role);
TokenEntity getTokenEntity(String token);
}

@ -0,0 +1,25 @@
package com.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.entity.UserEntity;
import com.utils.PageUtils;
/**
*
*/
public interface UserService extends IService<UserEntity> {
PageUtils queryPage(Map<String, Object> params);
List<UserEntity> selectListView(Wrapper<UserEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<UserEntity> wrapper);
}

@ -0,0 +1,37 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.WenzhangfenleiEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.WenzhangfenleiVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.WenzhangfenleiView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface WenzhangfenleiService extends IService<WenzhangfenleiEntity> {
PageUtils queryPage(Map<String, Object> params);
List<WenzhangfenleiVO> selectListVO(Wrapper<WenzhangfenleiEntity> wrapper);
WenzhangfenleiVO selectVO(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
List<WenzhangfenleiView> selectListView(Wrapper<WenzhangfenleiEntity> wrapper);
WenzhangfenleiView selectView(@Param("ew") Wrapper<WenzhangfenleiEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<WenzhangfenleiEntity> wrapper);
}

@ -0,0 +1,37 @@
package com.service;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.YonghuEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.YonghuVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.YonghuView;
/**
*
*
* @author
* @email
* @date 2022-03-29 01:13:41
*/
public interface YonghuService extends IService<YonghuEntity> {
PageUtils queryPage(Map<String, Object> params);
List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper);
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper);
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
PageUtils queryPage(Map<String, Object> params,Wrapper<YonghuEntity> wrapper);
}

@ -0,0 +1,63 @@
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.BozhuDao;
import com.entity.BozhuEntity;
import com.service.BozhuService;
import com.entity.vo.BozhuVO;
import com.entity.view.BozhuView;
@Service("bozhuService")
public class BozhuServiceImpl extends ServiceImpl<BozhuDao, BozhuEntity> implements BozhuService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<BozhuEntity> page = this.selectPage(
new Query<BozhuEntity>(params).getPage(),
new EntityWrapper<BozhuEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<BozhuEntity> wrapper) {
Page<BozhuView> page =new Query<BozhuView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<BozhuVO> selectListVO(Wrapper<BozhuEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public BozhuVO selectVO(Wrapper<BozhuEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<BozhuView> selectListView(Wrapper<BozhuEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public BozhuView selectView(Wrapper<BozhuEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,63 @@
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.BozhuwenzhangDao;
import com.entity.BozhuwenzhangEntity;
import com.service.BozhuwenzhangService;
import com.entity.vo.BozhuwenzhangVO;
import com.entity.view.BozhuwenzhangView;
@Service("bozhuwenzhangService")
public class BozhuwenzhangServiceImpl extends ServiceImpl<BozhuwenzhangDao, BozhuwenzhangEntity> implements BozhuwenzhangService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<BozhuwenzhangEntity> page = this.selectPage(
new Query<BozhuwenzhangEntity>(params).getPage(),
new EntityWrapper<BozhuwenzhangEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<BozhuwenzhangEntity> wrapper) {
Page<BozhuwenzhangView> page =new Query<BozhuwenzhangView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<BozhuwenzhangVO> selectListVO(Wrapper<BozhuwenzhangEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public BozhuwenzhangVO selectVO(Wrapper<BozhuwenzhangEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<BozhuwenzhangView> selectListView(Wrapper<BozhuwenzhangEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public BozhuwenzhangView selectView(Wrapper<BozhuwenzhangEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,64 @@
package com.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dao.CommonDao;
import com.service.CommonService;
/**
*
*/
@Service("commonService")
public class CommonServiceImpl implements CommonService {
@Autowired
private CommonDao commonDao;
@Override
public List<String> getOption(Map<String, Object> params) {
return commonDao.getOption(params);
}
@Override
public Map<String, Object> getFollowByOption(Map<String, Object> params) {
return commonDao.getFollowByOption(params);
}
@Override
public void sh(Map<String, Object> params) {
commonDao.sh(params);
}
@Override
public int remindCount(Map<String, Object> params) {
return commonDao.remindCount(params);
}
@Override
public Map<String, Object> selectCal(Map<String, Object> params) {
return commonDao.selectCal(params);
}
@Override
public List<Map<String, Object>> selectGroup(Map<String, Object> params) {
return commonDao.selectGroup(params);
}
@Override
public List<Map<String, Object>> selectValue(Map<String, Object> params) {
return commonDao.selectValue(params);
}
@Override
public List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params) {
return commonDao.selectTimeStatValue(params);
}
}

@ -0,0 +1,33 @@
package com.service.impl;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.ConfigDao;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.Query;
/**
*
*/
@Service("configService")
public class ConfigServiceImpl extends ServiceImpl<ConfigDao, ConfigEntity> implements ConfigService {
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<ConfigEntity> wrapper) {
Page<ConfigEntity> page = this.selectPage(
new Query<ConfigEntity>(params).getPage(),
wrapper
);
return new PageUtils(page);
}
}

@ -0,0 +1,63 @@
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.DiscussbozhuwenzhangDao;
import com.entity.DiscussbozhuwenzhangEntity;
import com.service.DiscussbozhuwenzhangService;
import com.entity.vo.DiscussbozhuwenzhangVO;
import com.entity.view.DiscussbozhuwenzhangView;
@Service("discussbozhuwenzhangService")
public class DiscussbozhuwenzhangServiceImpl extends ServiceImpl<DiscussbozhuwenzhangDao, DiscussbozhuwenzhangEntity> implements DiscussbozhuwenzhangService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<DiscussbozhuwenzhangEntity> page = this.selectPage(
new Query<DiscussbozhuwenzhangEntity>(params).getPage(),
new EntityWrapper<DiscussbozhuwenzhangEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
Page<DiscussbozhuwenzhangView> page =new Query<DiscussbozhuwenzhangView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<DiscussbozhuwenzhangVO> selectListVO(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public DiscussbozhuwenzhangVO selectVO(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<DiscussbozhuwenzhangView> selectListView(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public DiscussbozhuwenzhangView selectView(Wrapper<DiscussbozhuwenzhangEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,63 @@
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.NewsDao;
import com.entity.NewsEntity;
import com.service.NewsService;
import com.entity.vo.NewsVO;
import com.entity.view.NewsView;
@Service("newsService")
public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements NewsService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<NewsEntity> page = this.selectPage(
new Query<NewsEntity>(params).getPage(),
new EntityWrapper<NewsEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<NewsEntity> wrapper) {
Page<NewsView> page =new Query<NewsView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<NewsVO> selectListVO(Wrapper<NewsEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public NewsVO selectVO(Wrapper<NewsEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<NewsView> selectListView(Wrapper<NewsEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public NewsView selectView(Wrapper<NewsEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,63 @@
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.StoreupDao;
import com.entity.StoreupEntity;
import com.service.StoreupService;
import com.entity.vo.StoreupVO;
import com.entity.view.StoreupView;
@Service("storeupService")
public class StoreupServiceImpl extends ServiceImpl<StoreupDao, StoreupEntity> implements StoreupService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<StoreupEntity> page = this.selectPage(
new Query<StoreupEntity>(params).getPage(),
new EntityWrapper<StoreupEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<StoreupEntity> wrapper) {
Page<StoreupView> page =new Query<StoreupView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<StoreupVO> selectListVO(Wrapper<StoreupEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public StoreupVO selectVO(Wrapper<StoreupEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<StoreupView> selectListView(Wrapper<StoreupEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public StoreupView selectView(Wrapper<StoreupEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,79 @@
package com.service.impl;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.TokenDao;
import com.entity.TokenEntity;
import com.entity.TokenEntity;
import com.service.TokenService;
import com.utils.CommonUtil;
import com.utils.PageUtils;
import com.utils.Query;
/**
* token
*/
@Service("tokenService")
public class TokenServiceImpl extends ServiceImpl<TokenDao, TokenEntity> implements TokenService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<TokenEntity> page = this.selectPage(
new Query<TokenEntity>(params).getPage(),
new EntityWrapper<TokenEntity>()
);
return new PageUtils(page);
}
@Override
public List<TokenEntity> selectListView(Wrapper<TokenEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public PageUtils queryPage(Map<String, Object> params,
Wrapper<TokenEntity> wrapper) {
Page<TokenEntity> page =new Query<TokenEntity>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public String generateToken(Long userid,String username, String tableName, String role) {
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("userid", userid).eq("role", role));
String token = CommonUtil.getRandomString(32);
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.HOUR_OF_DAY, 1);
if(tokenEntity!=null) {
tokenEntity.setToken(token);
tokenEntity.setExpiratedtime(cal.getTime());
this.updateById(tokenEntity);
} else {
this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime()));
}
return token;
}
@Override
public TokenEntity getTokenEntity(String token) {
TokenEntity tokenEntity = this.selectOne(new EntityWrapper<TokenEntity>().eq("token", token));
if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime()<new Date().getTime()) {
return null;
}
return tokenEntity;
}
}

@ -0,0 +1,49 @@
package com.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.UserDao;
import com.entity.UserEntity;
import com.service.UserService;
import com.utils.PageUtils;
import com.utils.Query;
/**
*
*/
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<UserEntity> page = this.selectPage(
new Query<UserEntity>(params).getPage(),
new EntityWrapper<UserEntity>()
);
return new PageUtils(page);
}
@Override
public List<UserEntity> selectListView(Wrapper<UserEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public PageUtils queryPage(Map<String, Object> params,
Wrapper<UserEntity> wrapper) {
Page<UserEntity> page =new Query<UserEntity>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
}

@ -0,0 +1,63 @@
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.WenzhangfenleiDao;
import com.entity.WenzhangfenleiEntity;
import com.service.WenzhangfenleiService;
import com.entity.vo.WenzhangfenleiVO;
import com.entity.view.WenzhangfenleiView;
@Service("wenzhangfenleiService")
public class WenzhangfenleiServiceImpl extends ServiceImpl<WenzhangfenleiDao, WenzhangfenleiEntity> implements WenzhangfenleiService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<WenzhangfenleiEntity> page = this.selectPage(
new Query<WenzhangfenleiEntity>(params).getPage(),
new EntityWrapper<WenzhangfenleiEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<WenzhangfenleiEntity> wrapper) {
Page<WenzhangfenleiView> page =new Query<WenzhangfenleiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<WenzhangfenleiVO> selectListVO(Wrapper<WenzhangfenleiEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public WenzhangfenleiVO selectVO(Wrapper<WenzhangfenleiEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<WenzhangfenleiView> selectListView(Wrapper<WenzhangfenleiEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public WenzhangfenleiView selectView(Wrapper<WenzhangfenleiEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,63 @@
package com.service.impl;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;
import com.dao.YonghuDao;
import com.entity.YonghuEntity;
import com.service.YonghuService;
import com.entity.vo.YonghuVO;
import com.entity.view.YonghuView;
@Service("yonghuService")
public class YonghuServiceImpl extends ServiceImpl<YonghuDao, YonghuEntity> implements YonghuService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
Page<YonghuEntity> page = this.selectPage(
new Query<YonghuEntity>(params).getPage(),
new EntityWrapper<YonghuEntity>()
);
return new PageUtils(page);
}
@Override
public PageUtils queryPage(Map<String, Object> params, Wrapper<YonghuEntity> wrapper) {
Page<YonghuView> page =new Query<YonghuView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,wrapper));
PageUtils pageUtil = new PageUtils(page);
return pageUtil;
}
@Override
public List<YonghuVO> selectListVO(Wrapper<YonghuEntity> wrapper) {
return baseMapper.selectListVO(wrapper);
}
@Override
public YonghuVO selectVO(Wrapper<YonghuEntity> wrapper) {
return baseMapper.selectVO(wrapper);
}
@Override
public List<YonghuView> selectListView(Wrapper<YonghuEntity> wrapper) {
return baseMapper.selectListView(wrapper);
}
@Override
public YonghuView selectView(Wrapper<YonghuEntity> wrapper) {
return baseMapper.selectView(wrapper);
}
}

@ -0,0 +1,96 @@
package com.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONObject;
/**
* :
*/
public class BaiduUtil {
/**
*
* @param lon
* @param lat
* @param coordtype
* @return
*/
public static Map<String, String> getCityByLonLat(String key, String lng, String lat) {
String location = lat + "," + lng;
try {
//拼装url
String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location;
String result = HttpClientUtils.doGet(url);
JSONObject o = new JSONObject(result);
Map<String, String> area = new HashMap<>();
area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province"));
area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city"));
area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district"));
area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street"));
return area;
}catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* API访token
* token.
* @param ak - API Key
* @param sk - Securet Key
* @return assess_token
*/
public static String getAuth(String ak, String sk) {
// 获取token地址
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
String getAccessTokenUrl = authHost
// 1. grant_type为固定参数
+ "grant_type=client_credentials"
// 2. 官网获取的 API Key
+ "&client_id=" + ak
// 3. 官网获取的 Secret Key
+ "&client_secret=" + sk;
try {
URL realUrl = new URL(getAccessTokenUrl);
// 打开和URL之间的连接
HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
connection.setRequestMethod("GET");
connection.connect();
// 获取所有响应头字段
Map<String, List<String>> map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.err.println(key + "--->" + map.get(key));
}
// 定义 BufferedReader输入流来读取URL的响应
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String result = "";
String line;
while ((line = in.readLine()) != null) {
result += line;
}
/**
*
*/
System.err.println("result:" + result);
org.json.JSONObject jsonObject = new org.json.JSONObject(result);
String access_token = jsonObject.getString("access_token");
return access_token;
} catch (Exception e) {
System.err.printf("获取token失败");
e.printStackTrace(System.err);
}
return null;
}
}

@ -0,0 +1,75 @@
package com.utils;
import java.util.Random;
import org.springframework.stereotype.Component;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
import java.text.DecimalFormat;
import java.util.Objects;
@Component
public class CommonUtil {
/**
*
*
* @param num
* @return
*/
public static String getRandomString(Integer num) {
String base = "abcdefghijklmnopqrstuvwxyz0123456789";
Random random = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < num; i++) {
int number = random.nextInt(base.length());
sb.append(base.charAt(number));
}
return sb.toString();
}
/**
*
*
* @param num
* @return
*/
public static String getRandomNumber(Integer num) {
String base = "0123456789";
Random random = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < num; i++) {
int number = random.nextInt(base.length());
sb.append(base.charAt(number));
}
return sb.toString();
}
public static String getCellValue(Cell cell) {
String resultValue = "";
// 判空
if (Objects.isNull(cell)) {
return resultValue;
}
// 拿到单元格类型
int cellType = cell.getCellType();
switch (cellType) {
// 字符串类型
case Cell.CELL_TYPE_STRING:
resultValue = StringUtils.isEmpty(cell.getStringCellValue()) ? "" : cell.getStringCellValue().trim();
break;
// 布尔类型
case Cell.CELL_TYPE_BOOLEAN:
resultValue = String.valueOf(cell.getBooleanCellValue());
break;
// 数值类型
case Cell.CELL_TYPE_NUMERIC:
resultValue = new DecimalFormat("#.######").format(cell.getNumericCellValue());
break;
// 取空串
default:
break;
}
return resultValue;
}
}

@ -0,0 +1,27 @@
package com.utils;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* :
*/
public class FileUtil {
public static byte[] FileToByte(File file) throws IOException {
// 将数据转为流
@SuppressWarnings("resource")
InputStream content = new FileInputStream(file);
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100];
int rc = 0;
while ((rc = content.read(buff, 0, 100)) > 0) {
swapStream.write(buff, 0, rc);
}
// 获得二进制数组
return swapStream.toByteArray();
}
}

@ -0,0 +1,42 @@
package com.utils;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* HttpClient
*/
public class HttpClientUtils {
/**
* @param uri
* @return String
* @description get
* @author: long.he01
*/
public static String doGet(String uri) {
StringBuilder result = new StringBuilder();
try {
String res = "";
URL url = new URL(uri);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line;
while ((line = in.readLine()) != null) {
res += line+"\n";
}
in.close();
return res;
}catch (Exception e) {
e.printStackTrace();
return null;
}
}
}

@ -0,0 +1,54 @@
package com.utils;
public class JQPageInfo{
private Integer page;
private Integer limit;
private String sidx;
private String order;
private Integer offset;
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public String getSidx() {
return sidx;
}
public void setSidx(String sidx) {
this.sidx = sidx;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
public Integer getOffset() {
return offset;
}
public void setOffset(Integer offset) {
this.offset = offset;
}
}

@ -0,0 +1,19 @@
package com.utils;
import cn.hutool.crypto.digest.DigestUtil;
public class MD5Util {
/**
* @param text
* @param key
* @return
*/
// 带秘钥加密
public static String md5(String text) {
// 加密后的字符串
String md5str = DigestUtil.md5Hex(text);
return md5str;
}
}

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

Loading…
Cancel
Save