基于SpringBoot 的CMS系统,拿去开发企业官网真香(附源码)

前言
推荐这个项目是因为使用手册部署手册非常完善,项目也有开发教程视频对小白非常贴心,接私活可以直接拿去二开非常舒服

开源说明

  • 系统100%开源
  • 模块化开发模式,铭飞所开发的模块都发布到了maven中央库。可以通过pom.xml文件的方式拉取源代码
<dependency>
	<groupId>net.mingsoft</groupId>
	<artifactId>模块</artifactId>
	<version>版本号</version>
	<classifier>sources</classifier>
	<scope>provided</scope>
</dependency>

商用

基于MIT开源协议,可直接商用无需授权,但请尊重开源精神不要去掉代码中铭飞的注释和版权信息

特点

  • 免费完整开源:基于MIT协议,源代码完全开源,无商业限制,MS开发团队承诺将MCMS内容系统永久完整开源;关注Java项目分享
  • 标签化建站:不需要专业的后台开发技能,只要使用系统提供的标签,就能轻松建设网站;
  • html静态化:系统支持全站静态化;
  • 跨终端:站点同时支持PC与移动端访问,同时会自动根据访问的终端切换到对应的界面,数据由系统统一管理;
  • 海量模版:铭飞通过MStore(MS商城)分享更多免费、精美的企业网站模版,降低建站成本;关注Java项目分享
  • 丰富插件:为了让MCms适应更多的业务场景,在MStore用户可以下载对应的插件,如:站群插件、微信插件、商城插件等;
  • 每月更新:铭飞团队承诺每月28日为系统升级日,分享更多好用等模版与插件;
  • 文档丰富:为了让用户更快速的使用MCms系统进行开发,铭飞团队持续更新开发相关文档,如标签文档、使用文档、视频教程等;

面向对象

  • 企 业:帮助创立初期的公司或团队快速搭建产品的技术平台,加快公司项目开发进度;
  • 开发者:帮助开发者快速完成承接外包的项目,避免从零搭建系统;
  • 学习者:初学JAVA的同学可以下载源代码来进行学习交流;

开发环境

建议开发者使用以下环境,这样避免版本带来的问题

  • Windows、Linux
  • Eclipse、Idea
  • Mysql≧5.7
  • JDK≧8
  • Tomcat≧8

1. MCms内容插件手册

MCms内容插件提供最基本的菜单、权限、角色、栏目、内容、静态化、等常用功能。
视频教程:内容插件视频教程 配合代码生成器使用快速提升开发效率:代码生成器在线视频教程、代码生成器使用文档

1.1. Apache Maven依赖

1.1.1. 当前版本

<!-- ms-mcms 内容模块插件 -->
<dependency>
    <groupId>net.mingsoft</groupId>
    <artifactId>ms-mcms</artifactId>
    <version>当前版本</version>
</dependency>
<!-- ms-mcms 内容模块源码 -->
<dependency>
    <groupId>net.mingsoft</groupId>
    <artifactId>ms-mcms</artifactId>
    <version>当前版本</version>
    <classifier>sources</classifier>
</dependency>Copy

1.2. 接口

项目访问路径/swagger-ui.html#/

系统部署手册

1. jar部署

1.1. 打包方式1

懒人做法,将所有的资源打成一个jar包,维护资源不方便,不推荐

mvn clean package
java -jar ms-mcms.jarCopy

1.2. 打包方式2(推荐)

打包指令增加参数 -f bin-xml ,执行完成会在target目录会生成 “ 项目-bin ” 发布文件夹

mvn clean package -f bin-xml
Copy

1.2.1. 目录结构

config:配置文件

html:静态化自动生成的目录(自动生成)

static:静态资源文件

templets:(必须)模版目录,需要复制一份

upload:(必须)上传的文件夹

WEB-INF:ftl视图文件

mcms.log:自动生成的日志文件

*.sh:linux启动、停止脚本

*.bat:window启动、停止脚本

技术选型

后端框架

技术

名称

官网

Spring Framework

容器

http://projects.spring.io/spring-framework

Spring Boot

MVC框架

https://spring.io/projects/spring-boot

Apache Shiro

安全框架

http://shiro.apache.org

Spring session

分布式Session管理

http://projects.spring.io/spring-session

MyBatis

ORM框架

http://www.mybatis.org

<
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
对于使用Spring Boot和Element UI开发CMS内容管理系统的代码,以下是一个简单的示例供你参考: 首先,创建一个Spring Boot项目并添加相应的依赖。在pom.xml文件中添加以下依赖: ```xml <dependencies> <!-- Spring Boot Web --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- Spring Boot JPA --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <!-- Element UI --> <dependency> <groupId>org.webjars</groupId> <artifactId>element-ui</artifactId> <version>2.15.1</version> </dependency> <!-- MySQL Connector --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> </dependencies> ``` 然后,创建一个实体类来表示CMS内容: ```java @Entity @Table(name = "cms_content") public class CmsContent { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String title; private String content; // getter and setter methods } ``` 接下来,创建一个数据访问层的接口,继承自JpaRepository接口: ```java public interface CmsContentRepository extends JpaRepository<CmsContent, Long> { } ``` 然后,创建一个控制器类来处理HTTP请求: ```java @RestController @RequestMapping("/cms") public class CmsController { @Autowired private CmsContentRepository cmsContentRepository; @GetMapping public List<CmsContent> getAllCmsContent() { return cmsContentRepository.findAll(); } @PostMapping public CmsContent createCmsContent(@RequestBody CmsContent cmsContent) { return cmsContentRepository.save(cmsContent); } @PutMapping("/{id}") public CmsContent updateCmsContent(@PathVariable Long id, @RequestBody CmsContent updatedCmsContent) { CmsContent cmsContent = cmsContentRepository.findById(id) .orElseThrow(() -> new ResourceNotFoundException("CmsContent", "id", id)); cmsContent.setTitle(updatedCmsContent.getTitle()); cmsContent.setContent(updatedCmsContent.getContent()); return cmsContentRepository.save(cmsContent); } @DeleteMapping("/{id}") public ResponseEntity<?> deleteCmsContent(@PathVariable Long id) { CmsContent cmsContent = cmsContentRepository.findById(id) .orElseThrow(() -> new ResourceNotFoundException("CmsContent", "id", id)); cmsContentRepository.delete(cmsContent); return ResponseEntity.ok().build(); } } ``` 最后,创建一个HTML页面来展示CMS内容列表和表单: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>CMS Content Management</title> <link rel="stylesheet" href="/webjars/element-ui/2.15.1/theme-chalk/index.css"> </head> <body> <div id="app"> <el-table :data="cmsContentList" style="width: 100%"> <el-table-column prop="title" label="Title"></el-table-column> <el-table-column prop="content" label="Content"></el-table-column> <el-table-column label="Actions"> <template slot-scope="scope"> <el-button type="danger" @click="deleteCmsContent(scope.row.id)">Delete</el-button> </template> </el-table-column> </el-table> <el-form :model="cmsContentForm" label-width="80px"> <el-form-item label="Title"> <el-input v-model="cmsContentForm.title"></el-input> </el-form-item> <el-form-item label="Content"> <el-input v-model="cmsContentForm.content"></el-input> </el-form-item> <el-form-item> <el-button type="primary" @click="createCmsContent">Save</el-button> </el-form-item> </el-form> </div> <script src="/webjars/element-ui/2.15.1/index.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script> new Vue({ el: '#app', data: { cmsContentList: [], cmsContentForm: { title: '', content: '' } }, methods: { getCmsContentList() { axios.get('/cms') .then(response => { this.cmsContentList = response.data; }) .catch(error => { console.error(error); }); }, createCmsContent() { axios.post('/cms', this.cmsContentForm) .then(response => { this.cmsContentList.push(response.data); this.cmsContentForm.title = ''; this.cmsContentForm.content = ''; }) .catch(error => { console.error(error); }); }, deleteCmsContent(id) { axios.delete(`/cms/${id}`) .then(() => { this.cmsContentList = this.cmsContentList.filter(cmsContent => cmsContent.id !== id); }) .catch(error => { console.error(error); }); } }, mounted() { this.getCmsContentList(); } }); </script> </body> </html> ``` 这只是一个简单的示例,你可以根据自己的需求进行扩展和定制。希望对你有所帮助!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值