Skip to content

Commit 4322091

Browse files
committed
完善readme
1 parent a06a14f commit 4322091

13 files changed

+131
-112
lines changed

README.md

+28-11
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<p align="center">
44
<a href="#公众号" target="_blank"><img src="https://img.shields.io/badge/公众号-沉默王二-brightgreen.svg"></a>
5-
<a href="#公众号" target="_blank"><img src="https://img.shields.io/badge/交流-微信群-blue.svg"></a>
6-
<a href="https://github.com/itwanger/codingmore-learning" target="_blank"><img src="https://img.shields.io/badge/学习教程-codingmore--learning-red"></a>
5+
<a href="https://tobebetterjavaer.com/zhishixingqiu/" target="_blank"><img src="https://img.shields.io/badge/交流-知识星球-blue.svg"></a>
6+
<a href="https://tobebetterjavaer.com/home.html" target="_blank"><img src="https://img.shields.io/badge/学习教程-Java 程序员进阶之路-red"></a>
77
<a href="https://github.com/itwanger/codingmore-admin-web" target="_blank">
88
<img src="https://img.shields.io/badge/前端项目-codingmore--admin--web-orange.svg" alt="前端项目">
99
</a>
@@ -14,31 +14,45 @@
1414

1515
## 友情提示
1616

17-
> 1. **快速体验项目**[在线访问地址](http://www.codingmore.top/admin/index.html)
18-
> 2. **全套学习教程**[codingmore学习教程](http://www.codingmore.top/learning/README)
19-
> 3. **专属学习路线**:学习不走弯路,整理了套非常不错的[《codingmore专属学习路线](#公众号)
20-
> 5. **项目交流**:想要加群交流项目的朋友,可以加入[codingmore项目交流群](#公众号)
17+
> 1. **快速体验项目**[在线访问地址](http://www.codingmore.top/admin/)
18+
> 2. **全套学习教程**[Java 程序员进阶之路](https://tobebetterjavaer.com/home.html)
19+
> 3. **专属学习路线**:学习不走弯路,整理了一套非常不错的[《Java 后端学习路线](#公众号)
20+
> 5. **项目交流**:想要加群交流项目的朋友,可以加入 [知识星球,提供一对一 VIP 洗脚服务](https://tobebetterjavaer.com/zhishixingqiu/)
2121
2222
## 前言
2323

2424
编程喵(Codingmore)项目致力于打造一个完整的编程类学习网站,从教程到实战,一站式打法,技术上引领潮流,文档上无微不至。
2525

2626
## 项目文档
2727

28-
- 文档地址:[doc.codingmore.com](http://www.codingmore.top/learning/)
29-
- 备用地址[https://github.com/itwanger/codingmore-learning](https://github.com/itwanger/codingmore-learning)
28+
- 文档地址:[http://www.codingmore.top](http://www.codingmore.top)
29+
- 源码地址[https://github.com/itwanger/codingmore-learning](https://github.com/itwanger/codingmore-learning)
3030

3131
## 项目介绍
3232

33-
编程喵(Codingmore)是一套成熟的编程类学习网站,基于 SpringBoot+MyBatis实现,采用Docker容器化部署。网站前台包含首页门户、文章搜索、文章展示、文章推荐等模块。网站管理端包括统计报表、文章管理等模块
33+
编程喵🐱(Codingmore)是一套成熟的编程类学习网站,基于 SpringBoot+Vue实现。Web 端包含首页门户、文章搜索、文章展示、文章推荐等模块。网站管理端包括统计报表、文章管理、栏目管理、权限管理等模块
3434

3535
### 项目展示
3636

3737
#### 后台管理系统
3838

39-
后台管理系统的前端项目 `codingmore-admin-web` 地址:[https://github.com/itwanger/codingmore-admin-web](https://github.com/itwanger/codingmore-admin-web)
39+
后台管理的 Web 端 `codingmore-admin-web` 地址:[https://github.com/itwanger/codingmore-admin-web](https://github.com/itwanger/codingmore-admin-web)
4040

41-
后台管理系统的演示地址:[http://www.codingmore.top/admin/index.html](http://www.codingmore.top/admin/index.html)
41+
后台管理系统的演示地址:[http://www.codingmore.top/admin](http://www.codingmore.top/admin)
42+
43+
![](https://cdn.tobebetterjavaer.com/codingmore/codingmore.admin.jpg)
44+
45+
#### Web 前端
46+
47+
Web 前端的演示地址:[http://www.codingmore.top](http://www.codingmore.top/)
48+
49+
网页端:
50+
51+
52+
53+
手机端:
54+
55+
![](https://cdn.tobebetterjavaer.com/codingmore/codingmore.admin.jpg)
4256

4357
### 组织结构:
4458

@@ -86,10 +100,13 @@ nprogress |进度条控件| https://github.com/rstacruz/nprogress
86100

87101
##### 系统架构图
88102

103+
![](https://cdn.tobebetterjavaer.com/codingmore/codingmore.drawio.png)
89104

90105

91106
##### 业务架构图
92107

108+
109+
93110
#### 模块介绍
94111

95112
##### 后台管理系统 `codingmore-admin`

codingmore-admin/src/main/java/com/codingmore/config/CodingmoreSecurityConfig.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.springframework.context.annotation.Bean;
99
import org.springframework.context.annotation.Configuration;
1010
import org.springframework.security.access.ConfigAttribute;
11+
import org.springframework.security.access.SecurityConfig;
1112
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
1213
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
1314
import org.springframework.security.core.userdetails.UserDetailsService;
@@ -23,7 +24,7 @@
2324
@Configuration
2425
@EnableWebSecurity
2526
@EnableGlobalMethodSecurity(prePostEnabled = true)
26-
public class CodingmoreSecurityConfig extends SecurityConfig {
27+
public class CodingmoreSecurityConfig extends CustomSecurityConfig {
2728

2829
@Autowired
2930
private IUsersService usersService;
@@ -44,7 +45,7 @@ public Map<String, ConfigAttribute> loadDataSource() {
4445
Map<String, ConfigAttribute> map = new ConcurrentHashMap<>();
4546
List<Resource> resources = resourceService.list();
4647
resources.forEach(item->{
47-
map.put(item.getUrl(), new org.springframework.security.access.SecurityConfig(item.getResourceId() + ":" + item.getName()));
48+
map.put(item.getUrl(), new SecurityConfig(item.getResourceId() + ":" + item.getName()));
4849
});
4950
return map;
5051
}

codingmore-admin/src/main/java/com/codingmore/config/GlobalCorsConfig.java

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ public CorsFilter corsFilter() {
2121
CorsConfiguration config = new CorsConfiguration();
2222
//允许所有域名进行跨域调用
2323
config.addAllowedOriginPattern("*");
24-
// 设置你要允许的网站域名
25-
// config.addAllowedOrigin("http://localhost:8080");
2624
//允许跨域发送cookie
2725
config.setAllowCredentials(true);
2826
//放行全部原始头信息

codingmore-admin/src/main/java/com/codingmore/controller/PostTagController.java

+2-31
Original file line numberDiff line numberDiff line change
@@ -81,36 +81,6 @@ public ResultObject<String> update(@Valid PostTagParam postAddTagParam) {
8181
return ResultObject.success(postTagService.updateById(postTag) ? "修改成功" : "修改失败");
8282
}
8383

84-
@RequestMapping(value = "/simpleTest", method = RequestMethod.POST)
85-
@ResponseBody
86-
@ApiOperation("修改标签/Redis 测试用")
87-
// Spring Cache 测试代码
88-
// @CachePut(value = "codingmore", key = "'codingmore:postags:'+#postAddTagParam.postTagId")
89-
public ResultObject<PostTag> simpleTest(@Valid PostTagParam postAddTagParam) {
90-
if (postAddTagParam.getPostTagId() == null) {
91-
return ResultObject.failed("标签id不能为空");
92-
}
93-
PostTag postTag = postTagService.getById(postAddTagParam.getPostTagId());
94-
if (postTag == null) {
95-
return ResultObject.failed("标签不存在");
96-
}
97-
QueryWrapper<PostTag> queryWrapper = new QueryWrapper<>();
98-
queryWrapper.eq("description", postAddTagParam.getDescription());
99-
int count = postTagService.count(queryWrapper);
100-
if (count > 0) {
101-
return ResultObject.failed("标签名称已存在");
102-
}
103-
BeanUtils.copyProperties(postAddTagParam, postTag);
104-
105-
boolean successFlag = postTagService.updateById(postTag);
106-
107-
String key = "redis:simple:" + postTag.getPostTagId();
108-
redisService.set(key, postTag);
109-
110-
PostTag cachePostTag = (PostTag) redisService.get(key);
111-
return ResultObject.success(cachePostTag);
112-
}
113-
11484
@RequestMapping(value = "/getByPostId", method = RequestMethod.GET)
11585
@ResponseBody
11686
@ApiOperation("根据文章内容获取标签")
@@ -132,7 +102,8 @@ public ResultObject<List<PostTag>> getByName(String keyWord) {
132102
@ResponseBody
133103
@ApiOperation("删除")
134104
public ResultObject<String> delete(Long postTagId) {
135-
return ResultObject.success(postTagService.removeTag(postTagId) ? "删除成功" : "删除失败");
105+
postTagService.removeTag(postTagId);
106+
return ResultObject.success("删除成功");
136107
}
137108

138109
@RequestMapping(value = "/queryPageable", method = RequestMethod.GET)

codingmore-admin/src/main/java/com/codingmore/controller/PostsController.java

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public class PostsController {
5656
@ResponseBody
5757
@ApiOperation("添加文章")
5858
public ResultObject<String> insert(@Valid PostsParam postsParam, BindingResult result) {
59+
// TODO 定时发布
60+
postsParam.setPostDate(null);
5961
postsService.savePosts(postsParam);
6062
return ResultObject.success("保存成功");
6163
}
@@ -71,6 +73,8 @@ public ResultObject<PostsVo> getById(long postsId) {
7173
@ResponseBody
7274
@ApiOperation("更新")
7375
public ResultObject<String> update(@Valid PostsParam postsParam) {
76+
// TODO 定时发布
77+
postsParam.setPostDate(null);
7478
postsService.updatePosts(postsParam);
7579
return ResultObject.success("更新成功");
7680
}

codingmore-admin/src/main/java/com/codingmore/service/IPostTagService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ public interface IPostTagService extends IService<PostTag> {
2929
* @param postTagId
3030
* @return
3131
*/
32-
boolean removeTag(long postTagId);
32+
boolean removeTag(Long postTagId);
3333
}

codingmore-admin/src/main/java/com/codingmore/service/impl/PostTagServiceImpl.java

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.codingmore.service.IPostTagRelationService;
99
import com.codingmore.service.IPostTagService;
1010
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11+
import lombok.extern.slf4j.Slf4j;
1112
import org.springframework.beans.BeanUtils;
1213
import org.springframework.beans.factory.annotation.Autowired;
1314
import org.springframework.stereotype.Service;
@@ -27,16 +28,20 @@
2728
*/
2829
@Service
2930
@Transactional
31+
@Slf4j
3032
public class PostTagServiceImpl extends ServiceImpl<PostTagMapper, PostTag> implements IPostTagService {
3133
@Autowired
3234
private IPostTagRelationService postTagRelationService;
33-
3435

3536
@Override
3637
public boolean savePostTag(PostAddTagParam postAddTagParam) {
38+
log.info("保存文章的标签{}", postAddTagParam);
39+
3740
PostTag postTag = new PostTag();
3841
BeanUtils.copyProperties(postAddTagParam,postTag);
39-
boolean result = this.save(postTag);
42+
43+
boolean result = save(postTag);
44+
4045
if(postAddTagParam.getPostId()!=null){
4146
PostTagRelation postTagRelation = new PostTagRelation();
4247
postTagRelation.setPostTagId(postTag.getPostTagId());
@@ -59,7 +64,7 @@ public List<PostTag> getByPostId(Long postId) {
5964
}
6065

6166
@Override
62-
public boolean removeTag(long postTagId) {
67+
public boolean removeTag(Long postTagId) {
6368
QueryWrapper<PostTagRelation> postTagRelationQueryWrapper = new QueryWrapper();
6469
postTagRelationQueryWrapper.eq("post_tag_id",postTagId);
6570
postTagRelationService.remove(postTagRelationQueryWrapper);

0 commit comments

Comments
 (0)