欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

基于SpringBoot + Vue 的前后端分离博客管理系统

程序员文章站 2022-05-06 16:12:12
...

10126 基于SpringBoot + Vue 的前后端分离博客管理系统

代码
鏈椄:https://pan.baidu.com/s/1tw4Qvtcuwt7ys36M7HvLSg
趧紶碼:1589
f/u枝此段内容后打开baidu網盤手机App,caozuo更方便哦

技术
SpringBoot + Vue

工具
eclipse + tomact + mysql + jdk

功能详情

  • 文章管理
  • 用户管理
  • 栏目管理
  • 数据统计
    基于SpringBoot + Vue 的前后端分离博客管理系统
    基于SpringBoot + Vue 的前后端分离博客管理系统

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

@EnableAutoConfiguration
@ComponentScan
@ImportResource (value={“applicationContext.xml” })
public class Application {

 public static void main(String[] args) {
   SpringApplication. run(Application. class, args );
}

}
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tianshouzhi.springbootstudy.domain.Person;
import com.tianshouzhi.springbootstudy.service.PersonService;

@RestController
public class PersonController {

 @Autowired
 private PersonService personService ;

 public PersonController() {
   System. out .println(" 我是 PersonController,我被实例化了 " );
}

 @RequestMapping( "/person" )
 public Person test(){
    return personService .getPerson();
}

}import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tianshouzhi.springbootstudy.dao.PersonDao;
import com.tianshouzhi.springbootstudy.domain.Person;

@Service
public class PersonService {

 @Autowired
 private PersonDao personDao ;

 public PersonService() {
   System. out .println(" 我是 PersonService,我被实例化了 " );
}

 public Person getPerson() {
    return personDao .getPerson();
}

}<?xml version = "1.0" encoding ="UTF-8" ?>

 <bean id= "personDao" class ="com.tianshouzhi.springbootstudy.dao.PersonDao" ></bean>

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class ExampleAction {
private int singletonInt=1;
@RequestMapping(value = “/test”)
@ResponseBody
public String singleton(HttpServletRequest request,
HttpServletResponse response) throws Exception {
String data=request.getParameter(“data”);
if(data!=null&&data.length()>0){
try{
int paramInt= Integer.parseInt(data);
singletonInt = singletonInt + paramInt;
}
catch(Exception ex){
singletonInt+=10;
}
}else{
singletonInt+=1000;
}
return String.valueOf(singletonInt);
}
}

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

org.springframework.boot
spring-boot-starter-parent
2.1.6.RELEASE


com.example
test
0.0.1-SNAPSHOT
test
Demo project for Spring Boot

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <!--thymeleaf模板引擎配置-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <!--Web依赖-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <!--MyBatis配置-->
    <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>2.1.0</version>
    </dependency>
    <!--MySQL数据库配置-->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.41</version>
        <scope>runtime</scope>
    </dependency>
    <!--单元测试配置-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>