16 |
17 |
18 |
28 |
29 |
42 |
--------------------------------------------------------------------------------
/console-vue/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | devServer: {
3 | proxy: {
4 | '/api': {
5 | target: 'http://127.0.0.1:9000',
6 | changeOrigin: true,
7 | ws: true
8 | }
9 | }
10 | },
11 | css: {
12 | loaderOptions: {
13 | less: {
14 | javascriptEnabled: true,
15 | modifyVars: {
16 | 'border-radius-base': '4px',
17 | 'card-radius': '4px'
18 | }
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/format/copyright.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 |
--------------------------------------------------------------------------------
/frameworks/base/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-base-spring-boot-starter
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/constant/FilterOrderConstant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.bases.constant;
19 |
20 | /**
21 | * 全局过滤器顺序执行常量类
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public final class FilterOrderConstant {
25 |
26 | /**
27 | * 用户信息传递过滤器执行顺序排序
28 | */
29 | public static final int USER_TRANSMIT_FILTER_ORDER = 100;
30 | }
31 |
--------------------------------------------------------------------------------
/frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/constant/UserConstant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.bases.constant;
19 |
20 | /**
21 | * 用户常量
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public final class UserConstant {
25 |
26 | /**
27 | * 用户 ID Key
28 | */
29 | public static final String USER_ID_KEY = "userId";
30 |
31 | /**
32 | * 用户名 Key
33 | */
34 | public static final String USER_NAME_KEY = "username";
35 |
36 | /**
37 | * 用户真实名称 Key
38 | */
39 | public static final String REAL_NAME_KEY = "realName";
40 |
41 | /**
42 | * 用户 Token Key
43 | */
44 | public static final String USER_TOKEN_KEY = "token";
45 | }
46 |
--------------------------------------------------------------------------------
/frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/init/ApplicationInitializingEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.bases.init;
19 |
20 | import org.springframework.context.ApplicationEvent;
21 |
22 | /**
23 | * 应用初始化事件
24 | *
25 | *
规约事件,通过此事件可以查看业务系统所有初始化行为
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | public class ApplicationInitializingEvent extends ApplicationEvent {
29 |
30 | /**
31 | * Create a new {@code ApplicationEvent}.
32 | *
33 | * @param source the object on which the event initially occurred or with
34 | * which the event is associated (never {@code null})
35 | */
36 | public ApplicationInitializingEvent(Object source) {
37 | super(source);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/frameworks/base/src/main/java/org/opengoofy/index12306/framework/starter/bases/safa/FastJsonSafeMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.bases.safa;
19 |
20 | import org.springframework.beans.factory.InitializingBean;
21 |
22 | /**
23 | * FastJson安全模式,开启后关闭类型隐式传递
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public class FastJsonSafeMode implements InitializingBean {
27 |
28 | @Override
29 | public void afterPropertiesSet() throws Exception {
30 | System.setProperty("fastjson2.parser.safeMode", "true");
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/frameworks/base/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.bases.config.ApplicationBaseAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/bizs/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 | index12306-bizs-spring-boot-starter
11 | pom
12 |
13 |
14 | user
15 |
16 |
17 |
--------------------------------------------------------------------------------
/frameworks/bizs/user/src/main/java/org/opengoofy/index12306/frameworks/starter/user/core/UserInfoDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.frameworks.starter.user.core;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Builder;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 |
25 | /**
26 | * 用户信息实体
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | @NoArgsConstructor
31 | @AllArgsConstructor
32 | @Builder
33 | public class UserInfoDTO {
34 |
35 | /**
36 | * 用户 ID
37 | */
38 | private String userId;
39 |
40 | /**
41 | * 用户名
42 | */
43 | private String username;
44 |
45 | /**
46 | * 真实姓名
47 | */
48 | private String realName;
49 |
50 | /**
51 | * 用户 Token
52 | */
53 | private String token;
54 | }
55 |
--------------------------------------------------------------------------------
/frameworks/bizs/user/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.frameworks.starter.user.config.UserAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/MultistageCache.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.cache;
19 |
20 | /**
21 | * 多级缓存
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public interface MultistageCache extends Cache {
25 | }
26 |
--------------------------------------------------------------------------------
/frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/core/CacheGetFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.cache.core;
19 |
20 | /**
21 | * 缓存过滤
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | @FunctionalInterface
25 | public interface CacheGetFilter {
26 |
27 | /**
28 | * 缓存过滤
29 | *
30 | * @param param 输出参数
31 | * @return {@code true} 如果输入参数匹配,否则 {@link Boolean#TRUE}
32 | */
33 | boolean filter(T param);
34 | }
35 |
--------------------------------------------------------------------------------
/frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/core/CacheGetIfAbsent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.cache.core;
19 |
20 | /**
21 | * 缓存查询为空
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | @FunctionalInterface
25 | public interface CacheGetIfAbsent {
26 |
27 | /**
28 | * 如果查询结果为空,执行逻辑
29 | */
30 | void execute(T param);
31 | }
32 |
--------------------------------------------------------------------------------
/frameworks/cache/src/main/java/org/opengoofy/index12306/framework/starter/cache/core/CacheLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.cache.core;
19 |
20 | /**
21 | * 缓存加载器
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | @FunctionalInterface
25 | public interface CacheLoader {
26 |
27 | /**
28 | * 加载缓存
29 | */
30 | T load();
31 | }
32 |
--------------------------------------------------------------------------------
/frameworks/cache/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.cache.config.CacheAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/cache/src/main/resources/lua/putIfAllAbsent.lua:
--------------------------------------------------------------------------------
1 | --[[KEYS 全部不存在,创建并返回 true,反之返回空]]
2 |
3 | for i, v in ipairs(KEYS) do
4 | if (redis.call('exists', v) == 1) then
5 | return nil;
6 | end
7 | end
8 | for i, v in ipairs(KEYS) do
9 | redis.call('set', v, 'default');
10 | redis.call('pexpire', v, ARGV[1]);
11 | end
12 | return true;
13 |
--------------------------------------------------------------------------------
/frameworks/common/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-common-spring-boot-starter
12 |
13 |
14 |
15 | org.opengoofy.index12306
16 | index12306-base-spring-boot-starter
17 | ${project.version}
18 |
19 |
20 |
21 | com.github.dozermapper
22 | dozer-core
23 |
24 |
25 |
26 | org.opengoofy.index12306
27 | index12306-designpattern-spring-boot-starter
28 | ${project.version}
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/frameworks/common/src/main/java/org/opengoofy/index12306/framework/starter/common/enums/OperationTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.common.enums;
19 |
20 | /**
21 | * 操作类型
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public enum OperationTypeEnum {
25 |
26 | SAVE,
27 |
28 | UPDATE,
29 |
30 | DELETE
31 | }
32 |
--------------------------------------------------------------------------------
/frameworks/common/src/main/java/org/opengoofy/index12306/framework/starter/common/toolkit/ThreadUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.common.toolkit;
19 |
20 | import lombok.SneakyThrows;
21 |
22 | /**
23 | * 线程池工具类
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public final class ThreadUtil {
27 |
28 | /**
29 | * 睡眠当前线程指定时间 {@param millis}
30 | *
31 | * @param millis 睡眠时间,单位毫秒
32 | */
33 | @SneakyThrows(value = InterruptedException.class)
34 | public static void sleep(long millis) {
35 | Thread.sleep(millis);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/frameworks/convention/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-convention-spring-boot-starter
12 |
13 |
--------------------------------------------------------------------------------
/frameworks/convention/src/main/java/org/opengoofy/index12306/framework/starter/convention/errorcode/IErrorCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.convention.errorcode;
19 |
20 | /**
21 | * 平台错误码
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public interface IErrorCode {
25 |
26 | /**
27 | * 错误码
28 | */
29 | String code();
30 |
31 | /**
32 | * 错误信息
33 | */
34 | String message();
35 | }
36 |
--------------------------------------------------------------------------------
/frameworks/convention/src/main/java/org/opengoofy/index12306/framework/starter/convention/page/PageRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.convention.page;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 分页请求对象
24 | *
25 | *
{@link PageRequest}、{@link PageResponse}
26 | * 可以理解是防腐层的一种实现,不论底层 ORM 框架,对外分页参数属性不变
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | public class PageRequest {
31 |
32 | /**
33 | * 当前页
34 | */
35 | private Long current = 1L;
36 |
37 | /**
38 | * 每页显示条数
39 | */
40 | private Long size = 10L;
41 | }
42 |
--------------------------------------------------------------------------------
/frameworks/database/src/main/java/org/opengoofy/index12306/framework/starter/database/handler/CustomIdGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.database.handler;
19 |
20 | import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
21 | import org.opengoofy.index12306.framework.starter.distributedid.toolkit.SnowflakeIdUtil;
22 |
23 | /**
24 | * 自定义雪花算法生成器
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public class CustomIdGenerator implements IdentifierGenerator {
28 |
29 | @Override
30 | public Number nextId(Object entity) {
31 | return SnowflakeIdUtil.nextId();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/frameworks/database/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.database.config.MybatisPlusAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/designpattern/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-designpattern-spring-boot-starter
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter
17 |
18 |
19 |
20 | org.opengoofy.index12306
21 | index12306-base-spring-boot-starter
22 | ${project.version}
23 |
24 |
25 |
26 | org.opengoofy.index12306
27 | index12306-convention-spring-boot-starter
28 | ${project.version}
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/frameworks/designpattern/src/main/java/org/opengoofy/index12306/framework/starter/designpattern/builder/Builder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.designpattern.builder;
19 |
20 | import java.io.Serializable;
21 |
22 | /**
23 | * Builder 模式抽象接口
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface Builder extends Serializable {
27 |
28 | /**
29 | * 构建方法
30 | *
31 | * @return 构建后的对象
32 | */
33 | T build();
34 | }
35 |
--------------------------------------------------------------------------------
/frameworks/designpattern/src/main/java/org/opengoofy/index12306/framework/starter/designpattern/chain/AbstractChainHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.designpattern.chain;
19 |
20 | import org.springframework.core.Ordered;
21 |
22 | /**
23 | * 抽象业务责任链组件
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface AbstractChainHandler extends Ordered {
27 |
28 | /**
29 | * 执行责任链逻辑
30 | *
31 | * @param requestParam 责任链执行入参
32 | */
33 | void handler(T requestParam);
34 |
35 | /**
36 | * @return 责任链组件标识
37 | */
38 | String mark();
39 | }
40 |
--------------------------------------------------------------------------------
/frameworks/designpattern/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.designpattern.config.DesignPatternAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/distributedid/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-distributedid-spring-boot-starter
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter-data-redis
17 | true
18 |
19 |
20 |
21 | org.opengoofy.index12306
22 | index12306-base-spring-boot-starter
23 | ${project.version}
24 |
25 |
26 |
27 | cn.hutool
28 | hutool-all
29 |
30 |
31 |
32 | org.springframework.boot
33 | spring-boot-starter-test
34 | test
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/frameworks/distributedid/src/main/java/org/opengoofy/index12306/framework/starter/distributedid/core/IdGenerator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.distributedid.core;
19 |
20 | /**
21 | * ID 生成器
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public interface IdGenerator {
25 |
26 | /**
27 | * 下一个 ID
28 | */
29 | default long nextId() {
30 | return 0L;
31 | }
32 |
33 | /**
34 | * 下一个 ID 字符串
35 | */
36 | default String nextIdStr() {
37 | return "";
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/frameworks/distributedid/src/main/java/org/opengoofy/index12306/framework/starter/distributedid/core/snowflake/WorkIdWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.distributedid.core.snowflake;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Data;
22 | import lombok.NoArgsConstructor;
23 |
24 | /**
25 | * WorkId 包装器
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | @NoArgsConstructor
30 | @AllArgsConstructor
31 | public class WorkIdWrapper {
32 |
33 | /**
34 | * 工作ID
35 | */
36 | private Long workId;
37 |
38 | /**
39 | * 数据中心ID
40 | */
41 | private Long dataCenterId;
42 | }
43 |
--------------------------------------------------------------------------------
/frameworks/distributedid/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.distributedid.config.DistributedIdAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/distributedid/src/main/resources/lua/chooseWorkIdLua.lua:
--------------------------------------------------------------------------------
1 | local hashKey = 'snowflake_work_id_key'
2 | local dataCenterIdKey = 'dataCenterId'
3 | local workIdKey = 'workId'
4 |
5 | if (redis.call('exists', hashKey) == 0) then
6 | redis.call('hincrby', hashKey, dataCenterIdKey, 0)
7 | redis.call('hincrby', hashKey, workIdKey, 0)
8 | return { 0, 0 }
9 | end
10 |
11 | local dataCenterId = tonumber(redis.call('hget', hashKey, dataCenterIdKey))
12 | local workId = tonumber(redis.call('hget', hashKey, workIdKey))
13 |
14 | local max = 31
15 | local resultWorkId = 0
16 | local resultDataCenterId = 0
17 |
18 | if (dataCenterId == max and workId == max) then
19 | redis.call('hset', hashKey, dataCenterIdKey, '0')
20 | redis.call('hset', hashKey, workIdKey, '0')
21 |
22 | elseif (workId ~= max) then
23 | resultWorkId = redis.call('hincrby', hashKey, workIdKey, 1)
24 | resultDataCenterId = dataCenterId
25 |
26 | elseif (dataCenterId ~= max) then
27 | resultWorkId = 0
28 | resultDataCenterId = redis.call('hincrby', hashKey, dataCenterIdKey, 1)
29 | redis.call('hset', hashKey, workIdKey, '0')
30 |
31 | end
32 |
33 | return { resultWorkId, resultDataCenterId }
34 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/RepeatConsumptionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.idempotent.core;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | /**
24 | * 重复消费异常
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @RequiredArgsConstructor
28 | public class RepeatConsumptionException extends RuntimeException {
29 |
30 | /**
31 | * 错误标识
32 | *
33 | * 触发幂等逻辑时可能有两种情况:
34 | * 1. 消息还在处理,但是不确定是否执行成功,那么需要返回错误,方便 RocketMQ 再次通过重试队列投递
35 | * 2. 消息处理成功了,该消息直接返回成功即可
36 | */
37 | @Getter
38 | private final Boolean error;
39 | }
40 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/param/IdempotentParamService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.idempotent.core.param;
19 |
20 | import org.opengoofy.index12306.framework.starter.idempotent.core.IdempotentExecuteHandler;
21 |
22 | /**
23 | * 参数方式幂等实现接口
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface IdempotentParamService extends IdempotentExecuteHandler {
27 | }
28 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/spel/IdempotentSpELService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.idempotent.core.spel;
19 |
20 | import org.opengoofy.index12306.framework.starter.idempotent.core.IdempotentExecuteHandler;
21 |
22 | /**
23 | * SpEL 方式幂等实现接口
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface IdempotentSpELService extends IdempotentExecuteHandler {
27 | }
28 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/core/token/IdempotentTokenService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.idempotent.core.token;
19 |
20 | import org.opengoofy.index12306.framework.starter.idempotent.core.IdempotentExecuteHandler;
21 |
22 | /**
23 | * Token 实现幂等接口
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface IdempotentTokenService extends IdempotentExecuteHandler {
27 |
28 | /**
29 | * 创建幂等验证Token
30 | */
31 | String createToken();
32 | }
33 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/enums/IdempotentSceneEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.idempotent.enums;
19 |
20 | /**
21 | * 幂等验证场景枚举
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public enum IdempotentSceneEnum {
25 |
26 | /**
27 | * 基于 RestAPI 场景验证
28 | */
29 | RESTAPI,
30 |
31 | /**
32 | * 基于 MQ 场景验证
33 | */
34 | MQ
35 | }
36 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/enums/IdempotentTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.idempotent.enums;
19 |
20 | /**
21 | * 幂等验证类型枚举
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public enum IdempotentTypeEnum {
25 |
26 | /**
27 | * 基于 Token 方式验证
28 | */
29 | TOKEN,
30 |
31 | /**
32 | * 基于方法参数方式验证
33 | */
34 | PARAM,
35 |
36 | /**
37 | * 基于 SpEL 表达式方式验证
38 | */
39 | SPEL
40 | }
41 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/java/org/opengoofy/index12306/framework/starter/idempotent/toolkit/LogUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.idempotent.toolkit;
19 |
20 | import org.aspectj.lang.ProceedingJoinPoint;
21 | import org.aspectj.lang.reflect.MethodSignature;
22 | import org.slf4j.Logger;
23 | import org.slf4j.LoggerFactory;
24 |
25 | /**
26 | * 日志工具类
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | public class LogUtil {
30 |
31 | /**
32 | * 获取 Logger
33 | */
34 | public static Logger getLog(ProceedingJoinPoint joinPoint) {
35 | MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
36 | return LoggerFactory.getLogger(methodSignature.getDeclaringType());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.idempotent.config.IdempotentAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/idempotent/src/main/resources/lua/set_if_absent_and_get.lua:
--------------------------------------------------------------------------------
1 | -- 原子性获取给定key,若key存在返回其值,若key不存在则设置key并返回null
2 | local key = KEYS[1]
3 | local value = ARGV[1]
4 | local expire_time_ms = ARGV[2]
5 |
6 | return redis.call('SET', key, value, 'NX', 'GET', 'PX', expire_time_ms)
7 |
--------------------------------------------------------------------------------
/frameworks/log/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 | index12306-log-spring-boot-starter
11 |
12 |
13 |
14 | org.springframework.boot
15 | spring-boot-starter
16 |
17 |
18 |
19 | com.alibaba.fastjson2
20 | fastjson2
21 |
22 |
23 |
24 | org.aspectj
25 | aspectjweaver
26 |
27 |
28 |
29 | org.springframework.boot
30 | spring-boot-starter-web
31 | true
32 |
33 |
34 |
35 | cn.hutool
36 | hutool-all
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/frameworks/log/src/main/java/org/opengoofy/index12306/framework/starter/log/config/LogAutoConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.log.config;
19 |
20 | import org.opengoofy.index12306.framework.starter.log.core.ILogPrintAspect;
21 | import org.opengoofy.index12306.framework.starter.log.annotation.ILog;
22 | import org.springframework.context.annotation.Bean;
23 |
24 | /**
25 | * 日志自动装配
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | public class LogAutoConfiguration {
29 |
30 | /**
31 | * {@link ILog} 日志打印 AOP 切面
32 | */
33 | @Bean
34 | public ILogPrintAspect iLogPrintAspect() {
35 | return new ILogPrintAspect();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/frameworks/log/src/main/java/org/opengoofy/index12306/framework/starter/log/core/ILogPrintDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.framework.starter.log.core;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * ILog 日志打印实体
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class ILogPrintDTO {
28 |
29 | /**
30 | * 开始时间
31 | */
32 | private String beginTime;
33 |
34 | /**
35 | * 请求入参
36 | */
37 | private Object[] inputParams;
38 |
39 | /**
40 | * 返回参数
41 | */
42 | private Object outputParams;
43 | }
44 |
--------------------------------------------------------------------------------
/frameworks/log/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.log.config.LogAutoConfiguration
19 |
--------------------------------------------------------------------------------
/frameworks/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-all
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-frameworks
12 | pom
13 |
14 |
15 | base
16 | bizs
17 | cache
18 | common
19 | convention
20 | database
21 | designpattern
22 | distributedid
23 | idempotent
24 | log
25 | web
26 |
27 |
28 |
--------------------------------------------------------------------------------
/frameworks/web/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-frameworks
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-web-spring-boot-starter
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter
17 |
18 |
19 |
20 | org.opengoofy.index12306
21 | index12306-convention-spring-boot-starter
22 | ${project.version}
23 |
24 |
25 |
26 | org.springframework.boot
27 | spring-boot-starter-web
28 |
29 |
30 |
31 | cn.hutool
32 | hutool-all
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/frameworks/web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | org.opengoofy.index12306.framework.starter.web.config.WebAutoConfiguration
19 |
--------------------------------------------------------------------------------
/lombok.config:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | # this config is to ignore lombok code in jacoco
19 | config.stopBubbling = true
20 | lombok.addLombokGeneratedAnnotation = true
21 |
22 | # fix @Data callSuper=false
23 | lombok.equalsAndHashCode.callSuper = skip
24 |
--------------------------------------------------------------------------------
/services/aggregation-service/src/main/java/org/opengoofy/index12306/biz/aggregationservice/config/DemoModeProperties.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.aggregationservice.config;
19 |
20 | import lombok.Data;
21 | import org.springframework.boot.context.properties.ConfigurationProperties;
22 | import org.springframework.stereotype.Component;
23 |
24 | import java.util.List;
25 |
26 | /**
27 | * 演示环境配置属性
28 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
29 | */
30 | @Data
31 | @Component
32 | @ConfigurationProperties(prefix = "aggregation.demo-mode")
33 | public class DemoModeProperties {
34 |
35 | /**
36 | * 是否开启演示环境模式
37 | */
38 | private Boolean enable;
39 |
40 | /**
41 | * 演示环境黑名单路径
42 | */
43 | private List blacklist;
44 | }
45 |
--------------------------------------------------------------------------------
/services/gateway-service/src/main/java/org/opengoofy/index12306/biz/gatewayservice/GatewayServiceApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.gatewayservice;
19 |
20 | import org.springframework.boot.SpringApplication;
21 | import org.springframework.boot.autoconfigure.SpringBootApplication;
22 |
23 | /**
24 | * 网关服务应用启动器
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @SpringBootApplication
28 | public class GatewayServiceApplication {
29 |
30 | public static void main(String[] args) {
31 | SpringApplication.run(GatewayServiceApplication.class, args);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/services/gateway-service/src/main/java/org/opengoofy/index12306/biz/gatewayservice/config/Config.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.gatewayservice.config;
19 |
20 | import lombok.Data;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * 过滤器配置
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | public class Config {
30 |
31 | /**
32 | * 黑名单前置路径
33 | */
34 | private List blackPathPre;
35 | }
36 |
--------------------------------------------------------------------------------
/services/gateway-service/src/main/java/org/opengoofy/index12306/biz/gatewayservice/toolkit/UserInfoDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.gatewayservice.toolkit;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Builder;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 |
25 | /**
26 | * 用户信息实体
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | @NoArgsConstructor
31 | @AllArgsConstructor
32 | @Builder
33 | public class UserInfoDTO {
34 |
35 | /**
36 | * 用户 ID
37 | */
38 | private String userId;
39 |
40 | /**
41 | * 用户名
42 | */
43 | private String username;
44 |
45 | /**
46 | * 真实姓名
47 | */
48 | private String realName;
49 | }
50 |
--------------------------------------------------------------------------------
/services/gateway-service/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 9000
3 | spring:
4 | application:
5 | name: index12306-gateway${unique-name:}-service
6 | profiles:
7 | active: aggregation
8 | # active: dev
9 | cloud:
10 | nacos:
11 | discovery:
12 | server-addr: 127.0.0.1:8848
13 |
14 | management:
15 | endpoints:
16 | web:
17 | exposure:
18 | include: '*'
19 | metrics:
20 | tags:
21 | application: ${spring.application.name}
22 |
--------------------------------------------------------------------------------
/services/gateway-service/src/test/java/org/opengoofy/index12306/biz/gatewayservice/GatewayServiceApplicationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.gatewayservice;
19 |
20 | import org.junit.jupiter.api.Test;
21 | import org.springframework.boot.test.context.SpringBootTest;
22 |
23 | @SpringBootTest
24 | class GatewayServiceApplicationTests {
25 |
26 | @Test
27 | void contextLoads() {
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/common/enums/PayChannelEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.common.enums;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | import java.util.Arrays;
24 | import java.util.Objects;
25 |
26 | /**
27 | * 支付渠道枚举
28 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
29 | */
30 | @RequiredArgsConstructor
31 | public enum PayChannelEnum {
32 |
33 | /**
34 | * 支付宝
35 | */
36 | ALI_PAY(0, "ALI_PAY", "支付宝");
37 |
38 | @Getter
39 | private final Integer code;
40 |
41 | @Getter
42 | private final String name;
43 |
44 | @Getter
45 | private final String value;
46 | }
47 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/common/enums/RefundTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.common.enums;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | /**
24 | * 退款类型枚举
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @Getter
28 | @RequiredArgsConstructor
29 | public enum RefundTypeEnum {
30 |
31 | /**
32 | * 部分退款
33 | */
34 | PARTIAL_REFUND(11, 0, "PARTIAL_REFUND", "部分退款"),
35 |
36 | /**
37 | * 全部退款
38 | */
39 | FULL_REFUND(12, 1, "FULL_REFUND", "全部退款");
40 |
41 | private final Integer code;
42 |
43 | private final Integer type;
44 |
45 | private final String name;
46 |
47 | private final String value;
48 | }
49 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dao/mapper/OrderItemMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderItemDO;
22 |
23 | /**
24 | * 订单明细持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface OrderItemMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dao/mapper/OrderItemPassengerMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderItemPassengerDO;
22 |
23 | /**
24 | * 乘车人订单关系持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface OrderItemPassengerMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dao/mapper/OrderMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderDO;
22 |
23 | /**
24 | * 订单持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface OrderMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/domain/OrderStatusReversalDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dto.domain;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Builder;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 |
25 | /**
26 | * 订单状态反转实体
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | @Builder
31 | @NoArgsConstructor
32 | @AllArgsConstructor
33 | public final class OrderStatusReversalDTO {
34 |
35 | /**
36 | * 订单号
37 | */
38 | private String orderSn;
39 |
40 | /**
41 | * 订单反转后状态
42 | */
43 | private Integer orderStatus;
44 |
45 | /**
46 | * 订单明细反转后状态
47 | */
48 | private Integer orderItemStatus;
49 | }
50 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/CancelTicketOrderReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dto.req;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 取消车票订单请求入参
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class CancelTicketOrderReqDTO {
28 |
29 | /**
30 | * 订单号
31 | */
32 | private String orderSn;
33 | }
34 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/TicketOrderItemQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dto.req;
19 |
20 | import lombok.Data;
21 | import java.util.List;
22 |
23 | /**
24 | * 车票子订单查询
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @Data
28 | public class TicketOrderItemQueryReqDTO {
29 |
30 | /**
31 | * 订单号
32 | */
33 | private String orderSn;
34 |
35 | /**
36 | * 子订单记录id
37 | */
38 | private List orderItemRecordIds;
39 | }
40 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/TicketOrderPageQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dto.req;
19 |
20 | import lombok.Data;
21 | import org.opengoofy.index12306.framework.starter.convention.page.PageRequest;
22 |
23 | /**
24 | * 车票订单分页查询
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @Data
28 | public class TicketOrderPageQueryReqDTO extends PageRequest {
29 |
30 | /**
31 | * 用户唯一标识
32 | */
33 | private String userId;
34 |
35 | /**
36 | * 状态类型 0:未完成 1:未出行 2:历史订单
37 | */
38 | private Integer statusType;
39 | }
40 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/dto/req/TicketOrderSelfPageQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.dto.req;
19 |
20 | import lombok.Data;
21 | import org.opengoofy.index12306.framework.starter.convention.page.PageRequest;
22 |
23 | /**
24 | * 本人车票订单分页查询
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @Data
28 | public class TicketOrderSelfPageQueryReqDTO extends PageRequest {
29 | }
30 |
--------------------------------------------------------------------------------
/services/order-service/src/main/java/org/opengoofy/index12306/biz/orderservice/service/OrderPassengerRelationService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.orderservice.service;
19 |
20 | import com.baomidou.mybatisplus.extension.service.IService;
21 | import org.opengoofy.index12306.biz.orderservice.dao.entity.OrderItemPassengerDO;
22 |
23 | /**
24 | * 乘车人订单关系接口层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface OrderPassengerRelationService extends IService {
28 | }
29 |
--------------------------------------------------------------------------------
/services/order-service/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | # RocketMQ 2.2.3 version does not adapt to SpringBoot3
2 | org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration
--------------------------------------------------------------------------------
/services/order-service/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 9003
3 |
4 | spring:
5 | application:
6 | name: index12306-order${unique-name:}-service
7 | datasource:
8 | driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
9 | url: jdbc:shardingsphere:classpath:shardingsphere-config.yaml
10 | cloud:
11 | nacos:
12 | discovery:
13 | server-addr: 127.0.0.1:8848
14 | password: nacos
15 | username: nacos
16 | sentinel:
17 | transport:
18 | dashboard: localhost:8686
19 | port: 8719
20 | data:
21 | redis:
22 | host: 127.0.0.1
23 | port: 6379
24 | password: 123456
25 |
26 | mybatis-plus:
27 | global-config:
28 | db-config:
29 | logic-delete-field: delFlag
30 | logic-delete-value: 1
31 | logic-not-delete-value: 0
32 | configuration:
33 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
34 | # mapper-locations: classpath:mapper/*.xml
35 |
36 | framework:
37 | fastjson:
38 | safa-mode: true
39 | cache:
40 | redis:
41 | value-timeout: 16
42 | value-time-unit: days
43 |
44 | rocketmq:
45 | name-server: 127.0.0.1:9876
46 | producer:
47 | group: index12306_order${unique-name:}-service_common-message-execute_pg
48 | send-message-timeout: 2000
49 | retry-times-when-send-failed: 1
50 | retry-times-when-send-async-failed: 1
51 |
52 | management:
53 | endpoints:
54 | web:
55 | exposure:
56 | include: '*'
57 | metrics:
58 | tags:
59 | application: ${spring.application.name}
60 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/common/constant/RedisKeyConstant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.common.constant;
19 |
20 | /**
21 | * Redis Key 定义常量类
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public final class RedisKeyConstant {
25 |
26 | /**
27 | * 订单未支付临时存储信息
28 | */
29 | public static final String ORDER_PAY_RESULT_INFO = "index12306-pay-service:order_pay_result:";
30 | }
31 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/common/enums/PayChannelEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.common.enums;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | /**
24 | * 支付渠道枚举
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @RequiredArgsConstructor
28 | public enum PayChannelEnum {
29 |
30 | /**
31 | * 支付宝
32 | */
33 | ALI_PAY(0, "ALI_PAY", "支付宝");
34 |
35 | @Getter
36 | private final Integer code;
37 |
38 | @Getter
39 | private final String name;
40 |
41 | @Getter
42 | private final String value;
43 | }
44 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/common/enums/RefundTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.common.enums;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | /**
24 | * 退款类型枚举
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @Getter
28 | @RequiredArgsConstructor
29 | public enum RefundTypeEnum {
30 |
31 | /**
32 | * 部分退款
33 | */
34 | PARTIAL_REFUND(11, 0, "PARTIAL_REFUND", "部分退款"),
35 |
36 | /**
37 | * 全部退款
38 | */
39 | FULL_REFUND(12, 1, "FULL_REFUND", "全部退款");
40 |
41 | private final Integer code;
42 |
43 | private final Integer type;
44 |
45 | private final String name;
46 |
47 | private final String value;
48 | }
49 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dao/mapper/PayMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.payservice.dao.entity.PayDO;
22 |
23 | /**
24 | * 支付持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface PayMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dao/mapper/RefundMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.payservice.dao.entity.RefundDO;
22 |
23 | /**
24 | * 退款记录持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface RefundMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/PayCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto;
19 |
20 | import lombok.Data;
21 | import org.opengoofy.index12306.biz.payservice.dto.base.AbstractPayRequest;
22 |
23 | import java.math.BigDecimal;
24 |
25 | /**
26 | * 支付请求命令
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | public final class PayCommand extends AbstractPayRequest {
31 |
32 | /**
33 | * 子订单号
34 | */
35 | private String outOrderSn;
36 |
37 | /**
38 | * 订单总金额
39 | * 单位为元,精确到小数点后两位,取值范围:[0.01,100000000]
40 | */
41 | private BigDecimal totalAmount;
42 |
43 | /**
44 | * 订单标题
45 | * 注意:不可使用特殊字符,如 /,=,& 等
46 | */
47 | private String subject;
48 | }
49 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/PayInfoRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto;
19 |
20 | import lombok.Data;
21 |
22 | import java.util.Date;
23 |
24 | /**
25 | * 支付单详情信息返回参数
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | public class PayInfoRespDTO {
30 |
31 | /**
32 | * 订单号
33 | */
34 | private String orderSn;
35 |
36 | /**
37 | * 支付总金额
38 | */
39 | private Integer totalAmount;
40 |
41 | /**
42 | * 支付状态
43 | */
44 | private Integer status;
45 |
46 | /**
47 | * 支付时间
48 | */
49 | private Date gmtPayment;
50 | }
51 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/PayRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 支付返回实体
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public final class PayRespDTO {
28 |
29 | /**
30 | * 调用支付返回信息
31 | */
32 | private String body;
33 | }
34 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/RefundCommand.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto;
19 |
20 | import lombok.Data;
21 | import org.opengoofy.index12306.biz.payservice.dto.base.AbstractRefundRequest;
22 |
23 | import java.math.BigDecimal;
24 |
25 | /**
26 | * 退款请求命令
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | public final class RefundCommand extends AbstractRefundRequest {
31 |
32 | /**
33 | * 支付金额
34 | */
35 | private BigDecimal payAmount;
36 |
37 | /**
38 | * 交易凭证号
39 | */
40 | private String tradeNo;
41 | }
42 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/RefundCreateDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto;
19 |
20 | import lombok.Data;
21 | import org.opengoofy.index12306.biz.payservice.remote.dto.TicketOrderPassengerDetailRespDTO;
22 |
23 | import java.util.List;
24 |
25 | /**
26 | * 退款创建入参数实体
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | public class RefundCreateDTO {
31 |
32 | /**
33 | * 支付流水号
34 | */
35 | private String paySn;
36 |
37 | /**
38 | * 订单号
39 | */
40 | private String orderSn;
41 |
42 | /**
43 | * 退款类型
44 | */
45 | private Integer type;
46 |
47 | /**
48 | * 部分退款车票详情集合
49 | */
50 | private List refundDetailReqDTOList;
51 | }
52 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/RefundRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 退款详情返回参数实体
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class RefundRespDTO {
28 | }
29 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/AbstractPayCallbackRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto.base;
19 |
20 | import lombok.Getter;
21 | import lombok.Setter;
22 |
23 | /**
24 | * 抽象支付回调入参实体
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public abstract class AbstractPayCallbackRequest implements PayCallbackRequest {
28 |
29 | @Getter
30 | @Setter
31 | private String orderRequestId;
32 |
33 | @Override
34 | public AliPayCallbackRequest getAliPayCallBackRequest() {
35 | return null;
36 | }
37 |
38 | @Override
39 | public String buildMark() {
40 | return null;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/PayCallbackRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto.base;
19 |
20 | /**
21 | * 支付回调请求入参
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public interface PayCallbackRequest {
25 |
26 | /**
27 | * 获取阿里支付回调入参
28 | */
29 | AliPayCallbackRequest getAliPayCallBackRequest();
30 |
31 | /**
32 | * 构建查找支付回调策略实现类标识
33 | */
34 | String buildMark();
35 | }
36 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/PayResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto.base;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Builder;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 |
25 | /**
26 | * 支付返回
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | @NoArgsConstructor
31 | @AllArgsConstructor
32 | @Builder
33 | public final class PayResponse {
34 |
35 | /**
36 | * 调用支付返回信息
37 | */
38 | private String body;
39 | }
40 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/RefundRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto.base;
19 |
20 | import java.math.BigDecimal;
21 |
22 | /**
23 | * 退款入参接口
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface RefundRequest {
27 |
28 | /**
29 | * 获取阿里退款入参
30 | */
31 | AliRefundRequest getAliRefundRequest();
32 |
33 | /**
34 | * 获取订单号
35 | */
36 | String getOrderSn();
37 |
38 | /**
39 | * 构建查找支付策略实现类标识
40 | */
41 | String buildMark();
42 | }
43 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/dto/base/RefundResponse.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.dto.base;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Builder;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 |
25 | /**
26 | * 退款返回
27 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
28 | */
29 | @Data
30 | @NoArgsConstructor
31 | @AllArgsConstructor
32 | @Builder
33 | public final class RefundResponse {
34 |
35 | /**
36 | * 退款状态
37 | */
38 | private Integer status;
39 |
40 | /**
41 | * 第三方交易凭证
42 | */
43 | private String tradeNo;
44 | }
45 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/handler/base/AbstractPayCallbackHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.handler.base;
19 |
20 | import org.opengoofy.index12306.biz.payservice.dto.base.PayCallbackRequest;
21 |
22 | /**
23 | * 抽象支付回调组件
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public abstract class AbstractPayCallbackHandler {
27 |
28 | /**
29 | * 支付回调抽象接口
30 | *
31 | * @param payCallbackRequest 支付回调请求参数
32 | */
33 | public abstract void callback(PayCallbackRequest payCallbackRequest);
34 | }
35 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/handler/base/AbstractPayHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.handler.base;
19 |
20 | import org.opengoofy.index12306.biz.payservice.dto.base.PayRequest;
21 | import org.opengoofy.index12306.biz.payservice.dto.base.PayResponse;
22 |
23 | /**
24 | * 抽象支付组件
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public abstract class AbstractPayHandler {
28 |
29 | /**
30 | * 支付抽象接口
31 | *
32 | * @param payRequest 支付请求参数
33 | * @return 支付响应参数
34 | */
35 | public abstract PayResponse pay(PayRequest payRequest);
36 | }
37 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/handler/base/AbstractRefundHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.handler.base;
19 |
20 | import org.opengoofy.index12306.biz.payservice.dto.base.RefundRequest;
21 | import org.opengoofy.index12306.biz.payservice.dto.base.RefundResponse;
22 |
23 | /**
24 | * 抽象退款组件
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public abstract class AbstractRefundHandler {
28 |
29 | /**
30 | * 支付退款接口
31 | *
32 | * @param payRequest 退款请求参数
33 | * @return 退款响应参数
34 | */
35 | public abstract RefundResponse refund(RefundRequest payRequest);
36 | }
37 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/java/org/opengoofy/index12306/biz/payservice/service/RefundService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.payservice.service;
19 | import org.opengoofy.index12306.biz.payservice.dto.RefundReqDTO;
20 | import org.opengoofy.index12306.biz.payservice.dto.RefundRespDTO;
21 |
22 | /**
23 | * 退款接口层
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface RefundService {
27 |
28 | /**
29 | * 公共退款接口
30 | *
31 | * @param requestParam 退款请求参数
32 | * @return 退款返回详情
33 | */
34 | RefundRespDTO commonRefund(RefundReqDTO requestParam);
35 | }
36 |
--------------------------------------------------------------------------------
/services/pay-service/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | # RocketMQ 2.2.3 version does not adapt to SpringBoot3
2 | org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration
--------------------------------------------------------------------------------
/services/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-all
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-services
12 | pom
13 |
14 |
15 | aggregation-service
16 | gateway-service
17 | order-service
18 | pay-service
19 | ticket-service
20 | user-service
21 |
22 |
23 |
24 |
25 | org.springframework.boot
26 | spring-boot-starter-actuator
27 |
28 |
29 |
30 | io.micrometer
31 | micrometer-registry-prometheus
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/constant/Index12306Constant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.common.constant;
19 |
20 | /**
21 | * 系统级公共常量
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public final class Index12306Constant {
25 |
26 | /**
27 | * 提前买票天数
28 | */
29 | public static final int ADVANCE_TICKET_DAY = 15;
30 | }
31 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/RefundTypeEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.common.enums;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | /**
24 | * 退款类型枚举
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @Getter
28 | @RequiredArgsConstructor
29 | public enum RefundTypeEnum {
30 |
31 | /**
32 | * 部分退款
33 | */
34 | PARTIAL_REFUND(11, 0, "PARTIAL_REFUND", "部分退款"),
35 |
36 | /**
37 | * 全部退款
38 | */
39 | FULL_REFUND(12, 1, "FULL_REFUND", "全部退款");
40 |
41 | private final Integer code;
42 |
43 | private final Integer type;
44 |
45 | private final String name;
46 |
47 | private final String value;
48 | }
49 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/SeatStatusEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.common.enums;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | /**
24 | * 座位状态枚举
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @RequiredArgsConstructor
28 | public enum SeatStatusEnum {
29 |
30 | /**
31 | * 可售
32 | */
33 | AVAILABLE(0),
34 |
35 | /**
36 | * 锁定
37 | */
38 | LOCKED(1),
39 |
40 | /**
41 | * 已售
42 | */
43 | SOLD(2);
44 |
45 | @Getter
46 | private final Integer code;
47 | }
48 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/SourceEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.common.enums;
19 |
20 | import lombok.Getter;
21 | import lombok.RequiredArgsConstructor;
22 |
23 | /**
24 | * 购票来源
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @RequiredArgsConstructor
28 | public enum SourceEnum {
29 |
30 | /**
31 | * 互联网购票
32 | */
33 | INTERNET(0),
34 |
35 | /**
36 | * 线下窗口购票
37 | */
38 | OFFLINE(1);
39 |
40 | @Getter
41 | private final Integer code;
42 | }
43 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/common/enums/TicketChainMarkEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.common.enums;
19 |
20 | /**
21 | * 购票相关责任链 Mark 枚举
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public enum TicketChainMarkEnum {
25 |
26 | /**
27 | * 车票查询过滤器
28 | */
29 | TRAIN_QUERY_FILTER,
30 |
31 | /**
32 | * 车票购买过滤器
33 | */
34 | TRAIN_PURCHASE_TICKET_FILTER,
35 |
36 | /**
37 | * 车票退款过滤器
38 | */
39 | TRAIN_REFUND_TICKET_FILTER
40 | }
41 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/CarriageMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.CarriageDO;
22 |
23 | /**
24 | * 车厢实体
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface CarriageMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/RegionMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.RegionDO;
22 |
23 | /**
24 | * 地区持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface RegionMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/StationMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.StationDO;
22 |
23 | /**
24 | * 车站持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface StationMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TicketMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TicketDO;
22 |
23 | /**
24 | * 车票持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface TicketMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainDO;
22 |
23 | /**
24 | * 列车持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface TrainMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainStationMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainStationDO;
22 |
23 | /**
24 | * 列车站点持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface TrainStationMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainStationPriceMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainStationPriceDO;
22 |
23 | /**
24 | * 列车站点价格持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface TrainStationPriceMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dao/mapper/TrainStationRelationMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.ticketservice.dao.entity.TrainStationRelationDO;
22 |
23 | /**
24 | * 列车站点关系持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface TrainStationRelationMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/domain/PurchaseTicketPassengerDetailDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.domain;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 购票乘车人详情实体
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class PurchaseTicketPassengerDetailDTO {
28 |
29 | /**
30 | * 乘车人 ID
31 | */
32 | private String passengerId;
33 |
34 | /**
35 | * 座位类型
36 | */
37 | private Integer seatType;
38 | }
39 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/domain/RouteDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.domain;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Data;
22 | import lombok.NoArgsConstructor;
23 |
24 | /**
25 | * 站点路线实体
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | @NoArgsConstructor
30 | @AllArgsConstructor
31 | public class RouteDTO {
32 |
33 | /**
34 | * 出发站点
35 | */
36 | private String startStation;
37 |
38 | /**
39 | * 目的站点
40 | */
41 | private String endStation;
42 | }
43 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/domain/SeatTypeCountDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.domain;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Data;
22 | import lombok.NoArgsConstructor;
23 |
24 | /**
25 | * 座位类型和座位数量实体
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | @NoArgsConstructor
30 | @AllArgsConstructor
31 | public class SeatTypeCountDTO {
32 |
33 | /**
34 | * 座位类型
35 | */
36 | private Integer seatType;
37 |
38 | /**
39 | * 座位类型 - 对应数量
40 | */
41 | private Integer seatCount;
42 | }
43 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/CancelTicketOrderReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.req;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Data;
22 | import lombok.NoArgsConstructor;
23 |
24 | /**
25 | * 取消车票订单请求入参
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | @NoArgsConstructor
30 | @AllArgsConstructor
31 | public class CancelTicketOrderReqDTO {
32 |
33 | /**
34 | * 订单号
35 | */
36 | private String orderSn;
37 | }
38 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/RefundTicketReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.req;
19 |
20 | import lombok.Data;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * 车票退款请求入参数实体
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | public class RefundTicketReqDTO {
30 |
31 | /**
32 | * 订单号
33 | */
34 | private String orderSn;
35 |
36 | /**
37 | * 退款类型 0 部分退款 1 全部退款
38 | */
39 | private Integer type;
40 |
41 | /**
42 | * 部分退款子订单记录id集合
43 | */
44 | private List subOrderRecordIdReqList;
45 | }
46 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/RegionStationQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.req;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 地区&站点查询请求入参
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class RegionStationQueryReqDTO {
28 |
29 | /**
30 | * 查询方式
31 | */
32 | private Integer queryType;
33 |
34 | /**
35 | * 名称
36 | */
37 | private String name;
38 | }
39 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/req/TicketOrderItemQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.req;
19 |
20 | import lombok.Data;
21 | import java.util.List;
22 |
23 | /**
24 | * 车票子订单查询
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @Data
28 | public class TicketOrderItemQueryReqDTO {
29 |
30 | /**
31 | * 订单号
32 | */
33 | private String orderSn;
34 |
35 | /**
36 | * 子订单记录id
37 | */
38 | private List orderItemRecordIds;
39 | }
40 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/RefundTicketRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 车票退款返回详情实体
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class RefundTicketRespDTO {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/RegionStationQueryRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 地区&站点分页查询响应参数
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class RegionStationQueryRespDTO {
28 |
29 | /**
30 | * 名称
31 | */
32 | private String name;
33 |
34 | /**
35 | * 地区编码
36 | */
37 | private String code;
38 |
39 | /**
40 | * 拼音
41 | */
42 | private String spell;
43 | }
44 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/StationQueryRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 站点分页查询响应参数
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class StationQueryRespDTO {
28 |
29 | /**
30 | * 名称
31 | */
32 | private String name;
33 |
34 | /**
35 | * 地区编码
36 | */
37 | private String code;
38 |
39 | /**
40 | * 拼音
41 | */
42 | private String spell;
43 |
44 | /**
45 | * 城市名称
46 | */
47 | private String regionName;
48 | }
49 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/dto/resp/TicketPurchaseRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.dto.resp;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Builder;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 |
25 | import java.util.List;
26 |
27 | /**
28 | * 车票购买返回参数
29 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
30 | */
31 | @Data
32 | @AllArgsConstructor
33 | @NoArgsConstructor
34 | @Builder
35 | public class TicketPurchaseRespDTO {
36 |
37 | /**
38 | * 订单号
39 | */
40 | private String orderSn;
41 |
42 | /**
43 | * 乘车人订单详情
44 | */
45 | private List ticketOrderDetails;
46 | }
47 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/remote/dto/PayInfoRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.remote.dto;
19 |
20 | import lombok.Data;
21 |
22 | import java.util.Date;
23 |
24 | /**
25 | * 支付单详情信息返回参数
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | public class PayInfoRespDTO {
30 |
31 | /**
32 | * 订单号
33 | */
34 | private String orderSn;
35 |
36 | /**
37 | * 支付总金额
38 | */
39 | private Integer totalAmount;
40 |
41 | /**
42 | * 支付状态
43 | */
44 | private Integer status;
45 |
46 | /**
47 | * 支付时间
48 | */
49 | private Date gmtPayment;
50 | }
51 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/remote/dto/RefundRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.remote.dto;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 退款详情返回参数实体
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class RefundRespDTO {
28 | }
29 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/CarriageService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.service;
19 |
20 | import java.util.List;
21 |
22 | /**
23 | * 列车车厢接口层
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public interface CarriageService {
27 |
28 | /**
29 | * 查询列车车厢号集合
30 | *
31 | * @param trainId 列车 ID
32 | * @param carriageType 车厢类型
33 | * @return 车厢号集合
34 | */
35 | List listCarriageNumber(String trainId, Integer carriageType);
36 | }
37 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/handler/ticket/base/IPurchaseTicket.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.service.handler.ticket.base;
19 |
20 | /**
21 | * 购票顶级抽象接口,为后续火车、高铁、汽车、飞机等出行工具规定行为约束
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public interface IPurchaseTicket {
25 | }
26 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/handler/ticket/base/TrainBitMapCheckSeat.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.service.handler.ticket.base;
19 |
20 | /**
21 | * 高铁验证座位接口
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public interface TrainBitMapCheckSeat extends BitMapCheckSeat {
25 | }
26 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/java/org/opengoofy/index12306/biz/ticketservice/service/handler/ticket/dto/TokenResultDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.ticketservice.service.handler.ticket.dto;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Builder;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 |
25 | import java.util.List;
26 |
27 | /**
28 | * 令牌扣减返回参数
29 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
30 | */
31 | @Data
32 | @NoArgsConstructor
33 | @AllArgsConstructor
34 | @Builder
35 | public class TokenResultDTO {
36 |
37 | /**
38 | * Token 为空
39 | */
40 | private Boolean tokenIsNull;
41 |
42 | /**
43 | * 获取 Token 为空站点座位类型和数量
44 | */
45 | private List tokenIsNullSeatTypeCounts;
46 | }
47 |
--------------------------------------------------------------------------------
/services/ticket-service/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | # RocketMQ 2.2.3 version does not adapt to SpringBoot3
2 | org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration
--------------------------------------------------------------------------------
/services/ticket-service/src/main/resources/lua/ticket_availability_rollback_token_bucket.lua:
--------------------------------------------------------------------------------
1 | local inputString = KEYS[2]
2 | local actualKey = inputString
3 | local colonIndex = string.find(actualKey, ":")
4 | if colonIndex ~= nil then
5 | actualKey = string.sub(actualKey, colonIndex + 1)
6 | end
7 |
8 | local jsonArrayStr = ARGV[1]
9 | local jsonArray = cjson.decode(jsonArrayStr)
10 | local alongJsonArrayStr = ARGV[2]
11 | local alongJsonArray = cjson.decode(alongJsonArrayStr)
12 |
13 | for index, jsonObj in ipairs(jsonArray) do
14 | local seatType = tonumber(jsonObj.seatType)
15 | local count = tonumber(jsonObj.count)
16 | for indexTwo, alongJsonObj in ipairs(alongJsonArray) do
17 | local startStation = tostring(alongJsonObj.startStation)
18 | local endStation = tostring(alongJsonObj.endStation)
19 | local actualInnerHashKey = startStation .. "_" .. endStation .. "_" .. seatType
20 | local ticketSeatAvailabilityTokenValue = tonumber(redis.call('hget', KEYS[1], tostring(actualInnerHashKey)))
21 | if ticketSeatAvailabilityTokenValue >= 0 then
22 | redis.call('hincrby', KEYS[1], tostring(actualInnerHashKey), count)
23 | end
24 | end
25 | end
26 |
27 | return 0
28 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/UserServiceApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice;
19 |
20 | import org.mybatis.spring.annotation.MapperScan;
21 | import org.springframework.boot.SpringApplication;
22 | import org.springframework.boot.autoconfigure.SpringBootApplication;
23 |
24 | /**
25 | * 用户服务应用启动器
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @SpringBootApplication
29 | @MapperScan("org.opengoofy.index12306.biz.userservice.dao.mapper")
30 | public class UserServiceApplication {
31 |
32 | public static void main(String[] args) {
33 | SpringApplication.run(UserServiceApplication.class, args);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/common/constant/Index12306Constant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.common.constant;
19 |
20 | /**
21 | * 系统级公共常量
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public final class Index12306Constant {
25 |
26 | /**
27 | * 用户注册可复用用户名分片数
28 | */
29 | public static final int USER_REGISTER_REUSE_SHARDING_COUNT = 1024;
30 | }
31 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/common/enums/UserChainMarkEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.common.enums;
19 |
20 | /**
21 | * 用户相关责任链 Mark 枚举
22 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
23 | */
24 | public enum UserChainMarkEnum {
25 |
26 | /**
27 | * 用户注册过滤器
28 | */
29 | USER_REGISTER_FILTER
30 | }
31 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/common/enums/VerifyStatusEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.common.enums;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Getter;
22 |
23 | /**
24 | * 用户注册错误码枚举
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | @AllArgsConstructor
28 | public enum VerifyStatusEnum {
29 |
30 | /**
31 | * 未审核
32 | */
33 | UNREVIEWED(0),
34 |
35 | /**
36 | * 已审核
37 | */
38 | REVIEWED(1);
39 |
40 | @Getter
41 | private final int code;
42 | }
43 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/entity/UserReuseDO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dao.entity;
19 |
20 | import com.baomidou.mybatisplus.annotation.TableName;
21 | import lombok.AllArgsConstructor;
22 | import lombok.Data;
23 | import lombok.NoArgsConstructor;
24 | import org.opengoofy.index12306.framework.starter.database.base.BaseDO;
25 |
26 | /**
27 | * 用户名复用表实体
28 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
29 | */
30 | @Data
31 | @NoArgsConstructor
32 | @AllArgsConstructor
33 | @TableName("t_user_reuse")
34 | public final class UserReuseDO extends BaseDO {
35 |
36 | /**
37 | * 用户名
38 | */
39 | private String username;
40 | }
41 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/PassengerMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.userservice.dao.entity.PassengerDO;
22 |
23 | /**
24 | * 乘车人持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface PassengerMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserDeletionMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserDeletionDO;
22 |
23 | /**
24 | * 用户注销表持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface UserDeletionMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserMailMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserMailDO;
22 |
23 | /**
24 | * 用户邮箱表持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface UserMailMapper extends BaseMapper {
28 |
29 | /**
30 | * 注销用户
31 | *
32 | * @param userMailDO 注销用户入参
33 | */
34 | void deletionUser(UserMailDO userMailDO);
35 | }
36 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserDO;
22 |
23 | /**
24 | * 用户信息持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface UserMapper extends BaseMapper {
28 |
29 | /**
30 | * 注销用户
31 | *
32 | * @param userDO 注销用户入参
33 | */
34 | void deletionUser(UserDO userDO);
35 | }
36 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserPhoneMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserPhoneDO;
22 |
23 | /**
24 | * 用户手机号持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface UserPhoneMapper extends BaseMapper {
28 |
29 | /**
30 | * 注销用户
31 | *
32 | * @param userPhoneDO 注销用户入参
33 | */
34 | void deletionUser(UserPhoneDO userPhoneDO);
35 | }
36 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dao/mapper/UserReuseMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dao.mapper;
19 |
20 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21 | import org.opengoofy.index12306.biz.userservice.dao.entity.UserReuseDO;
22 |
23 | /**
24 | * 用户名复用持久层
25 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
26 | */
27 | public interface UserReuseMapper extends BaseMapper {
28 | }
29 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/PassengerRemoveReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dto.req;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 乘车人移除请求参数
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class PassengerRemoveReqDTO {
28 |
29 | /**
30 | * 乘车人id
31 | */
32 | private String id;
33 | }
34 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/PassengerReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dto.req;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 乘车人添加&修改请求参数
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class PassengerReqDTO {
28 |
29 | /**
30 | * 乘车人id
31 | */
32 | private String id;
33 |
34 | /**
35 | * 真实姓名
36 | */
37 | private String realName;
38 |
39 | /**
40 | * 证件类型
41 | */
42 | private Integer idType;
43 |
44 | /**
45 | * 证件号码
46 | */
47 | private String idCard;
48 |
49 | /**
50 | * 优惠类型
51 | */
52 | private Integer discountType;
53 |
54 | /**
55 | * 手机号
56 | */
57 | private String phone;
58 | }
59 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/UserDeletionReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dto.req;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 用户注销请求参数
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class UserDeletionReqDTO {
28 |
29 | /**
30 | * 用户名
31 | */
32 | private String username;
33 | }
34 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/UserLoginReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dto.req;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Data;
22 | import lombok.NoArgsConstructor;
23 |
24 | /**
25 | * 用户登录请求参数
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | @NoArgsConstructor
30 | @AllArgsConstructor
31 | public class UserLoginReqDTO {
32 |
33 | /**
34 | * 用户名
35 | */
36 | private String usernameOrMailOrPhone;
37 |
38 | /**
39 | * 密码
40 | */
41 | private String password;
42 | }
43 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/req/UserUpdateReqDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dto.req;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 用户修改请求参数
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class UserUpdateReqDTO {
28 |
29 | /**
30 | * 用户ID
31 | */
32 | private String id;
33 |
34 | /**
35 | * 用户名
36 | */
37 | private String username;
38 |
39 | /**
40 | * 邮箱
41 | */
42 | private String mail;
43 |
44 | /**
45 | * 旅客类型
46 | */
47 | private Integer userType;
48 |
49 | /**
50 | * 邮编
51 | */
52 | private String postCode;
53 |
54 | /**
55 | * 地址
56 | */
57 | private String address;
58 | }
59 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/resp/UserLoginRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dto.resp;
19 |
20 | import lombok.AllArgsConstructor;
21 | import lombok.Data;
22 | import lombok.NoArgsConstructor;
23 |
24 | /**
25 | * 用户登录返回参数
26 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
27 | */
28 | @Data
29 | @NoArgsConstructor
30 | @AllArgsConstructor
31 | public class UserLoginRespDTO {
32 |
33 | /**
34 | * 用户 ID
35 | */
36 | private String userId;
37 |
38 | /**
39 | * 用户名
40 | */
41 | private String username;
42 |
43 | /**
44 | * 真实姓名
45 | */
46 | private String realName;
47 |
48 | /**
49 | * Token
50 | */
51 | private String accessToken;
52 | }
53 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/dto/resp/UserRegisterRespDTO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.dto.resp;
19 |
20 | import lombok.Data;
21 |
22 | /**
23 | * 用户注册返回参数
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | @Data
27 | public class UserRegisterRespDTO {
28 |
29 | /**
30 | * 用户名
31 | */
32 | private String username;
33 |
34 | /**
35 | * 真实姓名
36 | */
37 | private String realName;
38 |
39 | /**
40 | * 手机号
41 | */
42 | private String phone;
43 | }
44 |
--------------------------------------------------------------------------------
/services/user-service/src/main/java/org/opengoofy/index12306/biz/userservice/toolkit/UserReuseUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.opengoofy.index12306.biz.userservice.toolkit;
19 |
20 | import static org.opengoofy.index12306.biz.userservice.common.constant.Index12306Constant.USER_REGISTER_REUSE_SHARDING_COUNT;
21 |
22 | /**
23 | * 用户名可复用工具类
24 | * 公众号:马丁玩编程,回复:加群,添加马哥微信(备注:12306)获取项目资料
25 | */
26 | public final class UserReuseUtil {
27 |
28 | /**
29 | * 计算分片位置
30 | */
31 | public static int hashShardingIdx(String username) {
32 | return Math.abs(username.hashCode() % USER_REGISTER_REUSE_SHARDING_COUNT);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/services/user-service/src/main/resources/application.yaml:
--------------------------------------------------------------------------------
1 |
2 | server:
3 | port: 9001
4 |
5 | spring:
6 | application:
7 | name: index12306-user${unique-name:}-service
8 | datasource:
9 | driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
10 | url: jdbc:shardingsphere:classpath:shardingsphere-config.yaml
11 | data:
12 | redis:
13 | host: 127.0.0.1
14 | port: 6379
15 | password: 123456
16 | cloud:
17 | nacos:
18 | discovery:
19 | server-addr: 127.0.0.1:8848
20 | password: nacos
21 | username: nacos
22 | sentinel:
23 | transport:
24 | dashboard: localhost:8686
25 | port: 8719
26 | mybatis-plus:
27 | global-config:
28 | db-config:
29 | logic-delete-field: delFlag
30 | logic-delete-value: 1
31 | logic-not-delete-value: 0
32 | configuration:
33 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
34 |
35 | framework:
36 | fastjson:
37 | safa-mode: true
38 | cache:
39 | redis:
40 | value-timeout: 50000
41 | bloom-filter:
42 | user-register:
43 | name: user_register_cache_penetration_bloom_filter${unique-name:}
44 |
45 | management:
46 | endpoints:
47 | web:
48 | exposure:
49 | include: '*'
50 | metrics:
51 | tags:
52 | application: ${spring.application.name}
53 |
--------------------------------------------------------------------------------
/services/user-service/src/main/resources/mapper/UserMailMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | update t_user_mail
25 | set deletion_time = #{deletionTime},
26 | del_flag = '1'
27 | where mail = #{mail}
28 | and del_flag = '0'
29 |
30 |
--------------------------------------------------------------------------------
/services/user-service/src/main/resources/mapper/UserMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | update t_user
25 | set deletion_time = #{deletionTime},
26 | del_flag = '1'
27 | where username = #{username} and del_flag = '0'
28 |
29 |
--------------------------------------------------------------------------------
/services/user-service/src/main/resources/mapper/UserPhoneMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | update t_user_phone
25 | set deletion_time = #{deletionTime},
26 | del_flag = '1'
27 | where phone = #{phone}
28 | and del_flag = '0'
29 |
30 |
--------------------------------------------------------------------------------
/tests/general/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-tests
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-general-test
12 |
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter
17 |
18 |
19 |
20 | org.springframework.boot
21 | spring-boot-starter-test
22 | test
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/tests/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.opengoofy.index12306
7 | index12306-all
8 | 0.0.1-SNAPSHOT
9 |
10 |
11 | index12306-tests
12 | pom
13 |
14 |
15 | general
16 |
17 |
18 |
--------------------------------------------------------------------------------