listRobots();
15 | }
16 |
--------------------------------------------------------------------------------
/thoth-ai-ms/thoth-ai-web/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 |
--------------------------------------------------------------------------------
/thoth-ai-ms/thoth-ai-web/src/main/java/com/prometheus/thoth/AIMsApplication.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 |
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 | import org.springframework.cloud.netflix.feign.EnableFeignClients;
8 |
9 | /**
10 | * Created by sunliangliang
11 | */
12 |
13 | @EnableEurekaClient
14 | @SpringBootApplication
15 | @EnableFeignClients
16 | public class AIMsApplication{
17 |
18 | public static void main(String[] args) {
19 | SpringApplication.run(AIMsApplication.class, args);
20 | }
21 | }
--------------------------------------------------------------------------------
/thoth-ai-ms/thoth-ai-web/src/main/resources/bootstrap.properties:
--------------------------------------------------------------------------------
1 | eureka.client.serviceUrl.defaultZone=http://registry-server:7777/eureka/
2 |
3 | spring.cloud.config.discovery.enabled=true
4 | spring.cloud.config.discovery.service-id=thoth-config-server
5 | management.security.enabled=false
6 | spring.cloud.config.label= master
7 |
8 | spring.cloud.config.name=thoth-ai-ms
9 | spring.application.name=thoth-ai-ms
10 | spring.cloud.config.profile = ${config.profile:dev}
11 |
12 | eureka.instance.prefer-ip-address= true
--------------------------------------------------------------------------------
/thoth-ai-ms/thoth-ai-web/src/test/resources/application-test.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-spiritcenter-web-test
2 |
3 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/thoth_dev?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
4 | spring.datasource.username=app_cloudcs_im
5 | spring.datasource.password=app_cloudcs_1
6 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver
7 |
8 | spring.datasource.schema=classpath:sql/schema.sql
9 | spring.datasource.data=classpath:sql/data.sql
10 | spring.h2.console.enabled=true
--------------------------------------------------------------------------------
/thoth-ai-ms/thoth-ai-web/src/test/resources/logback-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
7 |
8 | System.out
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/thoth-config-server/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | target/
--------------------------------------------------------------------------------
/thoth-config-server/README.md:
--------------------------------------------------------------------------------
1 | #### 该项目是springcloud的配置中心
2 | * 所有的微服务的配置文件统一由此处管理
3 | * 这个要在微服务启动前启动,该项目所使用的配置中心仓库为
4 | `https://github.com/liangliang1259/thoth-config-repository.git`
5 | * 请在[配置中心中修改]()
6 |
7 |
--------------------------------------------------------------------------------
/thoth-config-server/src/main/java/com/prometheus/ConfigServerApplication.java:
--------------------------------------------------------------------------------
1 | package com.prometheus;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.config.server.EnableConfigServer;
6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 |
8 | /**
9 | * @author liangliang
10 | */
11 | @SpringBootApplication
12 | @EnableEurekaClient
13 | @EnableConfigServer
14 | public class ConfigServerApplication {
15 | public static void main(String[] args) {
16 | SpringApplication.run(ConfigServerApplication.class, args);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/thoth-config-server/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | spring.application.name=thoth-config-server
2 | server.port=12222
3 |
4 | spring.cloud.config.server.git.uri=https://github.com/liangliang1259/thoth-config-repository.git
5 | spring.cloud.config.server.git.searchPaths=respo
6 | spring.cloud.config.label=v1.0
7 | spring.cloud.config.server.git.password=root
8 | spring.cloud.config.server.git.username=123456
9 |
10 | eureka.client.serviceUrl.defaultZone=http://registry-server:7777/eureka/
--------------------------------------------------------------------------------
/thoth-registry-server/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | *.iml
3 |
--------------------------------------------------------------------------------
/thoth-registry-server/README.md:
--------------------------------------------------------------------------------
1 | #### springcloud的注册中心
2 | * 所有的微服务都注册到此处由此处统一管理
3 | * 这个要在微服务启动前,启动
--------------------------------------------------------------------------------
/thoth-registry-server/src/main/java/com/prometheus/EurekaServerApplication.java:
--------------------------------------------------------------------------------
1 | package com.prometheus;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6 |
7 | /**
8 | * @author liangliang
9 | *
10 | */
11 | @EnableEurekaServer
12 | @SpringBootApplication
13 | public class EurekaServerApplication
14 | {
15 | public static void main( String[] args )
16 | {
17 | SpringApplication.run(EurekaServerApplication.class, args);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/thoth-registry-server/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | server.port = 7777
2 | eureka.instance.prefer-ip-address= true
3 | eureka.client.register-with-eureka = false
4 | eureka.client.fetch-registry = false
5 | eureka.client.service-url.defaultZone= http://registry-server:${server.port}/eureka/
6 |
--------------------------------------------------------------------------------
/thoth-robot-ms/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | .springBeans
4 | .settings/
5 | target/
6 | *.iml
7 | .idea/
8 | logs/
--------------------------------------------------------------------------------
/thoth-robot-ms/README.md:
--------------------------------------------------------------------------------
1 | # thoth-robot
2 |
3 | * **机器人管理**
4 |
5 |
6 | * **v0.1.0-SNAPSHOT**:Project init
7 |
8 |
9 | 使用配置中心,切记在pom.xml中添加如下
10 | ```
11 |
12 | org.springframework.cloud
13 | spring-cloud-starter-config
14 |
15 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-common/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-common/src/main/java/com/prometheus/thoth/utils/RobotConstants.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.utils;
2 |
3 | /**
4 | * created by sunliangliang
5 | */
6 | public class RobotConstants {
7 | public static int NOTIFY_ROBOT_SUCCESS = 1;
8 | public static int NOTIFY_ROBOT_FAILURE = 0;
9 | /**message类型*/
10 | public static int COMMON_MSG_WELCOME = 0;
11 | public static int COMMON_MSG_UNKNOW_ANSWER = 1;
12 | }
13 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-common/src/main/java/com/prometheus/thoth/utils/TenantUtils.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.utils;
2 |
3 | /**
4 | * created by sunliangliang
5 | * @author sunliangliang
6 | * 获取租户相关信息
7 | */
8 | public class TenantUtils {
9 | public static Long getTenantId(){
10 |
11 | return 1001L;
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-entity/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-entity/src/main/java/com/prometheus/thoth/robot/entity/Industry.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.robot.entity;
2 |
3 | public class Industry {
4 | private Integer id;
5 | private String name;
6 |
7 | public Integer getId() {
8 | return id;
9 | }
10 |
11 | public void setId(Integer id) {
12 | this.id = id;
13 | }
14 |
15 | public String getName() {
16 | return name;
17 | }
18 |
19 | public void setName(String name) {
20 | this.name = name;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-service/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-service/src/main/java/com/prometheus/thoth/robot/service/LibFeignClient.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.robot.service;
2 |
3 | import org.springframework.cloud.netflix.feign.FeignClient;
4 |
5 | /**
6 | * created by sunliangliang
7 | * 获取知识库相关信息
8 | */
9 | @FeignClient("clazz-ms")
10 | public interface LibFeignClient {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-service/src/main/java/com/prometheus/thoth/robot/service/RobotAiFeignClient.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.robot.service;
2 |
3 | /**
4 | * created by sunliangliang
5 | * 调用AI接口
6 | */
7 | public class RobotAiFeignClient {
8 | }
9 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-web/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 |
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-web/src/main/java/com/prometheus/thoth/RobotMsApplication.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 |
4 | import org.springframework.boot.SpringApplication;
5 | import org.springframework.boot.autoconfigure.SpringBootApplication;
6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
7 | import org.springframework.cloud.netflix.feign.EnableFeignClients;
8 |
9 | /**
10 | * Created by sunliangliang
11 | */
12 |
13 | @EnableEurekaClient
14 | @SpringBootApplication
15 | @EnableFeignClients
16 | public class RobotMsApplication{
17 |
18 | public static void main(String[] args) {
19 | SpringApplication.run(RobotMsApplication.class, args);
20 | }
21 | }
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-web/src/main/resources/bootstrap.properties:
--------------------------------------------------------------------------------
1 | eureka.client.serviceUrl.defaultZone=http://registry-server:7777/eureka/
2 |
3 | spring.cloud.config.discovery.enabled=true
4 | spring.cloud.config.discovery.service-id=thoth-config-server
5 | management.security.enabled=false
6 | spring.cloud.config.label= v1.0
7 |
8 | spring.cloud.config.name=thoth-robot-ms
9 | spring.application.name=thoth-robot-ms
10 | spring.cloud.config.profile = ${config.profile:test}
11 |
12 | eureka.instance.prefer-ip-address= true
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-web/src/test/resources/application-test.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-spiritcenter-web-test
2 |
3 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/thoth_dev?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
4 | spring.datasource.username=app_cloudcs_im
5 | spring.datasource.password=app_cloudcs_1
6 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver
7 |
8 | spring.datasource.schema=classpath:sql/schema.sql
9 | spring.datasource.data=classpath:sql/data.sql
10 | spring.h2.console.enabled=true
--------------------------------------------------------------------------------
/thoth-robot-ms/thoth-robot-web/src/test/resources/logback-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
7 |
8 | System.out
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/thoth/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 |
12 | ### IntelliJ IDEA ###
13 | .idea
14 | *.iws
15 | *.iml
16 | *.ipr
17 |
18 | ### NetBeans ###
19 | nbproject/private/
20 | build/
21 | nbbuild/
22 | dist/
23 | nbdist/
24 | .nb-gradle/
25 | thoth-registry-server/
26 | thoth-config-server/
27 | thoth-common/target/
28 | thoth-clazz-ms/
29 | thoth-lib-ms/
30 |
--------------------------------------------------------------------------------
/thoth/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SpringForAll/springcloud-thoth/8849ecdc645d90fbbab0be707b6129610abf76b2/thoth/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/thoth/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip
2 |
--------------------------------------------------------------------------------
/thoth/thoth-common/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/exception/ApplicationException.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.exception;
2 |
3 | /**
4 | * 应用异常.
5 | *
6 | * Created by liangliang on 2017/02/17.
7 | */
8 | public class ApplicationException extends RuntimeException {
9 |
10 | public ApplicationException() {
11 | super();
12 | }
13 |
14 | public ApplicationException(String message) {
15 | super(message);
16 | }
17 |
18 | public ApplicationException(Throwable cause) {
19 | super(cause);
20 | }
21 |
22 | public ApplicationException(String message, Throwable cause) {
23 | super(message, cause);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/exception/ErrorCode.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.exception;
2 |
3 | /**
4 | * Created by liangliang on 2017/02/16.
5 | */
6 | public interface ErrorCode {
7 |
8 | int getCode();
9 |
10 | String getMessage();
11 | }
12 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/service/BasePageService.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.service;
2 |
3 |
4 | import com.prometheus.thoth.common.model.PageInfo;
5 |
6 | /**
7 | * Created by liangliang on 2017/02/25.
8 | *
9 | * @author liangliang
10 | * @since 2017/02/25
11 | */
12 | public interface BasePageService extends BaseService {
13 |
14 | PageInfo listPage(PageInfo pageInfo, T entity);
15 | }
16 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/service/BaseService.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.service;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * Created by liangliang on 2017/02/16.
7 | */
8 | public interface BaseService {
9 |
10 | Boolean save(T entity);
11 |
12 | Boolean update(T entity);
13 |
14 | Boolean delete(Long id);
15 |
16 | T getById(Long id);
17 |
18 | List listAll();
19 |
20 | List listAll(T entity);
21 | }
22 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/service/LoggerService.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.service;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 |
6 | /**
7 | * Created by liangliang on 2017/02/17.
8 | */
9 | public abstract class LoggerService {
10 |
11 | protected final Logger logger = LoggerFactory.getLogger(this.getClass());
12 | }
13 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/util/IdUtils.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.util;
2 |
3 |
4 | import com.prometheus.thoth.common.exception.GlobalErrorCode;
5 |
6 | /**
7 | * Created by liangliang on 2017/04/27.
8 | *
9 | * @author liangliang
10 | * @since 2017/04/27
11 | */
12 | public class IdUtils {
13 |
14 | public static String getId(Long tenantId, String bizId) {
15 | AssertUtils.notNull(tenantId, GlobalErrorCode.TENANTID_ID_NOT_EMPTY);
16 | return String.format("%s:%s", tenantId, bizId);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/util/RegXUtils.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.util;
2 |
3 | import java.util.regex.Matcher;
4 | import java.util.regex.Pattern;
5 |
6 | /**
7 | * Created by liangliang on 2017/3/20.
8 | */
9 | public class RegXUtils {
10 |
11 | public static boolean ifMatch(String src, String regx) {
12 | String str = src;
13 | // 邮箱验证规则
14 | String regEx = regx;
15 | // 编译正则表达式
16 | Pattern pattern = Pattern.compile(regEx);
17 | // 忽略大小写的写法
18 | Matcher matcher = pattern.matcher(str);
19 | // 字符串是否与正则表达式相匹配
20 | boolean rs = matcher.matches();
21 |
22 | return rs;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/util/StringUtils.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.util;
2 |
3 | /**
4 | * Created by liangliang on 2017/02/13.
5 | */
6 | public class StringUtils extends org.apache.commons.lang3.StringUtils {
7 | }
8 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/java/com/prometheus/thoth/common/web/controller/BaseController.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.common.web.controller;
2 |
3 | import org.slf4j.Logger;
4 | import org.slf4j.LoggerFactory;
5 |
6 | /**
7 | * Created by liangliang on 2017/02/16.
8 | */
9 | public abstract class BaseController {
10 |
11 | protected final Logger logger = LoggerFactory.getLogger(this.getClass());
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/thoth/thoth-common/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | # Auto Configure
2 |
--------------------------------------------------------------------------------
/thoth/thoth-data-es/README.md:
--------------------------------------------------------------------------------
1 | # thoth-data-es
2 |
3 |
4 | ## es ik
5 |
6 | - _analyze?analyzer=ik&pretty=true&text=helloworld,中国人
7 |
--------------------------------------------------------------------------------
/thoth/thoth-data-es/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2 | com.prometheus.thoth.data.es.config.ElasticsearchAutoConfiguration
--------------------------------------------------------------------------------
/thoth/thoth-data-es/src/test/java/com/prometheus/thoth/Application.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | /**
7 | * Created by ${USER} on ${DATE}.
8 | */
9 | @SpringBootApplication
10 | public class Application {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(Application.class, args);
14 | }
15 | }
--------------------------------------------------------------------------------
/thoth/thoth-data-es/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-data-es
2 |
3 | management.security.enabled=false
4 |
5 | es.cluster-name=thoth-data-es
6 | es.cluster-nodes=10.12.28.195:9300,10.12.28.211:9300,10.12.28.215:9300
--------------------------------------------------------------------------------
/thoth/thoth-data-es/src/test/resources/log4j2-spring.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/README.md:
--------------------------------------------------------------------------------
1 | # thoth-data-hbase
2 |
3 | * **Project features**
4 |
5 | * **v0.1.0-SNAPSHOT**:Project init
6 |
7 | - 创建IM消息HBase表
8 | ```
9 | create 'session','info'
10 | create 'chat_record','info'
11 | create 'workorder_task','info'
12 | create 'user_login','info'
13 | create 'session_opt','info'
14 | create 'chat_record_resp','info'
15 | create 'visitor_info','info','ext'
16 | ```
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/main/java/com/prometheus/thoth/data/hbase/annotation/Column.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data.hbase.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Inherited;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * Created by liangliang on 2017/04/11.
11 | *
12 | * @author liangliang
13 | * @since 2017/04/11
14 | */
15 | @Inherited
16 | @Target(ElementType.FIELD)
17 | @Retention(RetentionPolicy.RUNTIME)
18 | public @interface Column {
19 |
20 | String family() default "";
21 |
22 | String qualifier() default "";
23 | }
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/main/java/com/prometheus/thoth/data/hbase/annotation/HbaseTeable.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data.hbase.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Inherited;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * Created by liangliang on 2017/04/11.
11 | *
12 | * @author liangliang
13 | * @since 2017/04/11
14 | */
15 | @Inherited
16 | @Retention(RetentionPolicy.RUNTIME)
17 | @Target({ElementType.TYPE})
18 | public @interface HbaseTeable {
19 |
20 | String tableName();
21 |
22 | String family();
23 | }
24 |
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/main/java/com/prometheus/thoth/data/hbase/annotation/RowKey.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data.hbase.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Inherited;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * Created by liangliang on 2017/04/11.
11 | *
12 | * @author liangliang
13 | * @since 2017/04/11
14 | */
15 | @Inherited
16 | @Target(ElementType.FIELD)
17 | @Retention(RetentionPolicy.RUNTIME)
18 | public @interface RowKey {
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/main/java/com/prometheus/thoth/data/hbase/core/MutatorCallback.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data.hbase.core;
2 |
3 | import org.apache.hadoop.hbase.client.BufferedMutator;
4 |
5 | /**
6 | * Created by liangliang on 2017/04/10.
7 | *
8 | * @author liangliang
9 | * @since 2017/04/10
10 | */
11 | public interface MutatorCallback {
12 |
13 | void doInMutator(BufferedMutator mutator) throws Throwable;
14 | }
15 |
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/main/java/com/prometheus/thoth/data/hbase/core/RowMapper.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data.hbase.core;
2 |
3 | import org.apache.hadoop.hbase.client.Result;
4 |
5 | /**
6 | * Created by liangliang on 2017/04/10.
7 | *
8 | * @author liangliang
9 | * @since 2017/04/10
10 | */
11 | public interface RowMapper {
12 |
13 | T mapRow(Result result, int rowNum) throws Exception;
14 | }
15 |
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/main/java/com/prometheus/thoth/data/hbase/exception/HbaseException.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data.hbase.exception;
2 |
3 | import org.springframework.dao.UncategorizedDataAccessException;
4 |
5 | /**
6 | * Created by liangliang on 2017/04/10.
7 | *
8 | * @author liangliang
9 | * @since 2017/04/10
10 | */
11 | public class HbaseException extends UncategorizedDataAccessException {
12 |
13 | public HbaseException(Exception cause) {
14 | super(cause.getMessage(), cause);
15 | }
16 |
17 | public HbaseException(Throwable throwable) {
18 | super(throwable.getMessage(), throwable);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2 | com.prometheus.thoth.data.hbase.config.HbaseAutoConfiguration
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/test/java/com/prometheus/thoth/Application.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | /**
7 | * Created by ${USER} on ${DATE}.
8 | */
9 | @SpringBootApplication
10 | public class Application {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(Application.class, args);
14 | }
15 | }
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/test/java/com/prometheus/thoth/HbaseTest.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 | import static org.junit.Assert.*;
4 |
5 | import com.prometheus.thoth.test.BaseSpringBootTest;
6 | import org.junit.After;
7 | import org.junit.AfterClass;
8 | import org.junit.Before;
9 | import org.junit.BeforeClass;
10 | import org.junit.Test;
11 | import org.slf4j.Logger;
12 | import org.slf4j.LoggerFactory;
13 |
14 | /**
15 | * Unit test for simple App.
16 | *
17 | * Created by ${USER} on ${DATE}.
18 | */
19 | public class HbaseTest extends BaseSpringBootTest {
20 |
21 | }
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/test/java/com/prometheus/thoth/Test.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 | import com.prometheus.thoth.data.hbase.demo.Info;
4 |
5 | /**
6 | * Created by liangliang on 2017/04/22.
7 | *
8 | * @author liangliang
9 | * @since 2017/04/22
10 | */
11 | public class Test {
12 |
13 | public static void main(String args[]) {
14 | Info i1 = new Info(); // 泛型类型为String
15 | i1.getVar();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/test/java/com/prometheus/thoth/data/hbase/demo/Info.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data.hbase.demo;
2 |
3 | /**
4 | * Created by liangliang on 2017/04/22.
5 | *
6 | * @author liangliang
7 | * @since 2017/04/22
8 | */
9 | public class Info {
10 | private T var; // 定义泛型变量
11 |
12 | public void setVar(T var) {
13 | this.var = var;
14 | }
15 |
16 | public T getVar() {
17 | return this.var;
18 | }
19 |
20 | public String toString() { // 直接打印
21 | return this.var.toString();
22 | }
23 | };
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/test/resources/application-test.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-data-hbase-test
--------------------------------------------------------------------------------
/thoth/thoth-data-hbase/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-data-hbase
2 |
3 | management.security.enabled=false
4 |
5 | hbase.quorum=10.12.28.195:2181,10.12.28.211:2181,10.12.28.215:2181
6 |
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/README.md:
--------------------------------------------------------------------------------
1 | # thoth-data-kafka
2 |
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-consumer/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | com.prometheus
8 | thoth-data-kafka
9 | 0.0.1-SNAPSHOT
10 |
11 |
12 | thoth-data-kafka-consumer
13 | jar
14 |
15 | thoth-data-kafka-consumer
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-consumer/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2 | com.prometheus.thoth.data.kafka.config.KafkaConsumerAutoConfiguration
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-consumer/src/test/java/com/prometheus/thoth/data/Application.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | /**
7 | * Created by ${USER} on ${DATE}.
8 | */
9 | @SpringBootApplication
10 | public class Application {
11 |
12 | public static void main(String[] args) {
13 | SpringApplication.run(Application.class, args);
14 | }
15 | }
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-consumer/src/test/java/com/prometheus/thoth/data/KafkaConsumer.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data;
2 |
3 | import org.junit.Test;
4 |
5 |
6 | /**
7 | * Unit test for simple App.
8 | *
9 | * Created by ${USER} on ${DATE}.
10 | */
11 | public class KafkaConsumer {
12 |
13 | @Test
14 | public void start() throws InterruptedException {
15 | Thread.sleep(1000000000L);
16 | }
17 | }
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-consumer/src/test/resources/application-test.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-data-kafka-consumer-test
2 |
3 | # KAFKA CONF
4 | kafka.groupId=consumer-test
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-consumer/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-data-kafka-consumer
2 |
3 | management.security.enabled=false
4 |
5 | # KAFKA CONF
6 | kafka.broker-address=10.12.28.195:9092,10.12.28.211:9092,10.12.28.215:9092
7 | kafka.groupId=consumer-dev-aaa--bb11111111
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-producer/README.md:
--------------------------------------------------------------------------------
1 | # thoth-data-kafka-producer
2 |
3 | * **Project features**
4 |
5 | [Wiki](http://git.oschina.net/jasonwu/thoth-data-kafka-producer/wikis/)
6 |
7 | * **v0.1.0-SNAPSHOT**:Project init
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-producer/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
2 | com.prometheus.thoth.data.kafka.config.KafkaProducerAutoConfiguration
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-producer/src/test/java/com/changyou/thoth/SpringKafkaApplication.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | /**
7 | * Created by liangliang on 2017/03/18.
8 | *
9 | * @author liangliang
10 | * @since 2017/03/18
11 | */
12 | @SpringBootApplication
13 | public class SpringKafkaApplication {
14 |
15 | public static void main(String[] args) {
16 | SpringApplication.run(SpringKafkaApplication.class, args);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-producer/src/test/java/com/changyou/thoth/data/KafkaProducerTest.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.data;
2 |
3 | import com.prometheus.thoth.data.kafka.producer.KafkaProducer;
4 | import org.junit.Test;
5 | import org.springframework.beans.factory.annotation.Autowired;
6 |
7 | /**
8 | * Unit test for simple App.
9 | *
10 | * Created by ${USER} on ${DATE}.
11 | */
12 | public class KafkaProducerTest{
13 |
14 | @Autowired
15 | KafkaProducer kafkaProducer;
16 |
17 | @Test
18 | public void producer() {
19 | kafkaProducer.send("hello", "aaaaa");
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-producer/src/test/resources/application-test.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-data-kafka-producer-test
2 |
3 | kafka.broker-address=10.12.28.195:9092,10.12.28.211:9092,10.12.28.215:9092
--------------------------------------------------------------------------------
/thoth/thoth-data-kafka/thoth-data-kafka-producer/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | application.name=thoth-data-kafka-producer-test
2 |
3 | management.security.enabled=false
4 |
5 | kafka.broker-address=10.12.28.195:9092,10.12.28.211:9092,10.12.28.215:9092
6 |
7 | #embedded tomcat
8 | server.port=9000
--------------------------------------------------------------------------------
/thoth/thoth-fastdfs/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | # Auto Configure
2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
3 | com.prometheus.thoth.fastdfs.config.FastDFSAutoConfiguration
--------------------------------------------------------------------------------
/thoth/thoth-mongo/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 | /.project
3 | .settings/
4 | target/
5 | *.iml
6 | .idea/
--------------------------------------------------------------------------------
/thoth/thoth-mongo/src/test/resources/application-test.properties:
--------------------------------------------------------------------------------
1 | spring.profiles.active=test
2 | #---------------------------start mongodb for im
3 | im.mongodb.host= 10.12.28.209
4 | im.mongodb.port= 27017
5 | im.mongodb.database= rampage_im
6 | #---------------------------end mongodb for im
--------------------------------------------------------------------------------
/thoth/thoth-parent/src/main/java/com/prometheus/App.java:
--------------------------------------------------------------------------------
1 | package com.prometheus;
2 |
3 | /**
4 | * Hello world!
5 | *
6 | */
7 | public class App
8 | {
9 | public static void main( String[] args )
10 | {
11 | System.out.println( "Hello World!" );
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/thoth/thoth-redis/.gitignore:
--------------------------------------------------------------------------------
1 | /.classpath
2 | /.project
3 | .settings/
4 | target/
5 | *.iml
6 | .idea/
--------------------------------------------------------------------------------
/thoth/thoth-redis/src/main/java/com/prometheus/thoth/redis/exception/RedisException.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.redis.exception;
2 |
3 | /**
4 | * Redis Exception
5 | * Created by huaiqi-zhu on 2017/3/6.
6 | */
7 | public class RedisException extends RuntimeException {
8 |
9 |
10 | public RedisException() {
11 | }
12 |
13 | public RedisException(Throwable cause) {
14 | super(cause);
15 | }
16 |
17 | public RedisException(String message) {
18 | super(message);
19 | }
20 |
21 | public RedisException(String message, Throwable cause) {
22 | super(message, cause);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/thoth/thoth-redis/src/main/java/com/prometheus/thoth/redis/support/RedisKeyPrefix.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.redis.support;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | * Redis key 前缀
7 | * Created by zhuhuaiqi on 2017/4/8.
8 | */
9 | @Documented
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Target(ElementType.TYPE)
12 | public @interface RedisKeyPrefix {
13 | String value() default "";
14 | }
15 |
--------------------------------------------------------------------------------
/thoth/thoth-redis/src/main/java/com/prometheus/thoth/redis/support/enums/KeyExpireStrategy.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.redis.support.enums;
2 |
3 | /**
4 | * redis key设置过期时间策略
5 | */
6 | public enum KeyExpireStrategy {
7 | SET_ON_KEY_EXIST("XX"), SET_ON_KEY_NOT_EXIST("NX");
8 |
9 | private String value;
10 |
11 | KeyExpireStrategy(String nx) {
12 | this.value = nx;
13 | }
14 |
15 | public String getValue() {
16 | return value;
17 | }
18 |
19 | public void setValue(String value) {
20 | this.value = value;
21 | }
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/thoth/thoth-redis/src/main/java/com/prometheus/thoth/redis/support/enums/KeyExpireTimeUnit.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.redis.support.enums;
2 |
3 | /**
4 | * redis key设置过期时间单位
5 | */
6 | public enum KeyExpireTimeUnit {
7 | SECOND("EX"), MILLISECOND("PX");
8 |
9 | KeyExpireTimeUnit(String nx) {
10 | this.value = nx;
11 | }
12 |
13 | public String getValue() {
14 | return value;
15 | }
16 |
17 | public void setValue(String value) {
18 | this.value = value;
19 | }
20 |
21 | private String value;
22 |
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/thoth/thoth-redis/src/main/java/com/prometheus/thoth/redis/support/enums/RampageIdCategory.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth.redis.support.enums;
2 |
3 | /**
4 | * Created by zhuhuaiqi on 2017/3/23.
5 | */
6 | public enum RampageIdCategory {
7 | RAMPAGE_ADMIN_ID("thoth:admin:id:_id:{id}"), RAMPAGE_MSGCENTER_ID("thoth:msgcenter:id:_id:{id}");
8 | private String value;
9 |
10 | RampageIdCategory(String value) {
11 | this.value = value;
12 | }
13 |
14 | public String getValue() {
15 | return value;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/thoth/thoth-redis/src/main/resources/META-INF/spring.factories:
--------------------------------------------------------------------------------
1 | # Auto Configure
2 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
3 | com.prometheus.thoth.jedis.JedisSentinelPoolAutoConfiguration
--------------------------------------------------------------------------------
/thoth/thoth-test/src/main/java/com/prometheus/thoth/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.prometheus.thoth;
2 |
3 | import org.springframework.boot.autoconfigure.SpringBootApplication;
4 |
5 | /**
6 | * Created by liangliang on 2017/02/17.
7 | */
8 | @SpringBootApplication
9 | public class ApplicationTest {
10 | }
11 |
--------------------------------------------------------------------------------