├── .gitignore
├── README.md
├── doc
├── demo
│ ├── HMStrange-mongodb-Noseparte
│ │ ├── .gitignore
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── noseparte
│ │ │ │ │ ├── HmStrangeMongodbApplication.java
│ │ │ │ │ ├── api
│ │ │ │ │ └── web
│ │ │ │ │ │ └── bean
│ │ │ │ │ │ ├── EMsgCode.java
│ │ │ │ │ │ ├── EnumResCode.java
│ │ │ │ │ │ └── ResponseResult.java
│ │ │ │ │ ├── constant
│ │ │ │ │ └── MongoDBConstant.java
│ │ │ │ │ ├── controller
│ │ │ │ │ ├── AbstractController.java
│ │ │ │ │ └── StageTreeController.java
│ │ │ │ │ ├── dao
│ │ │ │ │ └── StageTreeDao.java
│ │ │ │ │ ├── logic
│ │ │ │ │ └── StageTreeShop.java
│ │ │ │ │ └── service
│ │ │ │ │ ├── StageTreeService.java
│ │ │ │ │ └── impl
│ │ │ │ │ └── StageTreeServiceImpl.java
│ │ │ └── resources
│ │ │ │ ├── application-dev.properties
│ │ │ │ └── application.properties
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── noseparte
│ │ │ └── HmStrangeMongodbApplicationTests.java
│ ├── datademo
│ │ ├── .gitignore
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── myself
│ │ │ │ │ └── mybatis
│ │ │ │ │ ├── DatademoApplication.java
│ │ │ │ │ ├── controller
│ │ │ │ │ └── TMsgController.java
│ │ │ │ │ ├── entity
│ │ │ │ │ └── TMsg.java
│ │ │ │ │ ├── mapper
│ │ │ │ │ └── TMsgMapper.java
│ │ │ │ │ └── service
│ │ │ │ │ ├── TMsgService.java
│ │ │ │ │ └── impl
│ │ │ │ │ └── TMsgServiceImpl.java
│ │ │ └── resources
│ │ │ │ ├── application.yml
│ │ │ │ └── mapper
│ │ │ │ └── TMsgMapper.xml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── myself
│ │ │ └── mybatis
│ │ │ └── DatademoApplicationTests.java
│ ├── redisdemo
│ │ ├── .gitignore
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── github
│ │ │ │ │ └── myself
│ │ │ │ │ ├── RedisdemoApplication.java
│ │ │ │ │ ├── controller
│ │ │ │ │ └── MsgController.java
│ │ │ │ │ └── service
│ │ │ │ │ ├── MsgService.java
│ │ │ │ │ └── impl
│ │ │ │ │ └── MsgServiceImpl.java
│ │ │ └── resources
│ │ │ │ └── application.yml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── github
│ │ │ └── myself
│ │ │ └── RedisdemoApplicationTests.java
│ └── springboot-redis
│ │ ├── .gitignore
│ │ ├── doc
│ │ └── springboot -redis.pdf
│ │ ├── pom.xml
│ │ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── springboot_redis_example
│ │ │ │ ├── SpringbootRedisApplication.java
│ │ │ │ ├── config
│ │ │ │ └── redisConfig.java
│ │ │ │ ├── controller
│ │ │ │ └── StudentController.java
│ │ │ │ ├── entity
│ │ │ │ └── Student.java
│ │ │ │ ├── mapper
│ │ │ │ └── StudentMapper.java
│ │ │ │ └── service
│ │ │ │ ├── StudentImpl.java
│ │ │ │ └── StudentService.java
│ │ └── resources
│ │ │ ├── application.properties
│ │ │ └── mybatis
│ │ │ ├── mapper
│ │ │ └── StudentMapper.xml
│ │ │ └── mybatis-config.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── springboot_redis_example
│ │ └── SpringbootRedisApplicationTests.java
├── details
│ └── update_record.md
├── members
│ ├── homework.md
│ ├── informations.md
│ └── specification.md
├── milestone
│ └── milestone-doc.md
└── study
│ ├── organization.md
│ └── system_01.md
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── github
│ │ └── HmStrangeApplication.java
└── resources
│ └── application.properties
└── test
└── java
└── com
└── github
└── HmStrangeApplicationTests.java
/.gitignore:
--------------------------------------------------------------------------------
1 | HELP.md
2 | /target/
3 | !.mvn/wrapper/maven-wrapper.jar
4 |
5 | ### STS ###
6 | .apt_generated
7 | .classpath
8 | .factorypath
9 | .project
10 | .settings
11 | .springBeans
12 | .sts4-cache
13 |
14 | ### IntelliJ IDEA ###
15 | .idea
16 | *.iws
17 | *.iml
18 | *.ipr
19 |
20 | ### NetBeans ###
21 | /nbproject/private/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
26 | /build/
27 |
28 | ### VS Code ###
29 | .vscode/
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # HMStrange
2 |
3 | ## 简介
4 |
5 | > An e-commerce back-end framework that supports diversified configurations
6 |
7 | 一个支持多元化配置的电商后端框架
8 |
9 | ## 里程碑
10 |
11 | * [HMStrange-项目里程碑](doc/milestone/milestone-doc.md)
12 |
13 | ## 项目详情
14 |
15 | * [HMStrange-项目组织架构](doc/study/organization.md)
16 | * [HMStrange-项目更新记录](doc/details/update_record.md)
17 | * [HMStrange-项目模块说明]()
18 |
19 | ## 学习相关
20 |
21 | * [电商商品管理系统说明](doc/study/system_01.md)
22 |
23 | ## 项目组成员信息
24 |
25 | * [HMStrange-项目组成员信息表](doc/members/informations.md)
26 |
27 | ### 当前情况
28 |
29 | 项目组以微信群形式组织,目前群内15人,实质参与10人。
30 |
31 | ### 入门任务
32 |
33 | * [初次提交代码指南](https://www.imooc.com/article/284151)
34 | * [阅读规范并手写签名指南](https://www.imooc.com/article/284213)
35 |
36 | ### 加入我们
37 |
38 | - 添加**MySelf**个人微信号:Dr5204484,备注:HMStrange项目组
39 | - 填写信息登记表
40 | - 首次为项目提交代码
41 | - 基于项目组合作平等原则,参与开发规划任务
42 | - 学有所成!
43 |
44 | ## 下载地址
45 |
46 | https://github.com/UncleCatMySelf/HMStrange/releases
47 |
48 | ## 问题
49 |
50 | https://github.com/UncleCatMySelf/HMStrange/issues
51 |
52 |
53 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /nbbuild/
22 | /dist/
23 | /nbdist/
24 | /.nb-gradle/
25 | /build/
26 |
27 | ### VS Code ###
28 | .vscode/
29 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | org.springframework.boot
7 | spring-boot-starter-parent
8 | 2.1.0.RELEASE
9 |
10 |
11 | com.noseparte
12 | mongodb
13 | 0.0.1-SNAPSHOT
14 | HMStrange-mongodb
15 | Demo project for Spring Boot integration mongodb
16 |
17 |
18 | 1.8
19 |
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter
25 |
26 |
27 | org.springframework.boot
28 | spring-boot-starter-web
29 |
30 |
31 | org.springframework.boot
32 | spring-boot-starter-test
33 | test
34 |
35 |
36 | org.springframework.boot
37 | spring-boot-starter-data-mongodb
38 |
39 |
40 | org.projectlombok
41 | lombok
42 | true
43 |
44 |
45 |
46 | org.apache.commons
47 | commons-lang3
48 | 3.8
49 |
50 |
51 | com.alibaba
52 | fastjson
53 | 1.2.47
54 |
55 |
56 |
57 |
58 |
59 |
60 | org.springframework.boot
61 | spring-boot-maven-plugin
62 |
63 |
64 |
65 |
66 |
67 |
68 | spring-snapshots
69 | Spring Snapshots
70 | https://repo.spring.io/snapshot
71 |
72 | true
73 |
74 |
75 |
76 | spring-milestones
77 | Spring Milestones
78 | https://repo.spring.io/milestone
79 |
80 |
81 |
82 |
83 | spring-snapshots
84 | Spring Snapshots
85 | https://repo.spring.io/snapshot
86 |
87 | true
88 |
89 |
90 |
91 | spring-milestones
92 | Spring Milestones
93 | https://repo.spring.io/milestone
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/HmStrangeMongodbApplication.java:
--------------------------------------------------------------------------------
1 | package com.noseparte;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class HmStrangeMongodbApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(HmStrangeMongodbApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/api/web/bean/EMsgCode.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.api.web.bean;
2 |
3 | public enum EMsgCode {
4 | success(80021), // 成功
5 | error(90013), //失败
6 | ;
7 |
8 | private EMsgCode(int code) {
9 | this.code = code;
10 | }
11 |
12 | public int code;
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/api/web/bean/EnumResCode.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.api.web.bean;
2 |
3 | public enum EnumResCode {
4 | SUCCESSFUL(0), SERVER_SUCCESS(2), SERVER_ERROR(-1);
5 |
6 | private EnumResCode(int status) {
7 | this.status = status;
8 | }
9 |
10 | private int status;
11 |
12 | public int value() {
13 | return status;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/api/web/bean/ResponseResult.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.api.web.bean;
2 |
3 | import lombok.Data;
4 | import lombok.ToString;
5 |
6 | @Data
7 | @ToString
8 | public class ResponseResult {
9 | private int status;
10 | private String msg = "";
11 | private int msgCode;
12 | private Object result;
13 |
14 | @Data
15 | public static class ShareResult {
16 | int energy;
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/constant/MongoDBConstant.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.constant;
2 |
3 | import com.noseparte.logic.StageTreeShop;
4 | import org.springframework.data.annotation.Immutable;
5 |
6 | @Immutable
7 | public final class MongoDBConstant {
8 |
9 | public final static String StageTreeShop = "stageTreeShop";
10 |
11 |
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/controller/AbstractController.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.controller;
2 |
3 | import com.noseparte.api.web.bean.EMsgCode;
4 | import com.noseparte.api.web.bean.EnumResCode;
5 | import com.noseparte.api.web.bean.ResponseResult;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 | public abstract class AbstractController {
10 |
11 | private static final Logger log = LoggerFactory.getLogger(AbstractController.class);
12 |
13 | protected ResponseResult successJson(EMsgCode msgCode, Object data) {
14 | ResponseResult result = new ResponseResult();
15 | result.setStatus(EnumResCode.SUCCESSFUL.value());
16 | result.setMsgCode(msgCode.code);
17 | result.setResult(data);
18 | return result;
19 | }
20 |
21 | protected ResponseResult successJson(Object data) {
22 | ResponseResult result = new ResponseResult();
23 | result.setStatus(EnumResCode.SUCCESSFUL.value());
24 | result.setMsgCode(EMsgCode.success.code);
25 | result.setResult(data);
26 | return result;
27 | }
28 |
29 | public static ResponseResult errorJson(EMsgCode msgCode) {
30 | log.info(msgCode.toString());
31 | ResponseResult result = new ResponseResult();
32 | result.setStatus(EnumResCode.SERVER_ERROR.value());
33 | result.setMsgCode(msgCode.code);
34 | return result;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/controller/StageTreeController.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.controller;
2 |
3 | import com.alibaba.fastjson.JSONObject;
4 | import com.noseparte.api.web.bean.EMsgCode;
5 | import com.noseparte.api.web.bean.ResponseResult;
6 | import com.noseparte.logic.StageTreeShop;
7 | import com.noseparte.service.StageTreeService;
8 | import lombok.extern.slf4j.Slf4j;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.web.bind.annotation.PostMapping;
11 | import org.springframework.web.bind.annotation.RequestMapping;
12 | import org.springframework.web.bind.annotation.RequestParam;
13 | import org.springframework.web.bind.annotation.RestController;
14 |
15 | import java.util.List;
16 | import java.util.Objects;
17 |
18 | @Slf4j
19 | @RestController
20 | @RequestMapping("/api/tree")
21 | public class StageTreeController extends AbstractController {
22 |
23 | @Autowired
24 | private StageTreeService stageTreeService;
25 |
26 | @PostMapping("/covers")
27 | public ResponseResult getStageTreeCovers(
28 | @RequestParam("pageSize") int pageSize,
29 | @RequestParam("pageNumber") int pageNumber,
30 | @RequestParam("storyType") int storyType
31 | ) {
32 | if (Objects.isNull(storyType) && storyType < 0) {
33 | return errorJson(EMsgCode.error);
34 | }
35 |
36 | List stageTreeShops = stageTreeService.findTreeStages(storyType, pageSize, pageNumber);
37 | long count = stageTreeService.countByChannel(storyType);
38 | JSONObject jsonObject = new JSONObject();
39 | jsonObject.put("datas", stageTreeShops);
40 | jsonObject.put("total", count);
41 | return successJson(jsonObject);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/dao/StageTreeDao.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.dao;
2 |
3 | import com.noseparte.logic.StageTreeShop;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.data.mongodb.core.MongoTemplate;
6 | import org.springframework.data.mongodb.core.query.Criteria;
7 | import org.springframework.data.mongodb.core.query.Query;
8 | import org.springframework.stereotype.Repository;
9 |
10 | import java.util.List;
11 |
12 | @Repository
13 | public class StageTreeDao {
14 |
15 | @Autowired
16 | protected MongoTemplate mongoTemplate;
17 |
18 | public List findTreeStages(int storyType, int pageSize, int pageNumber) {
19 | Query query = new Query();
20 | query.addCriteria(Criteria.where("isShow").is(1)); //标识未下架的
21 | if(storyType > 0){
22 | query.addCriteria(Criteria.where("storyType").is(storyType)); //标识未下架的
23 | }
24 | query.skip((pageNumber - 1) * pageSize).limit(pageSize); // 分页
25 | return mongoTemplate.find(query, StageTreeShop.class);
26 | }
27 |
28 | public long countByChannel(int storyType) {
29 | Query query = new Query();
30 | query.addCriteria(Criteria.where("isShow").is(1)); //标识未下架的
31 | if(storyType > 0){
32 | query.addCriteria(Criteria.where("storyType").is(storyType)); //标识未下架的
33 | }
34 | return mongoTemplate.count(query, StageTreeShop.class);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/doc/demo/HMStrange-mongodb-Noseparte/src/main/java/com/noseparte/logic/StageTreeShop.java:
--------------------------------------------------------------------------------
1 | package com.noseparte.logic;
2 |
3 | import com.noseparte.constant.MongoDBConstant;
4 | import lombok.Data;
5 | import org.springframework.data.mongodb.core.mapping.Document;
6 |
7 | import java.util.List;
8 |
9 | @Data
10 | @Document(collection = MongoDBConstant.StageTreeShop)
11 | public class StageTreeShop {
12 |
13 | private String _id;
14 | private Long treeId;
15 | private String name;
16 | private String textureUrl;
17 | private String dec;
18 | private String voiceUrl;
19 | private Long voiceTime;
20 | private Boolean isCanCreateBattle;
21 | private Integer maxEnergy;
22 | private Integer pce;
23 | private Integer eri;
24 | private Integer shareGetEnergy;
25 | private Integer buyEnergyCost;
26 | private Integer buyEnergyCostType;
27 | private Boolean isEnergyRecoveryInterval;
28 | private Boolean isShareGetEnergy;
29 | private Integer storyType;
30 | private Boolean isConditionLimit;
31 | private Integer conditionType;
32 | private Integer conditionValue;
33 | private Boolean isElementLimit1;
34 | private Boolean isElementLimit2;
35 | private Integer serial;
36 | private Long headNodeId;
37 | private Long createTick;
38 | private Long submitTick;
39 | private Long updateTick;
40 | private Integer isShow;
41 | private Integer praise;
42 | private Integer propGetType;
43 | private Integer isShowStage;
44 | private Boolean isUsePropLimit;
45 | private List