yeshijie před 4 roky
rodič
revize
66dc97735c

+ 3 - 0
guns-base-support/guns-core/src/main/java/cn/stylefeng/guns/core/consts/SpringSecurityConstant.java

@ -54,6 +54,9 @@ public interface SpringSecurityConstant {
            "/login",
            "/logout",
            //开发
            "/open/**",
            //文件的
            "/sysFileInfo/upload",
            "/sysFileInfo/download",

+ 11 - 1
guns-main/src/main/java/cn/stylefeng/guns/modular/controller/ExampleController.java

@ -26,9 +26,13 @@ package cn.stylefeng.guns.modular.controller;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * 一个示例接口
 *
@ -36,11 +40,17 @@ import org.springframework.web.bind.annotation.RestController;
 * @date 2020/4/9 18:09
 */
@RestController
@RequestMapping("/test")
@RequestMapping("/open")
public class ExampleController {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @RequestMapping("/niceDay")
    public ResponseData niceDay() {
        List<String> list = jdbcTemplate.queryForList("SELECT  version()",String.class);
        return new SuccessResponseData("nice day");
    }

+ 10 - 0
guns-main/src/main/resources/application-test.yml

@ -0,0 +1,10 @@
# Mysql数据库
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://172.26.0.104/guns-separation?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT
    username: ssgg
    password: ssgg@jkzl2019
    # 连接池大小根据实际情况调整
    max-active: 20
    max-pool-prepared-statement-per-connection-size: 20