框架拆分
This commit is contained in:
@@ -7,6 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import java.net.InetAddress;
|
||||
@@ -16,6 +17,7 @@ import java.util.Optional;
|
||||
* 程序启动器
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@ComponentScan(basePackages = {"com.zyplayer.doc.manage", "com.zyplayer.doc.data"})
|
||||
public class Application extends SpringBootServletInitializer {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(Application.class);
|
||||
|
||||
@@ -1,141 +1,141 @@
|
||||
package com.zyplayer.doc.manage.framework.config;
|
||||
|
||||
import com.atomikos.icatch.jta.UserTransactionImp;
|
||||
import com.atomikos.icatch.jta.UserTransactionManager;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||
import com.zyplayer.doc.manage.repository.support.interceptor.SqlLogInterceptor;
|
||||
import org.apache.ibatis.plugin.Interceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.transaction.jta.JtaTransactionManager;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import javax.transaction.TransactionManager;
|
||||
import javax.transaction.UserTransaction;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* mybatis plus数据库配置
|
||||
*/
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* sql日志
|
||||
**/
|
||||
private static final SqlLogInterceptor SQL_LOG_INTERCEPTOR;
|
||||
|
||||
static {
|
||||
SQL_LOG_INTERCEPTOR = new SqlLogInterceptor();
|
||||
Properties properties = new Properties();
|
||||
SQL_LOG_INTERCEPTOR.setProperties(properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分布式事务配置
|
||||
*/
|
||||
@Configuration
|
||||
static class JTATransactionManagerConfig {
|
||||
|
||||
@Bean(name = "userTransaction")
|
||||
public UserTransaction userTransaction() throws Throwable {
|
||||
UserTransactionImp userTransactionImp = new UserTransactionImp();
|
||||
userTransactionImp.setTransactionTimeout(300);
|
||||
return userTransactionImp;
|
||||
}
|
||||
|
||||
@Bean(name = "atomikosTransactionManager")
|
||||
public TransactionManager atomikosTransactionManager() {
|
||||
UserTransactionManager userTransactionManager = new UserTransactionManager();
|
||||
userTransactionManager.setForceShutdown(true);
|
||||
return userTransactionManager;
|
||||
}
|
||||
|
||||
@Bean(name = "transactionManager")
|
||||
public PlatformTransactionManager transactionManager() throws Throwable {
|
||||
UserTransaction userTransaction = userTransaction();
|
||||
TransactionManager atomikosTransactionManager = atomikosTransactionManager();
|
||||
|
||||
JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(userTransaction, atomikosTransactionManager);
|
||||
jtaTransactionManager.setAllowCustomIsolationLevels(true);
|
||||
jtaTransactionManager.setGlobalRollbackOnParticipationFailure(true);
|
||||
jtaTransactionManager.setDefaultTimeout(30);
|
||||
|
||||
return jtaTransactionManager;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库配置
|
||||
*/
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@MapperScan(value = "com.zyplayer.doc.manage.repository.manage.mapper", sqlSessionFactoryRef = "manageSqlSessionFactory")
|
||||
static class ManageMybatisDbConfig {
|
||||
|
||||
@Value("${zyplayer.doc.manage.datasource.driverClassName}")
|
||||
private String driverClassName;
|
||||
@Value("${zyplayer.doc.manage.datasource.url}")
|
||||
private String url;
|
||||
@Value("${zyplayer.doc.manage.datasource.username}")
|
||||
private String username;
|
||||
@Value("${zyplayer.doc.manage.datasource.password}")
|
||||
private String password;
|
||||
|
||||
@Bean(name = "manageDatasource")
|
||||
public DataSource manageDatasource() {
|
||||
Properties xaProperties = new Properties();
|
||||
xaProperties.setProperty("driverClassName", driverClassName);
|
||||
xaProperties.setProperty("url", url);
|
||||
xaProperties.setProperty("username", username);
|
||||
xaProperties.setProperty("password", password);
|
||||
xaProperties.setProperty("maxActive", "500");
|
||||
xaProperties.setProperty("testOnBorrow", "true");
|
||||
xaProperties.setProperty("testWhileIdle", "true");
|
||||
xaProperties.setProperty("validationQuery", "select 'x'");
|
||||
|
||||
AtomikosDataSourceBean xaDataSource = new AtomikosDataSourceBean();
|
||||
xaDataSource.setXaProperties(xaProperties);
|
||||
xaDataSource.setXaDataSourceClassName("com.alibaba.druid.pool.xa.DruidXADataSource");
|
||||
xaDataSource.setUniqueResourceName("manageDatasource");
|
||||
xaDataSource.setMaxPoolSize(500);
|
||||
xaDataSource.setMinPoolSize(1);
|
||||
xaDataSource.setMaxLifetime(60);
|
||||
return xaDataSource;
|
||||
}
|
||||
|
||||
@Bean(name = "manageSqlSessionFactory")
|
||||
public MybatisSqlSessionFactoryBean manageSqlSessionFactory() throws Exception {
|
||||
MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
|
||||
sqlSessionFactoryBean.setDataSource(manageDatasource());
|
||||
sqlSessionFactoryBean.setPlugins(new Interceptor[]{SQL_LOG_INTERCEPTOR});
|
||||
|
||||
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
sqlSessionFactoryBean.setMapperLocations(resolver.getResources("classpath:/mapper/manage/*Mapper.xml"));
|
||||
return sqlSessionFactoryBean;
|
||||
}
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PerformanceInterceptor performanceInterceptor() {
|
||||
PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
|
||||
/* <!-- SQL 执行性能分析,开发环境使用,线上不推荐。 maxTime 指的是 sql 最大执行时长 --> */
|
||||
performanceInterceptor.setMaxTime(1000);
|
||||
/* <!--SQL是否格式化 默认false--> */
|
||||
performanceInterceptor.setFormat(true);
|
||||
return performanceInterceptor;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
return new PaginationInterceptor();
|
||||
}
|
||||
}
|
||||
//package com.zyplayer.doc.manage.framework.config;
|
||||
//
|
||||
//import com.atomikos.icatch.jta.UserTransactionImp;
|
||||
//import com.atomikos.icatch.jta.UserTransactionManager;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
|
||||
//import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||
//import com.zyplayer.doc.data.repository.support.interceptor.SqlLogInterceptor;
|
||||
//import org.apache.ibatis.plugin.Interceptor;
|
||||
//import org.mybatis.spring.annotation.MapperScan;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
//import org.springframework.transaction.PlatformTransactionManager;
|
||||
//import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
//import org.springframework.transaction.jta.JtaTransactionManager;
|
||||
//
|
||||
//import javax.sql.DataSource;
|
||||
//import javax.transaction.TransactionManager;
|
||||
//import javax.transaction.UserTransaction;
|
||||
//import java.util.Properties;
|
||||
//
|
||||
///**
|
||||
// * mybatis plus数据库配置
|
||||
// */
|
||||
////@Configuration
|
||||
//public class MybatisPlusConfig {
|
||||
//
|
||||
// /**
|
||||
// * sql日志
|
||||
// **/
|
||||
// private static final SqlLogInterceptor SQL_LOG_INTERCEPTOR;
|
||||
//
|
||||
// static {
|
||||
// SQL_LOG_INTERCEPTOR = new SqlLogInterceptor();
|
||||
// Properties properties = new Properties();
|
||||
// SQL_LOG_INTERCEPTOR.setProperties(properties);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 分布式事务配置
|
||||
// */
|
||||
// @Configuration
|
||||
// static class JTATransactionManagerConfig {
|
||||
//
|
||||
// @Bean(name = "userTransaction")
|
||||
// public UserTransaction userTransaction() throws Throwable {
|
||||
// UserTransactionImp userTransactionImp = new UserTransactionImp();
|
||||
// userTransactionImp.setTransactionTimeout(300);
|
||||
// return userTransactionImp;
|
||||
// }
|
||||
//
|
||||
// @Bean(name = "atomikosTransactionManager")
|
||||
// public TransactionManager atomikosTransactionManager() {
|
||||
// UserTransactionManager userTransactionManager = new UserTransactionManager();
|
||||
// userTransactionManager.setForceShutdown(true);
|
||||
// return userTransactionManager;
|
||||
// }
|
||||
//
|
||||
// @Bean(name = "transactionManager")
|
||||
// public PlatformTransactionManager transactionManager() throws Throwable {
|
||||
// UserTransaction userTransaction = userTransaction();
|
||||
// TransactionManager atomikosTransactionManager = atomikosTransactionManager();
|
||||
//
|
||||
// JtaTransactionManager jtaTransactionManager = new JtaTransactionManager(userTransaction, atomikosTransactionManager);
|
||||
// jtaTransactionManager.setAllowCustomIsolationLevels(true);
|
||||
// jtaTransactionManager.setGlobalRollbackOnParticipationFailure(true);
|
||||
// jtaTransactionManager.setDefaultTimeout(30);
|
||||
//
|
||||
// return jtaTransactionManager;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 数据库配置
|
||||
// */
|
||||
// @Configuration
|
||||
// @EnableTransactionManagement
|
||||
// @MapperScan(value = "com.zyplayer.doc.data.repository.manage.mapper", sqlSessionFactoryRef = "manageSqlSessionFactory")
|
||||
// static class ManageMybatisDbConfig {
|
||||
//
|
||||
// @Value("${zyplayer.doc.manage.datasource.driverClassName}")
|
||||
// private String driverClassName;
|
||||
// @Value("${zyplayer.doc.manage.datasource.url}")
|
||||
// private String url;
|
||||
// @Value("${zyplayer.doc.manage.datasource.username}")
|
||||
// private String username;
|
||||
// @Value("${zyplayer.doc.manage.datasource.password}")
|
||||
// private String password;
|
||||
//
|
||||
// @Bean(name = "manageDatasource")
|
||||
// public DataSource manageDatasource() {
|
||||
// Properties xaProperties = new Properties();
|
||||
// xaProperties.setProperty("driverClassName", driverClassName);
|
||||
// xaProperties.setProperty("url", url);
|
||||
// xaProperties.setProperty("username", username);
|
||||
// xaProperties.setProperty("password", password);
|
||||
// xaProperties.setProperty("maxActive", "500");
|
||||
// xaProperties.setProperty("testOnBorrow", "true");
|
||||
// xaProperties.setProperty("testWhileIdle", "true");
|
||||
// xaProperties.setProperty("validationQuery", "select 'x'");
|
||||
//
|
||||
// AtomikosDataSourceBean xaDataSource = new AtomikosDataSourceBean();
|
||||
// xaDataSource.setXaProperties(xaProperties);
|
||||
// xaDataSource.setXaDataSourceClassName("com.alibaba.druid.pool.xa.DruidXADataSource");
|
||||
// xaDataSource.setUniqueResourceName("manageDatasource");
|
||||
// xaDataSource.setMaxPoolSize(500);
|
||||
// xaDataSource.setMinPoolSize(1);
|
||||
// xaDataSource.setMaxLifetime(60);
|
||||
// return xaDataSource;
|
||||
// }
|
||||
//
|
||||
// @Bean(name = "manageSqlSessionFactory")
|
||||
// public MybatisSqlSessionFactoryBean manageSqlSessionFactory() throws Exception {
|
||||
// MybatisSqlSessionFactoryBean sqlSessionFactoryBean = new MybatisSqlSessionFactoryBean();
|
||||
// sqlSessionFactoryBean.setDataSource(manageDatasource());
|
||||
// sqlSessionFactoryBean.setPlugins(new Interceptor[]{SQL_LOG_INTERCEPTOR});
|
||||
//
|
||||
// PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
// sqlSessionFactoryBean.setMapperLocations(resolver.getResources("classpath:/mapper/manage/*Mapper.xml"));
|
||||
// return sqlSessionFactoryBean;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// public PerformanceInterceptor performanceInterceptor() {
|
||||
// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
|
||||
// /* <!-- SQL 执行性能分析,开发环境使用,线上不推荐。 maxTime 指的是 sql 最大执行时长 --> */
|
||||
// performanceInterceptor.setMaxTime(1000);
|
||||
// /* <!--SQL是否格式化 默认false--> */
|
||||
// performanceInterceptor.setFormat(true);
|
||||
// return performanceInterceptor;
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// public PaginationInterceptor paginationInterceptor() {
|
||||
// return new PaginationInterceptor();
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.zyplayer.doc.dubbo.framework.service.MgDubboStorage;
|
||||
import com.zyplayer.doc.dubbo.framework.service.MgDubboStorageService;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.ZyplayerStorage;
|
||||
import com.zyplayer.doc.manage.service.manage.ZyplayerStorageService;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ZyplayerStorage;
|
||||
import com.zyplayer.doc.data.service.manage.ZyplayerStorageService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.zyplayer.doc.manage.framework.config.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.ZyplayerStorage;
|
||||
import com.zyplayer.doc.manage.service.manage.ZyplayerStorageService;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.ZyplayerStorage;
|
||||
import com.zyplayer.doc.data.service.manage.ZyplayerStorageService;
|
||||
import com.zyplayer.doc.swagger.framework.service.MgStorage;
|
||||
import com.zyplayer.doc.swagger.framework.service.MgStorageService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.zyplayer.doc.manage.framework.config.security;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserInfo;
|
||||
import com.zyplayer.doc.data.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.data.service.manage.UserAuthService;
|
||||
import com.zyplayer.doc.data.service.manage.UserInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
@@ -13,13 +16,10 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.UserInfo;
|
||||
import com.zyplayer.doc.manage.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.manage.service.manage.UserAuthService;
|
||||
import com.zyplayer.doc.manage.service.manage.UserInfoService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class DocDetailsServiceImpl implements UserDetailsService {
|
||||
@@ -55,4 +55,4 @@ public class DocDetailsServiceImpl implements UserDetailsService {
|
||||
return userDetails;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
package com.zyplayer.doc.manage.framework.config.security;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
public class DocUserDetails implements UserDetails {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long userId;
|
||||
private String username;
|
||||
private String password;
|
||||
private boolean enabled;
|
||||
private Collection<? extends GrantedAuthority> authorities;
|
||||
|
||||
public DocUserDetails(Long userId, String username, String password, boolean enabled) {
|
||||
super();
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public DocUserDetails(Long userId, String username, String password, boolean enabled,
|
||||
Collection<? extends GrantedAuthority> authorities) {
|
||||
super();
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.enabled = enabled;
|
||||
this.authorities = authorities;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return authorities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MyUserDetails [userId=" + userId + ", username=" + username + ", password=" + password + ", enabled="
|
||||
+ enabled + ", authorities=" + authorities + "]";
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.zyplayer.doc.manage.framework.config.security;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
|
||||
/**
|
||||
* 用户工具类
|
||||
*/
|
||||
public class DocUserUtil {
|
||||
|
||||
/**
|
||||
* 获取当前用户
|
||||
* @return
|
||||
*/
|
||||
public static DocUserDetails getCurrentUser() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
Object principal = null;
|
||||
if (authentication != null) {
|
||||
principal = authentication.getPrincipal();
|
||||
}
|
||||
if (principal != null && principal instanceof DocUserDetails) {
|
||||
return (DocUserDetails) principal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,19 @@
|
||||
package com.zyplayer.doc.manage.web.manage;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.data.service.manage.AuthInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.manage.framework.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.manage.framework.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.manage.service.manage.AuthInfoService;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/auth/info")
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
package com.zyplayer.doc.manage.web.manage;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.data.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.data.service.manage.UserAuthService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.manage.framework.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.manage.framework.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.manage.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.manage.service.manage.UserAuthService;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/auth")
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.zyplayer.doc.manage.web.manage;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.manage.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.manage.service.manage.UserAuthService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.data.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.data.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.AuthInfo;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserAuth;
|
||||
import com.zyplayer.doc.data.repository.manage.entity.UserInfo;
|
||||
import com.zyplayer.doc.data.service.manage.AuthInfoService;
|
||||
import com.zyplayer.doc.data.service.manage.UserAuthService;
|
||||
import com.zyplayer.doc.data.service.manage.UserInfoService;
|
||||
import com.zyplayer.doc.manage.web.manage.vo.AuthInfoVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.dozer.Mapper;
|
||||
@@ -18,13 +21,9 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.zyplayer.doc.core.json.DocResponseJson;
|
||||
import com.zyplayer.doc.core.json.ResponseJson;
|
||||
import com.zyplayer.doc.manage.framework.config.security.DocUserDetails;
|
||||
import com.zyplayer.doc.manage.framework.config.security.DocUserUtil;
|
||||
import com.zyplayer.doc.manage.repository.manage.entity.UserInfo;
|
||||
import com.zyplayer.doc.manage.service.manage.UserInfoService;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/user/info")
|
||||
@@ -58,7 +57,7 @@ public class UserInfoController {
|
||||
public ResponseJson<Object> authList(String userIds) {
|
||||
List<AuthInfo> authList = authInfoService.list();
|
||||
QueryWrapper<UserAuth> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("user_id", userIds.split(","));
|
||||
queryWrapper.in("user_id", new Object[]{userIds.split(",")});
|
||||
queryWrapper.eq("del_flag", 0);
|
||||
List<UserAuth> userAuths = userAuthService.list(queryWrapper);
|
||||
Map<Long, UserAuth> userAuthMap = userAuths.stream().collect(Collectors.toMap(UserAuth::getAuthId, Function.identity(), (val1, val2) -> val1));
|
||||
@@ -74,8 +73,8 @@ public class UserInfoController {
|
||||
|
||||
@PostMapping("/auth/update")
|
||||
public ResponseJson<Object> updateAuth(String userIds, String authIds) {
|
||||
List<Long> userIdsList = Arrays.asList(userIds.split(",")).stream().collect(Collectors.mapping(val -> Long.valueOf(val), Collectors.toList()));
|
||||
List<Long> authIdsList = Arrays.asList(authIds.split(",")).stream().collect(Collectors.mapping(val -> Long.valueOf(val), Collectors.toList()));
|
||||
List<Long> userIdsList = Arrays.stream(userIds.split(",")).map(Long::valueOf).collect(Collectors.toList());
|
||||
List<Long> authIdsList = Arrays.stream(authIds.split(",")).map(Long::valueOf).collect(Collectors.toList());
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
|
||||
UserAuth userAuthUp = new UserAuth();
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.zyplayer.doc.manage.repository.manage.mapper.ZyplayerStorageMapper;
|
||||
import com.zyplayer.doc.data.repository.manage.mapper.ZyplayerStorageMapper;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/zyplayer/storage")
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zyplayer.doc.manage.repository.manage.mapper.AuthInfoMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zyplayer.doc.manage.repository.manage.mapper.UserAuthMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zyplayer.doc.manage.repository.manage.mapper.UserInfoMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zyplayer.doc.manage.repository.manage.mapper.ZyplayerStorageMapper">
|
||||
|
||||
<select id="selectTop" resultType="java.lang.Integer">
|
||||
select 10
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : 127.0.0.1
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50724
|
||||
Source Host : 127.0.0.1:3306
|
||||
Source Schema : zyplayer_doc_manage
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50724
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 26/02/2019 20:41:51
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for auth_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `auth_info`;
|
||||
CREATE TABLE `auth_info` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`auth_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限名',
|
||||
`auth_desc` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '权限说明',
|
||||
`can_edit` tinyint(4) NULL DEFAULT 1 COMMENT '是否可编辑 0=否 1=是',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
|
||||
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '权限信息表' ROW_FORMAT = Compact;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of auth_info
|
||||
-- ----------------------------
|
||||
INSERT INTO `auth_info` VALUES (1, 'DOC_ALL', '文档查看权', 0, 1, '2018-12-01 11:40:42');
|
||||
INSERT INTO `auth_info` VALUES (2, 'AUTH_MANAGE', '权限管理权', 0, 1, '2018-12-01 11:40:42');
|
||||
INSERT INTO `auth_info` VALUES (3, 'AUTH_ASSIGN', '权限分配权', 0, 1, '2018-12-01 11:40:42');
|
||||
INSERT INTO `auth_info` VALUES (4, 'USER_MANAGE', '用户管理权', 0, 1, '2018-12-01 11:40:42');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for user_auth
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `user_auth`;
|
||||
CREATE TABLE `user_auth` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户ID',
|
||||
`auth_id` bigint(20) NULL DEFAULT NULL COMMENT '权限ID',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建用户ID',
|
||||
`update_uid` bigint(20) NULL DEFAULT NULL COMMENT '更新用户ID',
|
||||
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除',
|
||||
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户权限表' ROW_FORMAT = Compact;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of user_auth
|
||||
-- ----------------------------
|
||||
INSERT INTO `user_auth` VALUES (9, 2, 1, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (10, 2, 2, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (11, 2, 3, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (12, 2, 4, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (13, 3, 1, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (14, 3, 2, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (15, 3, 3, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (16, 3, 4, 1, NULL, 0, '2018-12-15 22:19:59', NULL);
|
||||
INSERT INTO `user_auth` VALUES (24, 1, 1, 1, NULL, 0, '2018-12-16 21:41:01', NULL);
|
||||
INSERT INTO `user_auth` VALUES (25, 1, 2, 1, NULL, 0, '2018-12-16 21:41:01', NULL);
|
||||
INSERT INTO `user_auth` VALUES (26, 1, 3, 1, NULL, 0, '2018-12-16 21:41:01', NULL);
|
||||
INSERT INTO `user_auth` VALUES (27, 1, 4, 1, NULL, 0, '2018-12-16 21:41:01', NULL);
|
||||
-- ----------------------------
|
||||
-- Table structure for user_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `user_info`;
|
||||
CREATE TABLE `user_info` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`user_no` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户编号,用于登录等',
|
||||
`password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '密码',
|
||||
`user_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户名',
|
||||
`email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
||||
`avatar` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '头像',
|
||||
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '是否删除 0=未删除 1=已删除',
|
||||
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人用户ID',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `idx_userNo`(`user_no`) USING BTREE COMMENT '登录用户名'
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户信息表' ROW_FORMAT = Compact;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of user_info
|
||||
-- ----------------------------
|
||||
INSERT INTO `user_info` VALUES (1, 'zyplayer', 'e10adc3949ba59abbe56e057f20f883e', '暮光:城中城', '806783409@qq.com', NULL, 0, '2018-12-01 11:37:39', NULL, '2018-12-15 20:32:08');
|
||||
INSERT INTO `user_info` VALUES (2, '1', NULL, '1111', NULL, NULL, 0, '2018-12-15 20:16:10', 1, '2018-12-15 20:19:50');
|
||||
INSERT INTO `user_info` VALUES (3, '2', NULL, '11', '11', NULL, 0, '2018-12-15 20:21:24', 1, NULL);
|
||||
-- ----------------------------
|
||||
-- Table structure for wiki_page
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wiki_page`;
|
||||
CREATE TABLE `wiki_page` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`space_id` bigint(20) NULL DEFAULT NULL COMMENT '空间ID',
|
||||
`name` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '名字',
|
||||
`parent_id` bigint(20) NULL DEFAULT NULL COMMENT '父ID',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_uid` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wiki_page_comment
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wiki_page_comment`;
|
||||
CREATE TABLE `wiki_page_comment` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
|
||||
`parent_id` bigint(20) NULL DEFAULT NULL COMMENT '父评论ID',
|
||||
`content` varchar(512) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '评论内容',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wiki_page_content
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wiki_page_content`;
|
||||
CREATE TABLE `wiki_page_content` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
|
||||
`content` mediumtext CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL COMMENT '内容',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_uid` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_page_id`(`page_id`) USING BTREE COMMENT '页面ID'
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wiki_page_file
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wiki_page_file`;
|
||||
CREATE TABLE `wiki_page_file` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
|
||||
`file_url` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '文件URL',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_uid` bigint(20) NULL DEFAULT NULL COMMENT '修改人ID',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`del_flag` tinyint(4) NULL DEFAULT 0 COMMENT '0=有效 1=删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wiki_page_zan
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wiki_page_zan`;
|
||||
CREATE TABLE `wiki_page_zan` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`page_id` bigint(20) NULL DEFAULT NULL COMMENT '页面ID',
|
||||
`comment_id` bigint(20) NULL DEFAULT NULL COMMENT '评论ID',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wiki_space
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `wiki_space`;
|
||||
CREATE TABLE `wiki_space` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`name` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '空间名',
|
||||
`type` tinyint(4) NULL DEFAULT 1 COMMENT '空间类型 1=公司 2=个人 3=私人',
|
||||
`explain` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT '描述',
|
||||
`create_uid` bigint(20) NULL DEFAULT NULL COMMENT '创建人ID',
|
||||
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for zyplayer_storage
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `zyplayer_storage`;
|
||||
CREATE TABLE `zyplayer_storage` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增ID',
|
||||
`doc_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数名字',
|
||||
`doc_value` mediumtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '参数值',
|
||||
`creation_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `key`(`doc_key`) USING BTREE COMMENT 'key唯一索引'
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 43 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '存储网页上相关的数据' ROW_FORMAT = Compact;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user