Skip to content

Commit b2ce118

Browse files
committed
更改目录结构
1 parent 3ff1c27 commit b2ce118

File tree

15 files changed

+261
-0
lines changed

15 files changed

+261
-0
lines changed

admin-api/pom.xml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>admin</artifactId>
7+
<groupId>com.lmxdawn</groupId>
8+
<version>0.0.1</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>admin-api</artifactId>
13+
14+
<dependencies>
15+
16+
<dependency>
17+
<groupId>org.springframework.boot</groupId>
18+
<artifactId>spring-boot-starter-web</artifactId>
19+
</dependency>
20+
21+
<dependency>
22+
<groupId>org.mybatis.spring.boot</groupId>
23+
<artifactId>mybatis-spring-boot-starter</artifactId>
24+
<version>1.3.2</version>
25+
</dependency>
26+
27+
<dependency>
28+
<groupId>mysql</groupId>
29+
<artifactId>mysql-connector-java</artifactId>
30+
<scope>runtime</scope>
31+
</dependency>
32+
33+
<dependency>
34+
<groupId>com.alibaba</groupId>
35+
<artifactId>druid</artifactId>
36+
<version>1.1.12</version>
37+
</dependency>
38+
39+
<dependency>
40+
<groupId>org.projectlombok</groupId>
41+
<artifactId>lombok</artifactId>
42+
<optional>true</optional>
43+
</dependency>
44+
45+
<dependency>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-starter-test</artifactId>
48+
<scope>test</scope>
49+
</dependency>
50+
51+
</dependencies>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-maven-plugin</artifactId>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
62+
</project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.lmxdawn.admin;
2+
3+
import org.mybatis.spring.annotation.MapperScan;
4+
import org.springframework.boot.SpringApplication;
5+
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
import org.springframework.boot.web.servlet.ServletComponentScan;
7+
8+
@SpringBootApplication
9+
@ServletComponentScan
10+
@MapperScan("com.lmxdawn.admin.dao")
11+
public class AdminApplication {
12+
13+
public static void main(String[] args) {
14+
SpringApplication.run(AdminApplication.class, args);
15+
}
16+
17+
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.lmxdawn.admin.config;
2+
3+
import com.alibaba.druid.support.http.WebStatFilter;
4+
5+
import javax.servlet.annotation.WebFilter;
6+
import javax.servlet.annotation.WebInitParam;
7+
8+
/**
9+
* 配置监控拦截器 (过滤不需要监控的后缀)
10+
* druid监控拦截器
11+
*/
12+
@WebFilter(filterName = "druidWebStatFilter", urlPatterns = "/*",
13+
initParams = {
14+
@WebInitParam(name = "exclusions", value = "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*")//忽略资源
15+
}
16+
)
17+
public class DruidStatFilter extends WebStatFilter {
18+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.lmxdawn.admin.config;
2+
3+
import com.alibaba.druid.support.http.StatViewServlet;
4+
5+
import javax.servlet.annotation.WebInitParam;
6+
import javax.servlet.annotation.WebServlet;
7+
8+
/**
9+
* druid监控视图配置 (监控视图配置)
10+
*/
11+
@WebServlet(urlPatterns = "/druid/*", initParams={
12+
@WebInitParam(name="allow",value="127.0.0.1"),// IP白名单 (没有配置或者为空,则允许所有访问)
13+
@WebInitParam(name="deny",value="192.168.16.111"),// IP黑名单 (存在共同时,deny优先于allow)
14+
@WebInitParam(name="loginUsername",value="admin"),// 用户名
15+
@WebInitParam(name="loginPassword",value="admin"),// 密码
16+
@WebInitParam(name="resetEnable",value="true")// 禁用HTML页面上的“Reset All”功能
17+
})
18+
public class DruidStatViewServlet extends StatViewServlet {
19+
private static final long serialVersionUID = 2359758657306626394L;
20+
21+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.lmxdawn.admin.controller;
2+
3+
import com.lmxdawn.admin.entity.AuthAdmin;
4+
import com.lmxdawn.admin.service.AuthAdminService;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.web.bind.annotation.GetMapping;
7+
import org.springframework.web.bind.annotation.RestController;
8+
9+
import java.util.List;
10+
11+
@RestController
12+
public class HelloController {
13+
14+
@Autowired
15+
private AuthAdminService authAdminService;
16+
17+
@GetMapping("/hello")
18+
public List<AuthAdmin> hello() {
19+
List<AuthAdmin> authAdminList = authAdminService.queryList();
20+
System.out.println(authAdminList);
21+
return authAdminList;
22+
}
23+
24+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package com.lmxdawn.admin.dao;
2+
3+
import com.lmxdawn.admin.entity.AuthAdmin;
4+
import org.apache.ibatis.annotations.Mapper;
5+
6+
import java.util.List;
7+
8+
@Mapper
9+
public interface AuthAdminDao {
10+
11+
/**
12+
* 查询列表
13+
* @return 列表
14+
*/
15+
List<AuthAdmin> queryAuthAdmin();
16+
17+
/**
18+
* 根据id查询
19+
* @param id 传入的id
20+
* @return
21+
*/
22+
AuthAdmin queryAuthAdminById(Long id);
23+
24+
/**
25+
* 插入
26+
* @param authAdmin
27+
* @return
28+
*/
29+
int insertAuthAdmin(AuthAdmin authAdmin);
30+
31+
/**
32+
* 更新
33+
* @param authAdmin
34+
* @return
35+
*/
36+
int updateAuthAdmin(AuthAdmin authAdmin);
37+
38+
/**
39+
* 删除
40+
* @param id
41+
* @return
42+
*/
43+
int deleteAuthAdminById(Long id);
44+
45+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.lmxdawn.admin.service;
2+
3+
4+
import com.lmxdawn.admin.entity.AuthAdmin;
5+
6+
import java.util.List;
7+
8+
public interface AuthAdminService {
9+
10+
List<AuthAdmin> queryList();
11+
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.lmxdawn.admin.service.impl;
2+
3+
import com.lmxdawn.admin.dao.AuthAdminDao;
4+
import com.lmxdawn.admin.entity.AuthAdmin;
5+
import com.lmxdawn.admin.service.AuthAdminService;
6+
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.stereotype.Service;
8+
9+
import java.util.List;
10+
11+
@Service
12+
public class AuthAdminServiceImpl implements AuthAdminService {
13+
14+
@Autowired
15+
private AuthAdminDao authAdminDao;
16+
17+
@Override
18+
public List<AuthAdmin> queryList() {
19+
return authAdminDao.queryAuthAdmin();
20+
}
21+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
server.port=9998
2+
spring.datasource.url=jdbc:mysql://localhost/vue-admin
3+
spring.datasource.username=root
4+
spring.datasource.password=root
5+
6+
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
7+
8+
mybatis.config-location=classpath:mybatis/mybatis-config.xml
9+
mybatis.mapper-locations=classpath:mybatis/mapper/*.xml

0 commit comments

Comments
 (0)