diff --git a/LICENSE b/LICENSE index 8dada3e..a921bc8 100644 --- a/LICENSE +++ b/LICENSE @@ -136,7 +136,7 @@ with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, + names, trademarks, com.restservice.service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. diff --git a/bbs_restservice/pom.xml b/bbs_restservice/pom.xml new file mode 100644 index 0000000..aea8ff6 --- /dev/null +++ b/bbs_restservice/pom.xml @@ -0,0 +1,80 @@ + + + + quark-parent + com.quark + 1.0-SNAPSHOT + ../quark-parent/pom.xml + + 4.0.0 + + bbs_rest + restservice + 1.0-SNAPSHOT + + + + + bbspratise + bbssource + 1.0-SNAPSHOT + + + + + + org.springframework.boot + + spring-boot-starter + + + + + org.springframework.boot + + spring-boot-starter-web + + + + + org.springframework.boot + spring-boot-starter-test + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + org.springframework.boot + spring-boot-starter-websocket + + + org.springframework + spring-messaging + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + + io.netty + netty-all + 4.1.37.Final + + + + + + \ No newline at end of file diff --git a/bbs_restservice/src/main/java/com/restservice/BBSRestApplication.java b/bbs_restservice/src/main/java/com/restservice/BBSRestApplication.java new file mode 100644 index 0000000..8d9e486 --- /dev/null +++ b/bbs_restservice/src/main/java/com/restservice/BBSRestApplication.java @@ -0,0 +1,35 @@ +package com.restservice; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cache.annotation.EnableCaching; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +/** + * Created by liudeyu on 2019/7/2. + */ + +@SpringBootApplication +@EnableCaching +public class BBSRestApplication { + + public static void main(String[] argv) { + SpringApplication springApplication = new SpringApplication(BBSRestApplication.class); + InputStream inputStream = BBSRestApplication.class.getClassLoader().getResourceAsStream("rest.properties"); + Properties properties = new Properties(); + try { + properties.load(inputStream); + springApplication.setDefaultProperties(properties); + } catch (IOException e) { + e.printStackTrace(); + } + + springApplication.run(argv); + + } +} diff --git a/bbs_restservice/src/main/java/com/restservice/configure/CorsFilter.java b/bbs_restservice/src/main/java/com/restservice/configure/CorsFilter.java new file mode 100644 index 0000000..27460c1 --- /dev/null +++ b/bbs_restservice/src/main/java/com/restservice/configure/CorsFilter.java @@ -0,0 +1,44 @@ +package com.restservice.configure; + +import io.netty.handler.codec.http.HttpResponse; +import io.netty.handler.codec.http.HttpResponseStatus; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * Created by liudeyu on 2019/7/9. + */ + +@Configuration +public class CorsFilter implements Filter { + + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + + } + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + if ((servletResponse instanceof HttpServletResponse)) { + HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; + httpServletResponse.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "*"); + httpServletResponse.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET, POST, PATCH, PUT, DELETE, OPTIONS"); + httpServletResponse.setHeader(HttpHeaders.ACCESS_CONTROL_MAX_AGE, 6 * 60+""); + httpServletResponse.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_HEADERS, "X-Requested-With"); + + } + filterChain.doFilter(servletRequest, servletResponse); + } + + @Override + public void destroy() { + + } +} diff --git a/bbs_restservice/src/main/java/com/restservice/configure/MyMvcAdapter.java b/bbs_restservice/src/main/java/com/restservice/configure/MyMvcAdapter.java new file mode 100644 index 0000000..0c10363 --- /dev/null +++ b/bbs_restservice/src/main/java/com/restservice/configure/MyMvcAdapter.java @@ -0,0 +1,18 @@ +package com.restservice.configure; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +/** + * Created by liudeyu on 2019/7/9. + */ +@Configuration +public class MyMvcAdapter extends WebMvcConfigurerAdapter{ + + @Override + public void addViewControllers(ViewControllerRegistry registry) { + super.addViewControllers(registry); + + } +} diff --git a/bbs_restservice/src/main/java/com/restservice/configure/PropertiesConfigure.java b/bbs_restservice/src/main/java/com/restservice/configure/PropertiesConfigure.java new file mode 100644 index 0000000..37fb17f --- /dev/null +++ b/bbs_restservice/src/main/java/com/restservice/configure/PropertiesConfigure.java @@ -0,0 +1,19 @@ +package com.restservice.configure; + +import org.springframework.boot.env.PropertySourcesLoader; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; +import org.springframework.test.context.ContextConfiguration; + +/** + * Created by liudeyu on 2019/7/4. + */ +@Configuration +@ContextConfiguration(locations = {"classpath:rest.properties"}) +public class PropertiesConfigure { + @Bean + public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { + return new PropertySourcesPlaceholderConfigurer(); + } +} diff --git a/bbs_restservice/src/main/java/com/restservice/configure/RedisConfigure.java b/bbs_restservice/src/main/java/com/restservice/configure/RedisConfigure.java new file mode 100644 index 0000000..dca0b8e --- /dev/null +++ b/bbs_restservice/src/main/java/com/restservice/configure/RedisConfigure.java @@ -0,0 +1,71 @@ +package com.restservice.configure; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.interceptor.KeyGenerator; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; + +import java.lang.reflect.Method; + +/** + * Created by liudeyu on 2019/7/2. + */ +@Configuration +@EnableCaching +public class RedisConfigure extends CachingConfigurerSupport { + + + @Bean + @Override + public KeyGenerator keyGenerator() { + return new KeyGenerator() { + @Override + public Object generate(Object o, Method method, Object... objects) { + StringBuilder builder = new StringBuilder(); + builder.append(o.getClass().toString()).append(method.getName()); + for (Object object : objects) { + builder.append(object.toString()); + } + return builder.toString(); + } + }; + } + + + + + @Bean + public CacheManager cacheManager(RedisTemplate redisTemplate) { + RedisCacheManager rcm = new RedisCacheManager(redisTemplate); + //设置缓存过期时间 + //rcm.setDefaultExpiration(60);//秒 + return rcm; + } + + + + + @Bean(name = "redis_custom") + public RedisTemplate redisemplate(RedisConnectionFactory factory){ + StringRedisTemplate stringRedisTemplate=new StringRedisTemplate(factory); + Jackson2JsonRedisSerializer jackson2JsonRedisSerializer=new Jackson2JsonRedisSerializer(Object.class); + ObjectMapper mapper=new ObjectMapper(); + mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + jackson2JsonRedisSerializer.setObjectMapper(mapper); + stringRedisTemplate.setValueSerializer(jackson2JsonRedisSerializer); + stringRedisTemplate.afterPropertiesSet(); + return stringRedisTemplate; + + } +} diff --git a/bbs_restservice/src/main/java/com/restservice/configure/RestConfig.java b/bbs_restservice/src/main/java/com/restservice/configure/RestConfig.java new file mode 100644 index 0000000..1162a8b --- /dev/null +++ b/bbs_restservice/src/main/java/com/restservice/configure/RestConfig.java @@ -0,0 +1,12 @@ +package com.restservice.configure; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +/** + * Created by liudeyu on 2019/7/3. + */ +@Configuration +@ComponentScan(basePackages = "common") +public class RestConfig { +} diff --git a/bbs_restservice/src/main/java/com/restservice/service/RedisService.java b/bbs_restservice/src/main/java/com/restservice/service/RedisService.java new file mode 100644 index 0000000..a7d4510 --- /dev/null +++ b/bbs_restservice/src/main/java/com/restservice/service/RedisService.java @@ -0,0 +1,72 @@ +package com.restservice.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.concurrent.TimeUnit; + +/** + * Created by liudeyu on 2019/7/1. + */ +@Service +public class RedisService { + + @Resource(name="redis_custom") + private RedisTemplate template; + + + /** + * time is hour + */ + public void putDataInMap(String key, T value, int time) { + ValueOperations valueOperations = template.opsForValue(); + valueOperations.set(key, value, time, TimeUnit.HOURS); + } + + public T getDataFromMap(String key) { + ValueOperations valueOperations = template.opsForValue(); + return valueOperations.get(key); + } + + + public T getDataAndUpdateTime(String key, int time) { + ValueOperations valueOperations = template.opsForValue(); + if (valueOperations.get(key) == null) { + return valueOperations.get(key); + } + T data = valueOperations.get(key); + valueOperations.set(key, data, time); + return data; + } + + public void deleteFromMap(String key) { + ValueOperations valueOperations = template.opsForValue(); + template.delete(key); + } + + public void putDataInSet(String key, T t) { + SetOperations setOp = template.opsForSet(); + setOp.add(key, t); + } + + public void removeDataFromSet(String key, T t) { + SetOperations setOp = template.opsForSet(); + setOp.remove(key, t); + } + + public boolean isDataInSet(String key, T t) { + SetOperations setOp = template.opsForSet(); + return setOp.isMember(key, t); + } + + public void putSetIfNotExists(String key,T t){ + if(!isDataInSet(key,t)) { + putDataInSet(key,t); + } + } + +} diff --git a/bbs_restservice/src/main/resources/resource.properties b/bbs_restservice/src/main/resources/resource.properties new file mode 100644 index 0000000..98e38e8 --- /dev/null +++ b/bbs_restservice/src/main/resources/resource.properties @@ -0,0 +1,10 @@ +#User_Redis_Key +REDIS_USER_KEY = quark:user: +REDIS_USER_TIME = 24 + +#Rank_Redis_Key +REDIS_RANK_POSTS = quark:rank:posts +REDIS_RANK_USERS = quark:rank:users + +#Userid_Redis_Key +REDIS_USERID_KEY = quark:uid diff --git a/bbs_restservice/src/main/resources/rest.properties b/bbs_restservice/src/main/resources/rest.properties new file mode 100644 index 0000000..a36aef8 --- /dev/null +++ b/bbs_restservice/src/main/resources/rest.properties @@ -0,0 +1,24 @@ +#port +server.port=8081 + +#log +logging.level.org.springframework.web=DEBUG + +#redis���� +spring.redis.host=127.0.0.1 +spring.redis.port=6379 +#spring.redis.password=root +spring.redis.pool.max-active=8 +spring.redis.pool.max-wait=-1 +spring.redis.pool.max-idle=8 +spring.redis.pool.min-idle=0 +spring.redis.timeout=0 + +#�ļ��ϴ� +spring.http.multipart.max-file-size= 2MB + +#������ +spring.http.encoding.force=true +spring.http.encoding.charset=UTF-8 +spring.http.encoding.enabled=true +server.tomcat.uri-encoding=UTF-8 \ No newline at end of file diff --git a/bbs_restservice/src/test/java/Test.java b/bbs_restservice/src/test/java/Test.java new file mode 100644 index 0000000..b111aca --- /dev/null +++ b/bbs_restservice/src/test/java/Test.java @@ -0,0 +1,45 @@ +import com.restservice.BBSRestApplication; +import com.restservice.service.RedisService; +import common.dao.UserDao; +import org.junit.Before; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * Created by liudeyu on 2019/7/3. + */ +@RunWith(SpringRunner.class) +@EnableCaching +@SpringBootTest(classes = BBSRestApplication.class) +@TestPropertySource(locations = {"classpath:rest.properties"}) + +public class Test { + + @Autowired + RedisService redisService; + + @Autowired + UserDao userDao; + + @Before + public void beforeConfigure() { + System.out.println("before configure"); + } + + @org.junit.Test + public void sayHello() { + System.out.println("hello"); + } + + + @org.junit.Test + public void saveValue() { + final String key = "apple"; + redisService.putDataInMap(key, "no way", 1); + System.out.println(redisService.getDataFromMap(key)); + } +} diff --git a/bbssource_common/pom.xml b/bbssource_common/pom.xml new file mode 100644 index 0000000..9d8c4ad --- /dev/null +++ b/bbssource_common/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + + bbspratise + bbssource + 1.0-SNAPSHOT + + + quark-parent + com.quark + 1.0-SNAPSHOT + ../quark-parent/pom.xml + + + + + 1.8 + 1.0.0 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-cache + + + + net.sf.ehcache + ehcache + + + mysql + mysql-connector-java + runtime + + + com.alibaba + druid + + + net.sourceforge.nekohtml + nekohtml + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.alibaba + fastjson + + + com.google.guava + guava + + + com.fasterxml.jackson.core + jackson-annotations + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-test + ${kotlin.version} + test + + + + + + bbsproject + + + org.springframework.boot + spring-boot-maven-plugin + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + compile + compile + + compile + + + + testCompile + test-compile + + testCompile + + + + + + + + \ No newline at end of file diff --git a/bbssource_common/src/main/java/common/CommonApplication.java b/bbssource_common/src/main/java/common/CommonApplication.java new file mode 100644 index 0000000..86cf2af --- /dev/null +++ b/bbssource_common/src/main/java/common/CommonApplication.java @@ -0,0 +1,19 @@ +package common; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Configuration; + +/** + * Created by liudeyu on 2019/6/30. + */ + +@SpringBootApplication +@EnableCaching +public class CommonApplication { + public static void main(String[]argv){ + SpringApplication.run(CommonApplication.class,argv); + } +} diff --git a/bbssource_common/src/main/java/common/baseservice/BaseController.java b/bbssource_common/src/main/java/common/baseservice/BaseController.java new file mode 100644 index 0000000..b5f6666 --- /dev/null +++ b/bbssource_common/src/main/java/common/baseservice/BaseController.java @@ -0,0 +1,21 @@ +package common.baseservice; + +import common.dto.QuarkResult; +import common.exceptions.ApiException; + +/** + * Created by liudeyu on 2019/6/30. + */ +public class BaseController { + + public QuarkResult process(Processor processor) { + try { + return processor.process(); + } catch (ApiException ex) { + return QuarkResult.Companion.error(ex.getStackTrace().toString()); + } catch (Exception ex) { + return QuarkResult.errorSystem(ex.getStackTrace().toString()); + } + } + +} diff --git a/bbssource_common/src/main/java/common/baseservice/BaseService.java b/bbssource_common/src/main/java/common/baseservice/BaseService.java new file mode 100644 index 0000000..e85dc39 --- /dev/null +++ b/bbssource_common/src/main/java/common/baseservice/BaseService.java @@ -0,0 +1,27 @@ +package common.baseservice; + +import java.util.Iterator; +import java.util.List; + +/** + * Created by liudeyu on 2019/6/30. + */ +public interface BaseService { + + T save(T entity); + + void delete(Object key); + + T findOne(int key); + + List findAll(); + + + void deleteInBatch(Iterable entities); + + List findInBatch(Iterable keys); + + List saveInBatch(Iterable keys); + + +} diff --git a/bbssource_common/src/main/java/common/baseservice/BaseServiceImp.java b/bbssource_common/src/main/java/common/baseservice/BaseServiceImp.java new file mode 100644 index 0000000..de80f42 --- /dev/null +++ b/bbssource_common/src/main/java/common/baseservice/BaseServiceImp.java @@ -0,0 +1,51 @@ +package common.baseservice; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +/** + * Created by liudeyu on 2019/6/30. + */ +public class BaseServiceImp implements BaseService { + + @Autowired + protected E reposity; + + + @Override + public T save(T entity) { + return (T) reposity.save(entity); + } + + @Override + public void delete(Object key) { + reposity.delete(key); + } + + @Override + public T findOne(int key) { + return (T) reposity.findOne(key); + } + + @Override + public List findAll() { + return reposity.findAll(); + } + + @Override + public void deleteInBatch(Iterable entities) { + reposity.deleteInBatch(entities); + } + + @Override + public List findInBatch(Iterable keys) { + return reposity.findAll(keys); + } + + @Override + public List saveInBatch(Iterable keys) { + return reposity.save(keys); + } +} diff --git a/bbssource_common/src/main/java/common/baseservice/Processor.java b/bbssource_common/src/main/java/common/baseservice/Processor.java new file mode 100644 index 0000000..a9048a2 --- /dev/null +++ b/bbssource_common/src/main/java/common/baseservice/Processor.java @@ -0,0 +1,11 @@ +package common.baseservice; + +import common.dto.QuarkResult; + +/** + * Created by liudeyu on 2019/6/30. + */ +public interface Processor { + + QuarkResult process(); +} diff --git a/bbssource_common/src/main/java/common/dao/AdminUserDao.java b/bbssource_common/src/main/java/common/dao/AdminUserDao.java new file mode 100644 index 0000000..46844a2 --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/AdminUserDao.java @@ -0,0 +1,12 @@ +package common.dao; + +import common.entity.AdminUser; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +/** + * Created by liudeyu on 2019/6/30. + */ +@Repository +public interface AdminUserDao extends JpaRepository { +} diff --git a/bbssource_common/src/main/java/common/dao/CollectDao.java b/bbssource_common/src/main/java/common/dao/CollectDao.java new file mode 100644 index 0000000..f51e927 --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/CollectDao.java @@ -0,0 +1,10 @@ +package common.dao; + +import common.entity.Collect; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * Created by liudeyu on 2019/6/30. + */ +public interface CollectDao extends JpaRepository { +} diff --git a/bbssource_common/src/main/java/common/dao/LabelDao.java b/bbssource_common/src/main/java/common/dao/LabelDao.java new file mode 100644 index 0000000..8511afa --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/LabelDao.java @@ -0,0 +1,14 @@ +package common.dao; + +import common.entity.Label; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.stereotype.Repository; + +/** + * Created by liudeyu on 2019/6/30. + */ +@Repository +public interface LabelDao extends JpaRepository,JpaSpecificationExecutor{ + +} diff --git a/bbssource_common/src/main/java/common/dao/NotificationDao.java b/bbssource_common/src/main/java/common/dao/NotificationDao.java new file mode 100644 index 0000000..805ae7b --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/NotificationDao.java @@ -0,0 +1,13 @@ +package common.dao; + +import common.entity.Notification; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** + * Created by liudeyu on 2019/6/30. + */ +public interface NotificationDao extends JpaRepository,JpaSpecificationExecutor{ + + +} diff --git a/bbssource_common/src/main/java/common/dao/PermissionDao.java b/bbssource_common/src/main/java/common/dao/PermissionDao.java new file mode 100644 index 0000000..7c37842 --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/PermissionDao.java @@ -0,0 +1,10 @@ +package common.dao; + +import common.entity.Permission; +import org.springframework.data.jpa.repository.JpaRepository; + +/** + * Created by liudeyu on 2019/6/30. + */ +public interface PermissionDao extends JpaRepository { +} diff --git a/bbssource_common/src/main/java/common/dao/PostDao.java b/bbssource_common/src/main/java/common/dao/PostDao.java new file mode 100644 index 0000000..70324da --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/PostDao.java @@ -0,0 +1,35 @@ +package common.dao; + +import common.entity.Label; +import common.entity.Posts; +import common.entity.User; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * Created by liudeyu on 2019/6/30. + */ +@Repository +@CacheConfig(cacheNames = "postses") +public interface PostDao extends JpaRepository ,JpaSpecificationExecutor{ + @Override + @Cacheable + List findAll(); + + Page findByUser(User user,Pageable page); + Page findByLabel(Label label,Pageable pageable); + + @Query(value = "select p.id,p.title,p.reply_count from quark_posts p where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <=DATE(p.init_time) ORDER by reply_count desc limit 10" + ,nativeQuery = true) + List findHotPosts(); + +} diff --git a/bbssource_common/src/main/java/common/dao/ReplyDao.java b/bbssource_common/src/main/java/common/dao/ReplyDao.java new file mode 100644 index 0000000..d900cc8 --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/ReplyDao.java @@ -0,0 +1,20 @@ +package common.dao; + +import common.entity.Reply; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * Created by liudeyu on 2019/6/30. + */ +@Repository +public interface ReplyDao extends JpaRepository,JpaSpecificationExecutor { + + @Cacheable + @Override + List findAll(); +} diff --git a/bbssource_common/src/main/java/common/dao/UserDao.java b/bbssource_common/src/main/java/common/dao/UserDao.java new file mode 100644 index 0000000..317f2ff --- /dev/null +++ b/bbssource_common/src/main/java/common/dao/UserDao.java @@ -0,0 +1,25 @@ +package common.dao; + +import common.entity.User; +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * Created by liudeyu on 2019/6/30. + */ +@Repository +@CacheConfig(cacheNames = "users") +public interface UserDao extends JpaRepository, JpaSpecificationExecutor { + + User findUserByEmail(String email); + + User findUserByUsername(String name); + + @Query(value = "select * from quark_user u where DATE_SUB(CURDATE(),INTERVAL 3000 DAY)<=DATE(u.init_time) ORDER BY u.id DESC limit 12", nativeQuery = true) + List findNewUser(); +} diff --git a/bbssource_common/src/main/java/common/dto/PageResult.kt b/bbssource_common/src/main/java/common/dto/PageResult.kt new file mode 100644 index 0000000..dc45edd --- /dev/null +++ b/bbssource_common/src/main/java/common/dto/PageResult.kt @@ -0,0 +1,14 @@ +package common.dto + +import java.io.Serializable + +/** + * Created by liudeyu on 2019/6/30. + */ +class PageResult : Serializable { + var totalRecord = 0 + var filterRecord = 0 + var draw = 0 + var data: T? = null + +} \ No newline at end of file diff --git a/bbssource_common/src/main/java/common/dto/QuarkResult.kt b/bbssource_common/src/main/java/common/dto/QuarkResult.kt new file mode 100644 index 0000000..d5f43c1 --- /dev/null +++ b/bbssource_common/src/main/java/common/dto/QuarkResult.kt @@ -0,0 +1,53 @@ +package common.dto + +import com.google.common.net.HttpHeaders +import com.sun.deploy.net.HttpUtils +import com.sun.net.httpserver.HttpServer +import org.omg.CORBA.Object +import java.io.Serializable +import java.net.HttpURLConnection +import javax.xml.ws.spi.http.HttpHandler + +/** + * Created by liudeyu on 2019/6/30. + */ +class QuarkResult() : Serializable { + + + companion object { + + @JvmStatic + fun ok(data: Any): QuarkResult { + val data = QuarkResult(HttpURLConnection.HTTP_OK, data) + return data + } + @JvmStatic + fun error(errorMsg:String):QuarkResult{ + return QuarkResult(HttpURLConnection.HTTP_BAD_REQUEST,errorMsg) + } + + @JvmStatic + fun errorSystem(errorMsg:String):QuarkResult{ + return QuarkResult(HttpURLConnection.HTTP_INTERNAL_ERROR,errorMsg); + } + + } + + constructor(status: Int, data: Any) : this() { + this.status = status + this.data = data + } + + constructor(status: Int, error: String) : this() { + this.status = status + this.error = error + } + + var status = 0; + var data: Any? = null + var error: String = "" + var pageSize: Int = 0 + var total: Int = 0 + + +} \ No newline at end of file diff --git a/bbssource_common/src/main/java/common/dto/SocketMessage.kt b/bbssource_common/src/main/java/common/dto/SocketMessage.kt new file mode 100644 index 0000000..3329ed3 --- /dev/null +++ b/bbssource_common/src/main/java/common/dto/SocketMessage.kt @@ -0,0 +1,11 @@ +package common.dto + +import java.io.Serializable + +/** + * Created by liudeyu on 2019/6/30. + */ +class SocketMessage : Serializable { + var message: String = "" + var code = 0 +} \ No newline at end of file diff --git a/bbssource_common/src/main/java/common/dto/UploadResult.kt b/bbssource_common/src/main/java/common/dto/UploadResult.kt new file mode 100644 index 0000000..e94d08b --- /dev/null +++ b/bbssource_common/src/main/java/common/dto/UploadResult.kt @@ -0,0 +1,25 @@ +package common.dto + +import java.io.Serializable + +/** + * Created by liudeyu on 2019/6/30. + */ + + +class UploadResult() : Serializable { + + constructor(status: Int) : this() { + this.status = status + } + + class UploadData { + var title = "" + var src = "" + } + + var status = 0 + var data:UploadData?=null + var errorMessage="" // error message + +} \ No newline at end of file diff --git a/bbssource_common/src/main/java/common/entity/AdminUser.java b/bbssource_common/src/main/java/common/entity/AdminUser.java new file mode 100644 index 0000000..6b433a4 --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/AdminUser.java @@ -0,0 +1,90 @@ +package common.entity; + + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +/** + * Created by lhr on 17-7-31. + */ + +@Entity +@Table(name = "quark_adminuser") +public class AdminUser implements Serializable{ + + @Id + @GeneratedValue + private Integer id; + + @Column(unique = true,nullable = false) + private String username; + + @Column(nullable = false) + @JsonIgnore + private String password; + + + //是否可以使用,默认为1 + @Column(nullable = false) + private Integer enable = 1; + + @JsonIgnore + @JoinTable(name = "quark_adminuser_role", + joinColumns = {@JoinColumn(name = "adminuser_id",referencedColumnName = "id")}, + inverseJoinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}) + @ManyToMany(cascade = CascadeType.ALL) + private Set roles = new HashSet<>(); + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Integer getEnable() { + return enable; + } + + public void setEnable(Integer enable) { + this.enable = enable; + } + + public Set getRoles() { + return roles; + } + + public void setRoles(Set roles) { + this.roles = roles; + } + + @Override + public String toString() { + return "AdminUser{" + + "Id=" + id + + ", username='" + username + '\'' + + ", password='" + password + '\'' + + ", enable=" + enable; + } +} diff --git a/bbssource_common/src/main/java/common/entity/Collect.java b/bbssource_common/src/main/java/common/entity/Collect.java new file mode 100644 index 0000000..10c50ac --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/Collect.java @@ -0,0 +1,69 @@ +package common.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import common.utils.Constants; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * @Author LHR + * Create By 2017/8/18 + * + * 收藏 + */ +@Entity +@Table(name = "quark_collect") +public class Collect implements Serializable{ + + @Id + @GeneratedValue + private Integer id; + + //与帖子的关联关系:立即加载 + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(nullable = false, name = "posts_id") + private Posts posts; + + //与用户的关联关系:立即加载 + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(nullable = false, name = "user_id") + private User user; + + //收藏时间 + @JsonFormat(pattern = Constants.DATETIME_FORMAT) + private Date initTime; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Posts getPosts() { + return posts; + } + + public void setPosts(Posts posts) { + this.posts = posts; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Date getInitTime() { + return initTime; + } + + public void setInitTime(Date initTime) { + this.initTime = initTime; + } +} diff --git a/bbssource_common/src/main/java/common/entity/Label.java b/bbssource_common/src/main/java/common/entity/Label.java new file mode 100644 index 0000000..4b2689f --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/Label.java @@ -0,0 +1,62 @@ +package common.entity; + +import javax.persistence.*; +import java.io.Serializable; + +/** + * @Author LHR + * Create By 2017/8/18 + * + * 标签 + */ +@Entity +@Table(name = "quark_label") +public class Label implements Serializable { + + @Id + @GeneratedValue + private Integer id; + + //标签名称 + @Column(nullable = false, unique = true) + private String name; + + //主题数量 + @Column(name = "posts_count") + private Integer postsCount = 0; + + //详情 + private String details; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getPostsCount() { + return postsCount; + } + + public void setPostsCount(Integer postsCount) { + this.postsCount = postsCount; + } + + public String getDetails() { + return details; + } + + public void setDetails(String details) { + this.details = details; + } +} diff --git a/bbssource_common/src/main/java/common/entity/Notification.java b/bbssource_common/src/main/java/common/entity/Notification.java new file mode 100644 index 0000000..072f992 --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/Notification.java @@ -0,0 +1,93 @@ +package common.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import common.utils.Constants; + +import javax.persistence.*; +import java.util.Date; + +/** + * @Author LHR + * Create By 2017/8/18 + * + * 通知 + */ +@Entity +@Table(name = "quark_notification") +public class Notification { + + @Id + @GeneratedValue + private Integer id; + + //通知是否已读 + @Column(name = "is_read") + private boolean isRead = false; + + //要通知的用户:立即加载 + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(nullable = false,name = "touser_id") + private User touser; + + //发起通知的用户 + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(nullable = false,name = "fromuser_id") + private User fromuser; + + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(nullable = false,name = "posts_id") + private Posts posts; + + //发布时间 + @Column(nullable = false) + @JsonFormat(pattern = Constants.DATETIME_FORMAT, timezone = "GMT+8") + private Date initTime; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public boolean isRead() { + return isRead; + } + + public void setRead(boolean read) { + isRead = read; + } + + public User getTouser() { + return touser; + } + + public void setTouser(User touser) { + this.touser = touser; + } + + public User getFromuser() { + return fromuser; + } + + public void setFromuser(User fromuser) { + this.fromuser = fromuser; + } + + public Posts getPosts() { + return posts; + } + + public void setPosts(Posts posts) { + this.posts = posts; + } + + public Date getInitTime() { + return initTime; + } + + public void setInitTime(Date initTime) { + this.initTime = initTime; + } +} diff --git a/bbssource_common/src/main/java/common/entity/Permission.java b/bbssource_common/src/main/java/common/entity/Permission.java new file mode 100644 index 0000000..d737444 --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/Permission.java @@ -0,0 +1,107 @@ +package common.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +/** + * Created by lhr on 17-7-31. + */ + +@Entity +@Table(name = "quark_permission") +public class Permission implements Serializable{ + + @Id + @GeneratedValue + private Integer id; + + private String name; + + private String perurl; + + //资源类型 1:菜单 2:按钮 + private Integer type; + + //父权限 + @Column(nullable = false) + private Integer parentid; + + //排序 + private Integer sort; + + //是否选中 + @Transient + private String checked; + + @JsonIgnore + @ManyToMany(mappedBy = "permissions") + private Set roles = new HashSet<>(); + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPerurl() { + return perurl; + } + + public void setPerurl(String perurl) { + this.perurl = perurl; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getParentid() { + return parentid; + } + + public void setParentid(Integer parentid) { + this.parentid = parentid; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Set getRoles() { + return roles; + } + + public void setRoles(Set roles) { + this.roles = roles; + } + + public String getChecked() { + return checked; + } + + public void setChecked(String checked) { + this.checked = checked; + } +} diff --git a/bbssource_common/src/main/java/common/entity/Posts.java b/bbssource_common/src/main/java/common/entity/Posts.java new file mode 100644 index 0000000..fc3e8cc --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/Posts.java @@ -0,0 +1,145 @@ +package common.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import common.utils.Constants; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * @Author LHR + * Create By 2017/8/18 + * + * 帖子 + */ +@Entity +@Table(name = "quark_posts") +public class Posts implements Serializable { + + @Id + @GeneratedValue + private Integer id; + + //与标签的关系 + @ManyToOne + @JoinColumn(nullable = false, name = "label_id") + private Label label; + + //标题 + @Column(unique = true, nullable = false) + private String title; + + //内容 + @Column(columnDefinition = "text") + private String content; + + //发布时间 + @Column(nullable = false) + @JsonFormat(pattern = Constants.DATETIME_FORMAT, timezone = "GMT+8") + private Date initTime; + + //是否置顶 + private boolean top; + + //是否精华 + private boolean good; + + //与用户的关联关系 + @ManyToOne + @JoinColumn(nullable = false, name = "user_id") + private User user; + + + //回复数量 + @Column(name = "reply_count") + private int replyCount = 0; + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Label getLabel() { + return label; + } + + public void setLabel(Label label) { + this.label = label; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Date getInitTime() { + return initTime; + } + + public void setInitTime(Date initTime) { + this.initTime = initTime; + } + + public Boolean getTop() { + return top; + } + + public void setTop(Boolean top) { + this.top = top; + } + + public Boolean getGood() { + return good; + } + + public void setGood(Boolean good) { + this.good = good; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public int getReplyCount() { + return replyCount; + } + + public void setReplyCount(int replyCount) { + this.replyCount = replyCount; + } + + @Override + public String toString() { + return "Posts{" + + "id=" + id + + ", label=" + label + + ", title='" + title + '\'' + + ", content='" + content + '\'' + + ", initTime=" + initTime + + ", top=" + top + + ", good=" + good + + ", user=" + user + + ", replyCount=" + replyCount + + '}'; + } +} diff --git a/bbssource_common/src/main/java/common/entity/Reply.java b/bbssource_common/src/main/java/common/entity/Reply.java new file mode 100644 index 0000000..e86b46f --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/Reply.java @@ -0,0 +1,105 @@ +package common.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import common.utils.Constants; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * @Author LHR + * Create By 2017/8/18 + * + * 回复 + */ +@Entity +@Table(name = "quark_reply") +public class Reply implements Serializable { + + @Id + @GeneratedValue + private Integer id; + + //回复的内容 + @Column(columnDefinition = "text", nullable = false) + private String content; + + //回复时间 + @JsonFormat(pattern = Constants.DATETIME_FORMAT, timezone = "GMT+8") + private Date initTime; + + //点赞个数 + private Integer up = 0; + + //与话题的关联关系 + @ManyToOne + @JoinColumn(nullable = false, name = "posts_id") + @JsonIgnore + private Posts posts; + + //与用户的关联关系 + @ManyToOne + @JoinColumn(nullable = false, name = "user_id") + private User user; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Date getInitTime() { + return initTime; + } + + public void setInitTime(Date initTime) { + this.initTime = initTime; + } + + public Integer getUp() { + return up; + } + + public void setUp(Integer up) { + this.up = up; + } + + public Posts getPosts() { + return posts; + } + + public void setPosts(Posts posts) { + this.posts = posts; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @Override + public String toString() { + return "Reply{" + + "id=" + id + + ", content='" + content + '\'' + + ", initTime=" + initTime + + ", up=" + up + + ", user=" + user + + '}'; + } +} diff --git a/bbssource_common/src/main/java/common/entity/Role.java b/bbssource_common/src/main/java/common/entity/Role.java new file mode 100644 index 0000000..5db3f9f --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/Role.java @@ -0,0 +1,102 @@ +package common.entity; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +/** + * Created by lhr on 17-7-31. + */ + +@Entity +@Table(name = "quark_role") +public class Role implements Serializable{ + + @Id + @GeneratedValue + private Integer id; + + @Column(unique = true,nullable = false) + private String name; + + //角色描述 + private String description; + + //是否持有角色标志 + @Transient + private Integer selected; + + //角色与用户的关联关系 + @JsonIgnore + @ManyToMany(mappedBy = "roles") + private Set adminUsers = new HashSet<>(); + + //角色与权限的关联关系 + @JsonIgnore + @JoinTable(name = "quark_role_permission", + joinColumns = {@JoinColumn(name = "role_id",referencedColumnName = "id")}, + inverseJoinColumns = {@JoinColumn(name = "permissions_id",referencedColumnName = "id")}) + @ManyToMany(cascade = CascadeType.ALL) + private Set permissions = new HashSet<>(); + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Set getAdminUsers() { + return adminUsers; + } + + public void setAdminUsers(Set adminUsers) { + this.adminUsers = adminUsers; + } + + public Set getPermissions() { + return permissions; + } + + public void setPermissions(Set permissions) { + this.permissions = permissions; + } + + public Integer getSelected() { + return selected; + } + + public void setSelected(Integer selected) { + this.selected = selected; + } + + @Override + public String toString() { + return "Role{" + + "id=" + id + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + ", selected=" + selected + + '}'; + } +} diff --git a/bbssource_common/src/main/java/common/entity/User.java b/bbssource_common/src/main/java/common/entity/User.java new file mode 100644 index 0000000..1bb706c --- /dev/null +++ b/bbssource_common/src/main/java/common/entity/User.java @@ -0,0 +1,141 @@ +package common.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import common.utils.Constants; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.Date; + +/** + * @Author LHR + * Create By 2017/8/18 + * + * 用户 + */ +@Entity +@Table(name="quark_user") +public class User implements Serializable { + + @Id + @GeneratedValue + private Integer id; + + //注册邮箱 + @Column(nullable = false) + private String email; + + // 用户名 + @Column(unique = true, nullable = false) + private String username; + + // 密码 + @Column(nullable = false) + @JsonIgnore + private String password; + + // 头像 + private String icon ="http://127.0.0.1/images/upload/default.png"; + + // 个人签名 + private String signature; + + // 注册时间 + @Column(nullable = false) + @JsonFormat(pattern = Constants.DATE_FORMAT, timezone = "GMT+8") + private Date initTime; + + //性别 0 :男 1:女 + private Integer sex = 0; + + //是否被封禁,默认为1:开启 + @Column(nullable = false) + private Integer enable = 1; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + public Date getInitTime() { + return initTime; + } + + public void setInitTime(Date initTime) { + this.initTime = initTime; + } + + public Integer getSex() { + return sex; + } + + public void setSex(Integer sex) { + this.sex = sex; + } + + public Integer getEnable() { + return enable; + } + + public void setEnable(Integer enable) { + this.enable = enable; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", username='" + username + '\'' + + ", password='" + password + '\'' + + ", Icon='" + icon + '\'' + + ", signature='" + signature + '\'' + + ", initTime=" + initTime + + ", sex=" + sex + + ", enable=" + enable + + '}'; + } +} diff --git a/bbssource_common/src/main/java/common/exceptions/ApiException.java b/bbssource_common/src/main/java/common/exceptions/ApiException.java new file mode 100644 index 0000000..5963a0a --- /dev/null +++ b/bbssource_common/src/main/java/common/exceptions/ApiException.java @@ -0,0 +1,25 @@ +package common.exceptions; + +/** + * Created by liudeyu on 2019/6/30. + */ +public class ApiException extends RuntimeException{ + private int status; + private Throwable throwable; + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public Throwable getThrowable() { + return throwable; + } + + public void setThrowable(Throwable throwable) { + this.throwable = throwable; + } +} diff --git a/bbssource_common/src/main/java/common/test b/bbssource_common/src/main/java/common/test new file mode 100644 index 0000000..e69de29 diff --git a/bbssource_common/src/main/java/common/utils/Constants.java b/bbssource_common/src/main/java/common/utils/Constants.java new file mode 100644 index 0000000..6aa7c25 --- /dev/null +++ b/bbssource_common/src/main/java/common/utils/Constants.java @@ -0,0 +1,6 @@ +package common.utils; + +public class Constants { + public static final String DATE_FORMAT = "yyyy-MM-dd"; + public static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; +} diff --git a/bbssource_common/src/main/java/common/utils/Logger.kt b/bbssource_common/src/main/java/common/utils/Logger.kt new file mode 100644 index 0000000..1e0eeb5 --- /dev/null +++ b/bbssource_common/src/main/java/common/utils/Logger.kt @@ -0,0 +1,13 @@ +package common.utils + +import org.slf4j.LoggerFactory + +/** + * Created by liudeyu on 2019/6/30. + */ + +class Logger{ + companion object{ + val logger=LoggerFactory.getLogger("Logger") + } +} \ No newline at end of file diff --git a/bbssource_common/src/main/java/test b/bbssource_common/src/main/java/test new file mode 100644 index 0000000..e69de29 diff --git a/bbssource_common/src/main/resources/application.properties b/bbssource_common/src/main/resources/application.properties new file mode 100644 index 0000000..df3133f --- /dev/null +++ b/bbssource_common/src/main/resources/application.properties @@ -0,0 +1,25 @@ +#Mysql配置 +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/quarkCommunity?useUnicode=true&characterEncoding=UTF-8&useSSL=false +spring.datasource.username=ldy +spring.datasource.password=abcd1234 +spring.datasource.driver-class-name=com.mysql.jdbc.Driver + +#jpa配置 +spring.jpa.database = MYSQL +spring.jpa.show-sql = true +spring.jpa.hibernate.ddl-auto = update +spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy +spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect + +#datasource +spring.datasource.initialSize=5 +spring.datasource.minIdle=5 +spring.datasource.maxActive=20 +# 配置获取连接等待超时的时间 +spring.datasource.maxWait=60000 + + + + + diff --git a/bbssource_common/src/main/resources/ehcache.xml b/bbssource_common/src/main/resources/ehcache.xml new file mode 100644 index 0000000..4922ae7 --- /dev/null +++ b/bbssource_common/src/main/resources/ehcache.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bbssource_common/src/test/java/testcommon/AbsTestConfigure.java b/bbssource_common/src/test/java/testcommon/AbsTestConfigure.java new file mode 100644 index 0000000..f0be361 --- /dev/null +++ b/bbssource_common/src/test/java/testcommon/AbsTestConfigure.java @@ -0,0 +1,19 @@ +package testcommon; + +import common.CommonApplication; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; + +/** + * Created by liudeyu on 2019/6/30. + */ + +@RunWith(SpringJUnit4ClassRunner.class) +@EnableCaching +@SpringBootTest(classes = CommonApplication.class) +public abstract class AbsTestConfigure { +} diff --git a/bbssource_common/src/test/java/testcommon/TestOne.java b/bbssource_common/src/test/java/testcommon/TestOne.java new file mode 100644 index 0000000..40aeee0 --- /dev/null +++ b/bbssource_common/src/test/java/testcommon/TestOne.java @@ -0,0 +1,28 @@ +package testcommon; + +import common.dao.UserDao; +import common.entity.User; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +public class TestOne extends AbsTestConfigure{ + + @Autowired + UserDao userDao; + @Test + public void testHello(){ + System.out.println("hello"); + } + + + @Test + public void testDataBase(){ + ListnewUsers=userDao.findNewUser(); + for(User u:newUsers){ + System.out.println(u.getUsername()); + } + } + +} diff --git a/bbssource_common/src/test/test b/bbssource_common/src/test/test new file mode 100644 index 0000000..e69de29 diff --git a/forumER1.mwb b/forumER1.mwb new file mode 100644 index 0000000..498d35d Binary files /dev/null and b/forumER1.mwb differ diff --git a/forumErpdf.pdf b/forumErpdf.pdf new file mode 100644 index 0000000..3ac310d Binary files /dev/null and b/forumErpdf.pdf differ diff --git a/quark-common/pom.xml b/quark-common/pom.xml index 07f3a0c..a86471c 100644 --- a/quark-common/pom.xml +++ b/quark-common/pom.xml @@ -13,6 +13,9 @@ quark-common + + 1.8 + org.springframework.boot diff --git a/quark-common/src/main/java/com/quark/common/dao/UserDao.java b/quark-common/src/main/java/com/quark/common/dao/UserDao.java index 41623cb..dbe9353 100644 --- a/quark-common/src/main/java/com/quark/common/dao/UserDao.java +++ b/quark-common/src/main/java/com/quark/common/dao/UserDao.java @@ -17,7 +17,7 @@ public interface UserDao extends JpaRepository ,JpaSpecificationEx User findByEmail(String email); - @Query(value = "select u.id, u.username , u.icon from quark_user u where DATE_SUB(CURDATE(), INTERVAL 30 DAY) <=DATE(u.init_time) ORDER BY u.id DESC limit 12" ,nativeQuery = true) + @Query(value = "select * from quark_user u where DATE_SUB(CURDATE(), INTERVAL 3000 DAY) <=DATE(u.init_time) ORDER BY u.id DESC limit 12" ,nativeQuery = true) List findNewUser(); } diff --git a/quark-common/src/main/resources/application.properties b/quark-common/src/main/resources/application.properties index 39ffd43..df3133f 100644 --- a/quark-common/src/main/resources/application.properties +++ b/quark-common/src/main/resources/application.properties @@ -1,8 +1,8 @@ #Mysql配置 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.url=jdbc:mysql://127.0.0.1:3306/quarkCommunity?useUnicode=true&characterEncoding=UTF-8&useSSL=false -spring.datasource.username=root -spring.datasource.password=root +spring.datasource.username=ldy +spring.datasource.password=abcd1234 spring.datasource.driver-class-name=com.mysql.jdbc.Driver #jpa配置 diff --git a/quark-common/src/test/java/com/quark/common/CommonApplicationTest.java b/quark-common/src/test/java/com/quark/common/CommonApplicationTest.java index 1dfa416..25cda20 100644 --- a/quark-common/src/test/java/com/quark/common/CommonApplicationTest.java +++ b/quark-common/src/test/java/com/quark/common/CommonApplicationTest.java @@ -4,6 +4,7 @@ import com.quark.common.dao.NotificationDao; import com.quark.common.dao.PostsDao; import com.quark.common.dao.UserDao; +import com.quark.common.entity.User; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -12,6 +13,7 @@ import org.springframework.test.context.junit4.SpringRunner; import javax.sql.DataSource; +import java.util.List; /** * Created by lhr on 17-7-30. @@ -38,12 +40,7 @@ public class CommonApplicationTest { @Test public void TestDataSource(){ -// long count = notificationDao.getNotificationCount(72); -// System.out.println(count); -// List list = notificationDao.getByTouser(UserDao.findOne(2)); -// System.out.println(list); -// list.forEach(t->{ -// System.out.println(t.getPosts().getTitle()); -// }); + Listusers= UserDao.findNewUser(); + } } diff --git a/quark-parent/pom.xml b/quark-parent/pom.xml index fd6e573..5f33014 100644 --- a/quark-parent/pom.xml +++ b/quark-parent/pom.xml @@ -24,8 +24,12 @@ 1.9.22 2.8.0 2.2.2 + 1.8 + 1.8 + + diff --git a/quark-rest/pom.xml b/quark-rest/pom.xml index 3d9f3e6..f144a2a 100644 --- a/quark-rest/pom.xml +++ b/quark-rest/pom.xml @@ -14,8 +14,13 @@ quark-rest war - + + ${java.version} + ${java.version} + + + com.quark quark-common @@ -58,4 +63,6 @@ spring-messaging + + \ No newline at end of file diff --git a/quark-rest/src/main/java/com/quark/rest/service/impl/RankServiceImpl.java b/quark-rest/src/main/java/com/quark/rest/service/impl/RankServiceImpl.java index b332742..87261ae 100644 --- a/quark-rest/src/main/java/com/quark/rest/service/impl/RankServiceImpl.java +++ b/quark-rest/src/main/java/com/quark/rest/service/impl/RankServiceImpl.java @@ -27,6 +27,6 @@ public List findPostsRank() { @Override public List findUserRank() { - return userDao.findNewUser(); + return userDao.findNewUser(); } } diff --git a/quark-rest/src/main/java/com/quark/rest/utils/Constants.java b/quark-rest/src/main/java/com/quark/rest/utils/Constants.java index df6d82a..ae50a90 100644 --- a/quark-rest/src/main/java/com/quark/rest/utils/Constants.java +++ b/quark-rest/src/main/java/com/quark/rest/utils/Constants.java @@ -1,12 +1,26 @@ package com.quark.rest.utils; +import java.io.File; + /** * @Author LHR * Create By 2017/8/22 */ public class Constants { - //Upload常量 - public static final String UPLOAD_PATH = "D:\\home\\images\\upload\\"; - public static final String STATIC_URL ="http://127.0.0.1/images/upload/"; + + public static final String RELEATIVE_UPLOAD_PATH = "images/upload"; + //Upload常 + public static String UPLOAD_PATH = ""; + public static final String STATIC_URL = "http://127.0.0.1/" + RELEATIVE_UPLOAD_PATH; + + static { + UPLOAD_PATH = System.getProperty("user.home"); + if (UPLOAD_PATH.endsWith(File.separator)) { + UPLOAD_PATH = UPLOAD_PATH = File.separator; + } + UPLOAD_PATH = UPLOAD_PATH + RELEATIVE_UPLOAD_PATH; + + + } } diff --git a/quark-rest/src/main/resources/resource.properties b/quark-rest/src/main/resources/resource.properties index d7b98e1..916cdba 100644 --- a/quark-rest/src/main/resources/resource.properties +++ b/quark-rest/src/main/resources/resource.properties @@ -13,3 +13,4 @@ REDIS_USERID_KEY = quark:uid UPLOAD_PATH=D:\\home\\images\\upload\\ STATIC_URL=http://127.0.0.1/images/upload/ +server.httpurl="localhost:8081" diff --git a/quark-rest/src/main/resources/rest.properties b/quark-rest/src/main/resources/rest.properties index de5dfb7..3892b6c 100644 --- a/quark-rest/src/main/resources/rest.properties +++ b/quark-rest/src/main/resources/rest.properties @@ -1,10 +1,13 @@ #port server.port=8081 +#http url + + #log logging.level.org.springframework.web=DEBUG -#redis +#redis���� spring.redis.host=127.0.0.1 spring.redis.port=6379 #spring.redis.password=root @@ -14,11 +17,13 @@ spring.redis.pool.max-idle=8 spring.redis.pool.min-idle=0 spring.redis.timeout=0 -#ļϴ +#�ļ��ϴ� spring.http.multipart.max-file-size= 2MB -# +#������ spring.http.encoding.force=true spring.http.encoding.charset=UTF-8 spring.http.encoding.enabled=true -server.tomcat.uri-encoding=UTF-8 \ No newline at end of file +server.tomcat.uri-encoding=UTF-8 + + diff --git a/quark-rest/src/test/java/com/quark/rest/RestApplicationTest.java b/quark-rest/src/test/java/com/quark/rest/RestApplicationTest.java index 843cefe..66cb31c 100644 --- a/quark-rest/src/test/java/com/quark/rest/RestApplicationTest.java +++ b/quark-rest/src/test/java/com/quark/rest/RestApplicationTest.java @@ -6,17 +6,30 @@ import com.quark.rest.service.RedisService; import com.quark.rest.service.ReplyService; import com.quark.rest.service.UserService; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.http.HttpMethod; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.*; +import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.result.PrintingResultHandler; +import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; import javax.sql.DataSource; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; + /** * Created by lhr on 17-7-31. * user.setUsername("lhr"); @@ -53,6 +66,21 @@ public class RestApplicationTest { @Value("${REDIS_USERID_KEY}") private String REDIS_USERID_KEY; + + + private MockMvc mockMvc; + + private Logger logger= LoggerFactory.getLogger(this.getClass()); + + @Autowired + WebApplicationContext context; + + @Before + public void beforeConfigure() { + mockMvc = MockMvcBuilders.webAppContextSetup(context).build(); + + } + @Test public void testDataSource() { // userService.updateUserPassword("2a8e48c8-9d09-4ef4-892c-b3436070297c","12345678","123456"); @@ -61,6 +89,23 @@ public void testDataSource() { // redisService.deleteSet(REDIS_USERID_KEY,8); // System.out.println(redisService.setHasValue(REDIS_USERID_KEY,5)); // postsDao.findAll(); + System.out.println("say hello"); + } + + + @Test + public void testRestHeaders(){ + String userlogin="http://localhost:8081/user/login"; + RequestBuilder requestBuilder=MockMvcRequestBuilders.get(userlogin) + .param("name","jemmy") + .param("email","jemmy@oo.com"); + try { + mockMvc.perform(requestBuilder) + .andDo(print()); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/resource/sql/quarkcommunity.sql b/resource/sql/quarkcommunity.sql index fc7dcab..c3b76cb 100644 --- a/resource/sql/quarkcommunity.sql +++ b/resource/sql/quarkcommunity.sql @@ -13,20 +13,27 @@ File Encoding : 65001 Date: 2017-09-07 14:34:10 */ -SET FOREIGN_KEY_CHECKS=0; +CREATE DATABASE IF NOT EXISTS quarkCommunity + CHARACTER SET utf8 + COLLATE utf8_general_ci; +USE quarkCommunity; +SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for quark_adminuser -- ---------------------------- DROP TABLE IF EXISTS `quark_adminuser`; CREATE TABLE `quark_adminuser` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `enable` int(11) NOT NULL, - `password` varchar(255) NOT NULL, - `username` varchar(255) NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `enable` INT(11) NOT NULL, + `password` VARCHAR(255) NOT NULL, + `username` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_4erqa44qkwwkl539xouso7v4c` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 51 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_adminuser @@ -69,13 +76,15 @@ INSERT INTO `quark_adminuser` VALUES ('50', '1', '0db82a65c8f98f62e9670ba35ab7a1 -- ---------------------------- DROP TABLE IF EXISTS `quark_adminuser_role`; CREATE TABLE `quark_adminuser_role` ( - `adminuser_id` int(11) NOT NULL, - `role_id` int(11) NOT NULL, - PRIMARY KEY (`adminuser_id`,`role_id`), + `adminuser_id` INT(11) NOT NULL, + `role_id` INT(11) NOT NULL, + PRIMARY KEY (`adminuser_id`, `role_id`), KEY `FK26lllx1jn0c1k8f8oj2qt4io1` (`role_id`), CONSTRAINT `FK26lllx1jn0c1k8f8oj2qt4io1` FOREIGN KEY (`role_id`) REFERENCES `quark_role` (`id`), CONSTRAINT `FKatv5o94k3fooskwr53rvqfven` FOREIGN KEY (`adminuser_id`) REFERENCES `quark_adminuser` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_adminuser_role @@ -87,16 +96,18 @@ INSERT INTO `quark_adminuser_role` VALUES ('3', '1'); -- ---------------------------- DROP TABLE IF EXISTS `quark_collect`; CREATE TABLE `quark_collect` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `init_time` datetime DEFAULT NULL, - `posts_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `init_time` DATETIME DEFAULT NULL, + `posts_id` INT(11) NOT NULL, + `user_id` INT(11) NOT NULL, PRIMARY KEY (`id`), KEY `FK5a8rh83fve6ug3utggpy8wdvi` (`posts_id`), KEY `FKg4gtyqabrsuwr5y35lxvjy515` (`user_id`), CONSTRAINT `FK5a8rh83fve6ug3utggpy8wdvi` FOREIGN KEY (`posts_id`) REFERENCES `quark_posts` (`id`), CONSTRAINT `FKg4gtyqabrsuwr5y35lxvjy515` FOREIGN KEY (`user_id`) REFERENCES `quark_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_collect @@ -107,13 +118,16 @@ CREATE TABLE `quark_collect` ( -- ---------------------------- DROP TABLE IF EXISTS `quark_label`; CREATE TABLE `quark_label` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `details` varchar(255) DEFAULT NULL, - `name` varchar(255) NOT NULL, - `posts_count` int(11) DEFAULT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `details` VARCHAR(255) DEFAULT NULL, + `name` VARCHAR(255) NOT NULL, + `posts_count` INT(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_6vml4ba2itmaor84892v92b1f` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 10 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_label @@ -132,12 +146,12 @@ INSERT INTO `quark_label` VALUES ('9', '关于Android的话题', 'Android', '2') -- ---------------------------- DROP TABLE IF EXISTS `quark_notification`; CREATE TABLE `quark_notification` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `is_read` bit(1) DEFAULT NULL, - `fromuser_id` int(11) NOT NULL, - `posts_id` int(11) NOT NULL, - `touser_id` int(11) NOT NULL, - `init_time` datetime NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `is_read` BIT(1) DEFAULT NULL, + `fromuser_id` INT(11) NOT NULL, + `posts_id` INT(11) NOT NULL, + `touser_id` INT(11) NOT NULL, + `init_time` DATETIME NOT NULL, PRIMARY KEY (`id`), KEY `FKac4wjs0b3992ohkf61jy4ilmj` (`fromuser_id`), KEY `FKilg05a7ki3vkv7lfjnn57pdw2` (`posts_id`), @@ -145,7 +159,10 @@ CREATE TABLE `quark_notification` ( CONSTRAINT `FKac4wjs0b3992ohkf61jy4ilmj` FOREIGN KEY (`fromuser_id`) REFERENCES `quark_user` (`id`), CONSTRAINT `FKilg05a7ki3vkv7lfjnn57pdw2` FOREIGN KEY (`posts_id`) REFERENCES `quark_posts` (`id`), CONSTRAINT `FKquscxmtiqggsch7w833ywubux` FOREIGN KEY (`touser_id`) REFERENCES `quark_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 23 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_notification @@ -158,14 +175,17 @@ INSERT INTO `quark_notification` VALUES ('22', '', '71', '4', '2', '2017-09-07 -- ---------------------------- DROP TABLE IF EXISTS `quark_permission`; CREATE TABLE `quark_permission` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) DEFAULT NULL, - `perurl` varchar(255) DEFAULT NULL, - `sort` int(11) DEFAULT NULL, - `type` int(11) DEFAULT NULL, - `parentid` int(11) NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) DEFAULT NULL, + `perurl` VARCHAR(255) DEFAULT NULL, + `sort` INT(11) DEFAULT NULL, + `type` INT(11) DEFAULT NULL, + `parentid` INT(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 29 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_permission @@ -201,30 +221,37 @@ INSERT INTO `quark_permission` VALUES ('28', '修改标签', '/labels/update', ' -- ---------------------------- DROP TABLE IF EXISTS `quark_posts`; CREATE TABLE `quark_posts` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `content` text, - `good` bit(1) NOT NULL, - `init_time` datetime NOT NULL, - `label_id` int(11) DEFAULT NULL, - `reply_count` int(11) DEFAULT NULL, - `title` varchar(255) NOT NULL, - `top` bit(1) NOT NULL, - `user_id` int(11) NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `content` TEXT, + `good` BIT(1) NOT NULL, + `init_time` DATETIME NOT NULL, + `label_id` INT(11) DEFAULT NULL, + `reply_count` INT(11) DEFAULT NULL, + `title` VARCHAR(255) NOT NULL, + `top` BIT(1) NOT NULL, + `user_id` INT(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_46eh0lt2x9ftqcv9tjs8meqj8` (`title`), KEY `FK41ebsa5jpn18egdtjo6uiaugn` (`user_id`), KEY `FKnxd3qh1m3c0o6tc3ojfa8fm6o` (`label_id`), CONSTRAINT `FK41ebsa5jpn18egdtjo6uiaugn` FOREIGN KEY (`user_id`) REFERENCES `quark_user` (`id`), CONSTRAINT `FKnxd3qh1m3c0o6tc3ojfa8fm6o` FOREIGN KEY (`label_id`) REFERENCES `quark_label` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=214 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 214 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_posts -- ---------------------------- INSERT INTO `quark_posts` VALUES ('1', 'hahaha hello world Java', '\0', '2017-08-26 15:33:39', '1', '32', 'Hello World', '\0', '2'); INSERT INTO `quark_posts` VALUES ('2', 'hahaha hello world Java', '\0', '2017-08-26 15:46:53', '1', '0', 'Hello World Scala', '\0', '2'); -INSERT INTO `quark_posts` VALUES ('3', '测试发布内容', '\0', '2017-08-27 15:13:44', '1', '0', '测试发布', '\0', '2'); -INSERT INTO `quark_posts` VALUES ('4', '', '', '2017-08-27 15:49:42', '3', '22', '推荐连续剧《请回答1988》', '', '2'); +INSERT INTO `quark_posts` VALUES ('3', + '测试发布内容', + '\0', '2017-08-27 15:13:44', '1', '0', '测试发布', '\0', '2'); +INSERT INTO `quark_posts` VALUES + ('4', '', '', '2017-08-27 15:49:42', + '3', '22', '推荐连续剧《请回答1988》', '', '2'); INSERT INTO `quark_posts` VALUES ('105', '希鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁1', '\0', '2017-08-28 16:03:00', '1', '1', '测试帖子1', '\0', '2'); INSERT INTO `quark_posts` VALUES ('106', '希鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁2', '\0', '2017-08-28 16:03:00', '1', '0', '测试帖子2', '\0', '2'); INSERT INTO `quark_posts` VALUES ('107', '希鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁3', '\0', '2017-08-28 16:03:00', '1', '0', '测试帖子3', '\0', '2'); @@ -324,32 +351,50 @@ INSERT INTO `quark_posts` VALUES ('200', '希鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁 INSERT INTO `quark_posts` VALUES ('201', '希鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁97', '\0', '2017-08-28 16:03:06', '1', '0', '测试帖子97', '\0', '2'); INSERT INTO `quark_posts` VALUES ('202', '希鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁98', '\0', '2017-08-28 16:03:06', '1', '0', '测试帖子98', '\0', '2'); INSERT INTO `quark_posts` VALUES ('203', '希鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁鲁99', '\0', '2017-08-28 16:03:06', '1', '0', '测试帖子99', '\0', '2'); -INSERT INTO `quark_posts` VALUES ('205', '<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>', '', '2017-08-28 21:52:55', '4', '1', '在Spring boot中配置Thymeleaf', '\0', '2'); -INSERT INTO `quark_posts` VALUES ('206', '', '', '2017-08-28 22:46:59', '3', '1', 'Class文件装载流程', '\0', '2'); -INSERT INTO `quark_posts` VALUES ('208', '', '', '2017-09-01 22:01:27', '3', '2', 'JVM体系', '', '2'); -INSERT INTO `quark_posts` VALUES ('209', '', '\0', '2017-09-03 11:05:25', '5', '2', '探索R闪背后的奥秘', '\0', '71'); -INSERT INTO `quark_posts` VALUES ('210', 'filterChainDefinitionMap.put(\"/favicon.ico\",\"anon\");//解决弹出favicon.ico下载', '\0', '2017-09-03 11:07:21', '2', '4', 'shiro在登录的时候下载favicon.ico问题', '\0', '71'); -INSERT INTO `quark_posts` VALUES ('211', 'view结构', '\0', '2017-09-05 10:38:27', '9', '1', 'Android View机制', '\0', '72'); -INSERT INTO `quark_posts` VALUES ('212', '', '\0', '2017-09-05 10:38:59', '9', '4', '新人报到', '\0', '72'); -INSERT INTO `quark_posts` VALUES ('213', '1 先来先服务 - 时间片轮转调度\n这个很简单,就是谁先来,就给谁分配时间片运行,缺点是有些紧急的任务要很久才能得到运行。2. 优先级调度\n每个线程有一个优先级,CPU每次去拿优先级高的运行,优先级低的等等,为了避免优先级低的等太久,每等一定时间,就给优先级低的线程提高一个级别3.最短作业优先\n把线程任务量排序,每次拿处理时间短的线程运行,就像我去银行办业务一样,我的事情很快就处理完了,所以让我插队先办完,后面时间长的人先等等,时间长的人就很难得到响应了。4. 最高响应比优先\n用线程的等待时间除以服务时间,得到响应比,响应比小的优先运行。这样不会造成某些任务一直得不到响应。\n\n\n\n\n\n\n\n5.多级反馈队列调度\n有多个优先级不同的队列,每个队列里面有多个等待线程。\nCPU每次从优先级高的遍历到低的,取队首的线程运行,运行完了放回队尾,优先级越高,时间片越短,即响应越快,时间片大小就不是固定的了。\n每个队列的内部还是用先来先服务的策略。', '\0', '2017-09-07 10:21:06', '8', '6', '并发的CPU调度策略', '\0', '2'); +INSERT INTO `quark_posts` VALUES ('205', + '<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>', + '', '2017-08-28 21:52:55', '4', '1', '在Spring boot中配置Thymeleaf', '\0', '2'); +INSERT INTO `quark_posts` VALUES + ('206', '', '', + '2017-08-28 22:46:59', '3', '1', 'Class文件装载流程', '\0', '2'); +INSERT INTO `quark_posts` VALUES + ('208', '', '', + '2017-09-01 22:01:27', '3', '2', 'JVM体系', '', '2'); +INSERT INTO `quark_posts` VALUES + ('209', '', '\0', '2017-09-03 11:05:25', '5', '2', '探索R闪背后的奥秘', '\0', + '71'); +INSERT INTO `quark_posts` VALUES ('210', + 'filterChainDefinitionMap.put(\"/favicon.ico\",\"anon\");//解决弹出favicon.ico下载', + '\0', '2017-09-03 11:07:21', '2', '4', 'shiro在登录的时候下载favicon.ico问题', '\0', '71'); +INSERT INTO `quark_posts` VALUES + ('211', 'view结构', '\0', + '2017-09-05 10:38:27', '9', '1', 'Android View机制', '\0', '72'); +INSERT INTO `quark_posts` VALUES + ('212', '', '\0', '2017-09-05 10:38:59', '9', '4', '新人报到', '\0', '72'); +INSERT INTO `quark_posts` VALUES ('213', + '1 先来先服务 - 时间片轮转调度\n这个很简单,就是谁先来,就给谁分配时间片运行,缺点是有些紧急的任务要很久才能得到运行。2. 优先级调度\n每个线程有一个优先级,CPU每次去拿优先级高的运行,优先级低的等等,为了避免优先级低的等太久,每等一定时间,就给优先级低的线程提高一个级别3.最短作业优先\n把线程任务量排序,每次拿处理时间短的线程运行,就像我去银行办业务一样,我的事情很快就处理完了,所以让我插队先办完,后面时间长的人先等等,时间长的人就很难得到响应了。4. 最高响应比优先\n用线程的等待时间除以服务时间,得到响应比,响应比小的优先运行。这样不会造成某些任务一直得不到响应。\n\n\n\n\n\n\n\n5.多级反馈队列调度\n有多个优先级不同的队列,每个队列里面有多个等待线程。\nCPU每次从优先级高的遍历到低的,取队首的线程运行,运行完了放回队尾,优先级越高,时间片越短,即响应越快,时间片大小就不是固定的了。\n每个队列的内部还是用先来先服务的策略。', + '\0', '2017-09-07 10:21:06', '8', '6', '并发的CPU调度策略', '\0', '2'); -- ---------------------------- -- Table structure for quark_reply -- ---------------------------- DROP TABLE IF EXISTS `quark_reply`; CREATE TABLE `quark_reply` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `content` text NOT NULL, - `init_time` datetime DEFAULT NULL, - `up` int(11) NOT NULL, - `posts_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `content` TEXT NOT NULL, + `init_time` DATETIME DEFAULT NULL, + `up` INT(11) NOT NULL, + `posts_id` INT(11) NOT NULL, + `user_id` INT(11) NOT NULL, PRIMARY KEY (`id`), KEY `FKnr6a7xtk9rm31ptn6gchi9113` (`posts_id`), KEY `FKnt12hb9oqfm5eamjpg27bkpvv` (`user_id`), CONSTRAINT `FKnr6a7xtk9rm31ptn6gchi9113` FOREIGN KEY (`posts_id`) REFERENCES `quark_posts` (`id`), CONSTRAINT `FKnt12hb9oqfm5eamjpg27bkpvv` FOREIGN KEY (`user_id`) REFERENCES `quark_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 77 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_reply @@ -389,38 +434,60 @@ INSERT INTO `quark_reply` VALUES ('35', '希鲁鲁', '2017-08-30 22:42:38', '0', INSERT INTO `quark_reply` VALUES ('36', '测试', '2017-08-30 22:44:50', '0', '105', '2'); INSERT INTO `quark_reply` VALUES ('37', '不错啊不错哇', '2017-08-30 22:45:31', '0', '4', '2'); INSERT INTO `quark_reply` VALUES ('38', '不错啊不错哇', '2017-08-30 22:47:36', '0', '206', '2'); -INSERT INTO `quark_reply` VALUES ('39', '好剧,谢谢推荐', '2017-08-30 23:20:37', '0', '4', '2'); -INSERT INTO `quark_reply` VALUES ('40', '垃圾哥乱入', '2017-08-30 23:25:33', '0', '4', '2'); +INSERT INTO `quark_reply` +VALUES ('39', '好剧,谢谢推荐', '2017-08-30 23:20:37', '0', '4', '2'); +INSERT INTO `quark_reply` VALUES ('40', + '垃圾哥乱入', + '2017-08-30 23:25:33', '0', '4', '2'); INSERT INTO `quark_reply` VALUES ('41', '不错', '2017-08-30 23:26:34', '0', '4', '2'); INSERT INTO `quark_reply` VALUES ('42', '哈哈', '2017-08-30 23:27:55', '0', '4', '2'); -INSERT INTO `quark_reply` VALUES ('43', '铁打的父母流水的孩子~', '2017-08-30 23:29:51', '0', '4', '2'); -INSERT INTO `quark_reply` VALUES ('44', '好看', '2017-08-31 14:57:03', '0', '4', '2'); +INSERT INTO `quark_reply` +VALUES ('43', '铁打的父母流水的孩子~', '2017-08-30 23:29:51', '0', '4', '2'); +INSERT INTO `quark_reply` VALUES ('44', + '好看', + '2017-08-31 14:57:03', '0', '4', '2'); INSERT INTO `quark_reply` VALUES ('45', '好好好', '2017-08-31 15:05:10', '0', '4', '2'); -INSERT INTO `quark_reply` VALUES ('46', '牛逼', '2017-08-31 15:35:15', '0', '4', '2'); -INSERT INTO `quark_reply` VALUES ('47', '不错,很清晰', '2017-09-01 22:01:43', '0', '208', '2'); -INSERT INTO `quark_reply` VALUES ('48', '厉害啊', '2017-09-03 11:32:23', '0', '210', '2'); -INSERT INTO `quark_reply` VALUES ('49', '', '2017-09-05 10:26:14', '0', '209', '2'); -INSERT INTO `quark_reply` VALUES ('50', '有意思', '2017-09-05 10:32:42', '0', '210', '72'); -INSERT INTO `quark_reply` VALUES ('51', '很清晰', '2017-09-05 10:39:18', '0', '211', '2'); +INSERT INTO `quark_reply` +VALUES ('46', '牛逼', '2017-08-31 15:35:15', '0', '4', '2'); +INSERT INTO `quark_reply` +VALUES ('47', '不错,很清晰', '2017-09-01 22:01:43', '0', '208', '2'); +INSERT INTO `quark_reply` +VALUES ('48', '厉害啊', '2017-09-03 11:32:23', '0', '210', '2'); +INSERT INTO `quark_reply` +VALUES ('49', '', '2017-09-05 10:26:14', '0', '209', '2'); +INSERT INTO `quark_reply` VALUES + ('50', '有意思', '2017-09-05 10:32:42', + '0', '210', '72'); +INSERT INTO `quark_reply` +VALUES ('51', '很清晰', '2017-09-05 10:39:18', '0', '211', '2'); INSERT INTO `quark_reply` VALUES ('52', '?', '2017-09-06 15:43:18', '0', '212', '2'); -INSERT INTO `quark_reply` VALUES ('53', '不错嘛', '2017-09-06 15:45:58', '0', '205', '2'); -INSERT INTO `quark_reply` VALUES ('54', '新人爆照', '2017-09-06 16:27:28', '0', '212', '2'); -INSERT INTO `quark_reply` VALUES ('55', '希鲁鲁鲁', '2017-09-06 16:36:25', '0', '212', '71'); -INSERT INTO `quark_reply` VALUES ('56', '希鲁鲁鲁', '2017-09-06 16:36:26', '0', '212', '71'); +INSERT INTO `quark_reply` VALUES + ('53', '不错嘛', '2017-09-06 15:45:58', + '0', '205', '2'); +INSERT INTO `quark_reply` +VALUES ('54', '新人爆照', '2017-09-06 16:27:28', '0', '212', '2'); +INSERT INTO `quark_reply` +VALUES ('55', '希鲁鲁鲁', '2017-09-06 16:36:25', '0', '212', '71'); +INSERT INTO `quark_reply` +VALUES ('56', '希鲁鲁鲁', '2017-09-06 16:36:26', '0', '212', '71'); INSERT INTO `quark_reply` VALUES ('57', '不错嘛', '2017-09-06 20:22:16', '0', '4', '71'); INSERT INTO `quark_reply` VALUES ('58', '对啊', '2017-09-06 20:28:36', '0', '210', '2'); INSERT INTO `quark_reply` VALUES ('59', '不错', '2017-09-06 20:36:17', '0', '4', '2'); INSERT INTO `quark_reply` VALUES ('60', '居然自问自答,呵呵', '2017-09-06 20:36:32', '0', '4', '71'); INSERT INTO `quark_reply` VALUES ('61', '再看看自问自答是否修复了', '2017-09-06 20:41:01', '0', '4', '2'); INSERT INTO `quark_reply` VALUES ('62', '很强势啊,试试推送功能', '2017-09-06 20:41:42', '0', '208', '71'); -INSERT INTO `quark_reply` VALUES ('63', '测试推送?', '2017-09-07 10:03:03', '0', '210', '2'); +INSERT INTO `quark_reply` +VALUES ('63', '测试推送?', '2017-09-07 10:03:03', '0', '210', '2'); INSERT INTO `quark_reply` VALUES ('64', '很实用', '2017-09-07 10:21:23', '0', '213', '71'); -INSERT INTO `quark_reply` VALUES ('65', '简直无解', '2017-09-07 10:21:47', '0', '213', '71'); +INSERT INTO `quark_reply` VALUES ('65', + '简直无解', + '2017-09-07 10:21:47', '0', '213', '71'); INSERT INTO `quark_reply` VALUES ('66', '很好', '2017-09-07 10:22:19', '0', '213', '71'); INSERT INTO `quark_reply` VALUES ('67', '测试推送', '2017-09-07 10:24:43', '0', '213', '71'); INSERT INTO `quark_reply` VALUES ('68', '测试测试测试', '2017-09-07 10:25:30', '0', '213', '71'); INSERT INTO `quark_reply` VALUES ('69', '测试推送', '2017-09-07 10:27:51', '0', '213', '71'); -INSERT INTO `quark_reply` VALUES ('70', '', '2017-09-07 10:39:33', '0', '209', '2'); +INSERT INTO `quark_reply` +VALUES ('70', '', '2017-09-07 10:39:33', '0', '209', '2'); INSERT INTO `quark_reply` VALUES ('71', '测试推送', '2017-09-07 11:02:23', '0', '4', '71'); INSERT INTO `quark_reply` VALUES ('72', '测试推送', '2017-09-07 11:04:15', '0', '4', '71'); INSERT INTO `quark_reply` VALUES ('73', '测试推送', '2017-09-07 11:12:22', '0', '4', '71'); @@ -433,12 +500,15 @@ INSERT INTO `quark_reply` VALUES ('76', '真.最后一次测试了', '2017-09-07 -- ---------------------------- DROP TABLE IF EXISTS `quark_role`; CREATE TABLE `quark_role` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `description` varchar(255) DEFAULT NULL, - `name` varchar(255) NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `description` VARCHAR(255) DEFAULT NULL, + `name` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_ff572j64wr6y4taed1c27vfo6` (`name`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 7 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_role @@ -451,13 +521,15 @@ INSERT INTO `quark_role` VALUES ('6', '管理用户', '用户管理员'); -- ---------------------------- DROP TABLE IF EXISTS `quark_role_permission`; CREATE TABLE `quark_role_permission` ( - `role_id` int(11) NOT NULL, - `permissions_id` int(11) NOT NULL, - PRIMARY KEY (`role_id`,`permissions_id`), + `role_id` INT(11) NOT NULL, + `permissions_id` INT(11) NOT NULL, + PRIMARY KEY (`role_id`, `permissions_id`), KEY `FKlsdkf5vtsq5qvepw45r0y89jw` (`permissions_id`), CONSTRAINT `FK763ep4ix05naeoliv21sm6m81` FOREIGN KEY (`role_id`) REFERENCES `quark_role` (`id`), CONSTRAINT `FKlsdkf5vtsq5qvepw45r0y89jw` FOREIGN KEY (`permissions_id`) REFERENCES `quark_permission` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_role_permission @@ -496,88 +568,227 @@ INSERT INTO `quark_role_permission` VALUES ('1', '28'); -- ---------------------------- DROP TABLE IF EXISTS `quark_user`; CREATE TABLE `quark_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `icon` varchar(255) NOT NULL, - `enable` int(11) NOT NULL, - `init_time` datetime NOT NULL, - `password` varchar(255) NOT NULL, - `sex` int(11) DEFAULT NULL, - `signature` varchar(255) DEFAULT NULL, - `username` varchar(255) NOT NULL, - `email` varchar(255) NOT NULL, + `id` INT(11) NOT NULL AUTO_INCREMENT, + `icon` VARCHAR(255) NOT NULL, + `enable` INT(11) NOT NULL, + `init_time` DATETIME NOT NULL, + `password` VARCHAR(255) NOT NULL, + `sex` INT(11) DEFAULT NULL, + `signature` VARCHAR(255) DEFAULT NULL, + `username` VARCHAR(255) NOT NULL, + `email` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_2uqfoo05i1p5qm4ntysj2ivbs` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8; +) + ENGINE = InnoDB + AUTO_INCREMENT = 73 + DEFAULT CHARSET = utf8; -- ---------------------------- -- Records of quark_user -- ---------------------------- -INSERT INTO `quark_user` VALUES ('2', 'http://127.0.0.1/images/upload/2017-09-06/70e5b07c-4609-4925-bb1f-e965daa65899.jpeg', '1', '2017-08-22 23:10:17', '25d55ad283aa400af464c76d713c07ad', '0', 'Java从入门到弃坑', 'lhr1988', '1420432344@qq.com'); -INSERT INTO `quark_user` VALUES ('5', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 10:37:28', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '丁三石', '163@163.com'); -INSERT INTO `quark_user` VALUES ('6', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 11:56:38', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '马化腾', 'qq@qq.com'); -INSERT INTO `quark_user` VALUES ('7', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵0号', '0tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('8', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵1号', '1tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('9', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵2号', '2tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('10', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵3号', '3tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('11', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵4号', '4tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('12', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵5号', '5tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('13', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵6号', '6tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('14', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵7号', '7tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('15', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵8号', '8tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('16', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵9号', '9tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('17', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵10号', '10tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('18', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵11号', '11tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('19', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵12号', '12tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('20', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵13号', '13tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('21', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵14号', '14tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('22', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵15号', '15tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('23', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵16号', '16tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('24', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵17号', '17tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('25', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵18号', '18tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('26', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵19号', '19tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('27', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵20号', '20tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('28', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵21号', '21tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('29', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵22号', '22tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('30', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵23号', '23tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('31', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵24号', '24tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('32', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵25号', '25tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('33', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵26号', '26tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('34', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵27号', '27tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('35', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵28号', '28tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('36', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:25', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵29号', '29tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('37', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵30号', '30tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('38', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵31号', '31tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('39', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵32号', '32tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('40', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵33号', '33tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('41', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵34号', '34tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('42', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵35号', '35tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('43', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵36号', '36tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('44', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵37号', '37tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('45', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵38号', '38tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('46', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵39号', '39tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('47', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵40号', '40tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('48', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵41号', '41tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('49', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵42号', '42tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('50', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵43号', '43tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('51', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵44号', '44tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('52', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵45号', '45tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('53', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵46号', '46tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('54', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵47号', '47tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('55', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵48号', '48tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('56', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵49号', '49tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('57', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵50号', '50tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('58', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵51号', '51tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('59', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵52号', '52tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('60', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵53号', '53tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('61', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵54号', '54tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('62', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵55号', '55tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('63', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵56号', '56tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('64', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵57号', '57tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('65', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵58号', '58tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('66', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '图灵59号', '59tulin@gmail.com'); -INSERT INTO `quark_user` VALUES ('67', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-26 15:03:21', 'f379eaf3c831b04de153469d1bec345e', '0', null, '拉里·佩奇', 'gmail@gmail.com'); -INSERT INTO `quark_user` VALUES ('68', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-26 22:29:11', 'e10adc3949ba59abbe56e057f20f883e', '0', null, '比尔盖茨', 'Microsoft@Outlook.com'); -INSERT INTO `quark_user` VALUES ('69', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-27 10:35:14', 'c8837b23ff8aaa8a2dde915473ce0991', '0', null, 'cc', '111@cc.com'); -INSERT INTO `quark_user` VALUES ('70', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-31 12:13:54', 'e10adc3949ba59abbe56e057f20f883e', '0', null, 'CCTV旗下品牌', 'ccav@china.com'); -INSERT INTO `quark_user` VALUES ('71', 'http://127.0.0.1/images/upload/2017-09-03/51fb238d-00a3-49d2-91c5-25d1e54fff3e.jpeg', '1', '2017-09-03 11:04:03', 'e10adc3949ba59abbe56e057f20f883e', '1', '一库~~~~', '盲僧李青', 'lol@lol.com'); -INSERT INTO `quark_user` VALUES ('72', 'http://127.0.0.1/images/upload/2017-09-05/679e2736-54b5-4d73-b38f-b7b7ab61e3c1.jpeg', '1', '2017-09-05 10:31:27', 'e10adc3949ba59abbe56e057f20f883e', '1', '汪汪汪~~~', '萨摩王~', 'sa@sa.com'); +INSERT INTO `quark_user` VALUES + ('2', 'http://127.0.0.1/images/upload/2017-09-06/70e5b07c-4609-4925-bb1f-e965daa65899.jpeg', '1', '2017-08-22 23:10:17', + '25d55ad283aa400af464c76d713c07ad', '0', 'Java从入门到弃坑', 'lhr1988', '1420432344@qq.com'); +INSERT INTO `quark_user` VALUES + ('5', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 10:37:28', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '丁三石', + '163@163.com'); +INSERT INTO `quark_user` VALUES + ('6', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 11:56:38', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '马化腾', 'qq@qq.com'); +INSERT INTO `quark_user` VALUES + ('7', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵0号', + '0tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('8', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵1号', + '1tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('9', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵2号', + '2tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('10', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵3号', + '3tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('11', 'http://127.0.0.1/images/upload/default.png', '0', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵4号', + '4tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('12', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:23', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵5号', + '5tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('13', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵6号', + '6tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('14', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵7号', + '7tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('15', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵8号', + '8tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('16', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵9号', + '9tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('17', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵10号', + '10tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('18', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵11号', + '11tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('19', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵12号', + '12tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('20', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵13号', + '13tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('21', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵14号', + '14tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('22', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵15号', + '15tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('23', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵16号', + '16tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('24', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵17号', + '17tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('25', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵18号', + '18tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('26', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵19号', + '19tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('27', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵20号', + '20tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('28', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵21号', + '21tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('29', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵22号', + '22tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('30', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵23号', + '23tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('31', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵24号', + '24tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('32', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵25号', + '25tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('33', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵26号', + '26tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('34', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵27号', + '27tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('35', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:24', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵28号', + '28tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('36', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:51:25', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵29号', + '29tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('37', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵30号', + '30tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('38', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵31号', + '31tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('39', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵32号', + '32tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('40', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵33号', + '33tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('41', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵34号', + '34tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('42', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵35号', + '35tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('43', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:18', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵36号', + '36tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('44', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵37号', + '37tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('45', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵38号', + '38tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('46', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵39号', + '39tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('47', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵40号', + '40tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('48', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵41号', + '41tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('49', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵42号', + '42tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('50', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵43号', + '43tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('51', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵44号', + '44tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('52', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵45号', + '45tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('53', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵46号', + '46tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('54', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵47号', + '47tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('55', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵48号', + '48tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('56', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵49号', + '49tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('57', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵50号', + '50tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('58', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵51号', + '51tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('59', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵52号', + '52tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('60', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵53号', + '53tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('61', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:19', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵54号', + '54tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('62', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵55号', + '55tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('63', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵56号', + '56tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('64', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵57号', + '57tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('65', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵58号', + '58tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('66', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-25 20:52:20', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '图灵59号', + '59tulin@gmail.com'); +INSERT INTO `quark_user` VALUES + ('67', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-26 15:03:21', 'f379eaf3c831b04de153469d1bec345e', '0', NULL, '拉里·佩奇', + 'gmail@gmail.com'); +INSERT INTO `quark_user` VALUES + ('68', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-26 22:29:11', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, '比尔盖茨', + 'Microsoft@Outlook.com'); +INSERT INTO `quark_user` VALUES + ('69', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-27 10:35:14', 'c8837b23ff8aaa8a2dde915473ce0991', '0', NULL, 'cc', '111@cc.com'); +INSERT INTO `quark_user` VALUES + ('70', 'http://127.0.0.1/images/upload/default.png', '1', '2017-08-31 12:13:54', 'e10adc3949ba59abbe56e057f20f883e', '0', NULL, 'CCTV旗下品牌', + 'ccav@china.com'); +INSERT INTO `quark_user` VALUES + ('71', 'http://127.0.0.1/images/upload/2017-09-03/51fb238d-00a3-49d2-91c5-25d1e54fff3e.jpeg', '1', '2017-09-03 11:04:03', + 'e10adc3949ba59abbe56e057f20f883e', '1', '一库~~~~', '盲僧李青', 'lol@lol.com'); +INSERT INTO `quark_user` VALUES + ('72', 'http://127.0.0.1/images/upload/2017-09-05/679e2736-54b5-4d73-b38f-b7b7ab61e3c1.jpeg', '1', '2017-09-05 10:31:27', + 'e10adc3949ba59abbe56e057f20f883e', '1', '汪汪汪~~~', '萨摩王~', 'sa@sa.com');
测试发布内容
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
filterChainDefinitionMap.put(\"/favicon.ico\",\"anon\");//解决弹出favicon.ico下载
1 先来先服务 - 时间片轮转调度\n这个很简单,就是谁先来,就给谁分配时间片运行,缺点是有些紧急的任务要很久才能得到运行。
2. 优先级调度\n每个线程有一个优先级,CPU每次去拿优先级高的运行,优先级低的等等,为了避免优先级低的等太久,每等一定时间,就给优先级低的线程提高一个级别
3.最短作业优先\n把线程任务量排序,每次拿处理时间短的线程运行,就像我去银行办业务一样,我的事情很快就处理完了,所以让我插队先办完,后面时间长的人先等等,时间长的人就很难得到响应了。
4. 最高响应比优先\n用线程的等待时间除以服务时间,得到响应比,响应比小的优先运行。这样不会造成某些任务一直得不到响应。
\n\n\n\n\n\n\n\n
5.多级反馈队列调度\n有多个优先级不同的队列,每个队列里面有多个等待线程。\nCPU每次从优先级高的遍历到低的,取队首的线程运行,运行完了放回队尾,优先级越高,时间片越短,即响应越快,时间片大小就不是固定的了。\n每个队列的内部还是用先来先服务的策略。
垃圾哥乱入
好看