Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
blg
Commits
8175bc40
Commit
8175bc40
authored
Apr 10, 2026
by
wujipeng
Browse files
init
parents
Pipeline
#330
failed with stages
in 0 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
8175bc40
HELP.md
target/
.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
.mvn/wrapper/maven-wrapper.properties
0 → 100644
View file @
8175bc40
wrapperVersion
=
3.3.4
distributionType
=
only-script
distributionUrl
=
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.14/apache-maven-3.9.14-bin.zip
pom.xml
0 → 100644
View file @
8175bc40
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.7.6
</version>
<relativePath/>
</parent>
<groupId>
org.example
</groupId>
<artifactId>
blg
</artifactId>
<version>
1.0
</version>
<properties>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
com.mysql
</groupId>
<artifactId>
mysql-connector-j
</artifactId>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.5.15
</version>
</dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<version>
5.8.38
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.1
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<encoding>
UTF-8
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.7.6
</version>
<configuration>
<mainClass>
org.example.blg.BlgApplication
</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
src/main/java/org/example/blg/BlgApplication.java
0 → 100644
View file @
8175bc40
package
org.example.blg
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
@MapperScan
(
basePackages
=
{
"org.example.blg.mapper"
})
public
class
BlgApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
BlgApplication
.
class
,
args
);
}
}
src/main/java/org/example/blg/result/PageResult.java
0 → 100644
View file @
8175bc40
package
org.example.blg.result
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
@Setter
@Getter
@Data
public
class
PageResult
<
T
>
{
/**
* 响应码
*/
private
Integer
code
;
/**
* 当前页码
*/
private
Integer
pageNum
;
/**
* 每页数量
*/
private
Integer
pageSize
;
/**
* 总页数
*/
private
Integer
totalPages
;
/**
* 总记录数
*/
private
Long
total
;
/**
* 数据列表
*/
private
List
<
T
>
data
;
// 构造方法
public
PageResult
(
Integer
pageNum
,
Integer
pageSize
,
Long
total
,
List
<
T
>
data
)
{
this
.
code
=
200
;
this
.
pageNum
=
pageNum
;
this
.
pageSize
=
pageSize
;
this
.
total
=
total
;
this
.
data
=
data
;
this
.
totalPages
=
(
int
)
Math
.
ceil
((
double
)
total
/
pageSize
);
}
}
\ No newline at end of file
src/main/java/org/example/blg/result/Result.java
0 → 100644
View file @
8175bc40
package
org.example.blg.result
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 统一响应结果封装类
*/
@Data
public
class
Result
<
T
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 响应码
*/
private
Integer
code
;
/**
* 响应消息
*/
private
String
message
;
/**
* 响应数据
*/
private
T
data
;
/**
* 响应时间戳
*/
private
Long
timestamp
;
/**
* 构造方法
*/
private
Result
()
{
this
.
timestamp
=
System
.
currentTimeMillis
();
}
/**
* 成功响应
*/
public
static
<
T
>
Result
<
T
>
success
()
{
return
success
(
null
);
}
public
static
<
T
>
Result
<
T
>
success
(
T
data
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
200
);
result
.
setMessage
(
"操作成功"
);
result
.
setData
(
data
);
return
result
;
}
public
static
<
T
>
Result
<
T
>
success
(
T
data
,
String
message
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
200
);
result
.
setMessage
(
message
);
result
.
setData
(
data
);
return
result
;
}
/**
* 失败响应
*/
public
static
<
T
>
Result
<
T
>
error
()
{
return
error
(
500
,
"操作失败"
);
}
public
static
<
T
>
Result
<
T
>
error
(
String
message
)
{
return
error
(
500
,
message
);
}
public
static
<
T
>
Result
<
T
>
error
(
Integer
code
,
String
message
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
code
);
result
.
setMessage
(
message
);
return
result
;
}
public
static
<
T
>
Result
<
T
>
error
(
Integer
code
,
String
message
,
T
data
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
code
);
result
.
setMessage
(
message
);
result
.
setData
(
data
);
return
result
;
}
/**
* 通用状态码响应
*/
public
static
<
T
>
Result
<
T
>
of
(
Integer
status
,
String
message
,
T
data
)
{
Result
<
T
>
result
=
new
Result
<>();
result
.
setCode
(
status
);
result
.
setMessage
(
message
);
result
.
setData
(
data
);
return
result
;
}
public
static
<
T
>
Result
<
T
>
of
(
Integer
status
,
String
message
)
{
return
of
(
status
,
message
,
null
);
}
/**
* 便捷方法
*/
public
static
<
T
>
Result
<
T
>
ok
()
{
return
success
();
}
public
static
<
T
>
Result
<
T
>
ok
(
T
data
)
{
return
success
(
data
);
}
public
static
<
T
>
Result
<
T
>
ok
(
T
data
,
String
message
)
{
return
success
(
data
,
message
);
}
}
\ No newline at end of file
src/main/resources/application.yml
0 → 100644
View file @
8175bc40
server
:
port
:
8080
spring
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://192168.10.3:3307/blg?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true
username
:
root
password
:
ruzhoukj@2022
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment