Compare commits
201 Commits
GYZ_branch
...
master
Author | SHA1 | Date |
---|---|---|
|
d909ce3be9 | 3 years ago |
|
8c679a7136 | 3 years ago |
|
75f618ba1a | 3 years ago |
|
b72b6e7b9f | 3 years ago |
|
d8d45ccf58 | 3 years ago |
|
68c93ed5c4 | 3 years ago |
|
ec30014e3a | 3 years ago |
|
b272217c86 | 3 years ago |
|
c3aee13020 | 3 years ago |
|
eebfa3cec5 | 3 years ago |
|
1eb8e22332 | 3 years ago |
|
7a82f2c89b | 3 years ago |
|
34d081e868 | 3 years ago |
|
664b4f70f2 | 3 years ago |
|
70a163d5cd | 3 years ago |
|
29ea96a615 | 3 years ago |
|
b4c3a71748 | 3 years ago |
|
e058388cb3 | 3 years ago |
|
ea634a674c | 3 years ago |
|
9be82fb13b | 3 years ago |
|
85ea1cb4ee | 3 years ago |
|
c1452783df | 3 years ago |
|
2162d632bb | 3 years ago |
|
0a867b0480 | 3 years ago |
|
3719f76121 | 3 years ago |
|
919bd2ccc1 | 3 years ago |
|
0ca9f71446 | 3 years ago |
|
814d52eb5c | 3 years ago |
|
6b78674dab | 3 years ago |
|
8f4aaf384d | 3 years ago |
|
ac8ea4b4b5 | 3 years ago |
|
50503c0cc7 | 3 years ago |
|
d66f9d5e42 | 3 years ago |
|
38d80d8b32 | 3 years ago |
|
b9c802a40a | 3 years ago |
|
a0a09f5ead | 3 years ago |
|
fbb20a36bc | 3 years ago |
|
157bd0eb48 | 3 years ago |
|
3049ca2a44 | 3 years ago |
|
717727b70a | 3 years ago |
|
c8079e9baa | 3 years ago |
|
38ed0ba9dc | 3 years ago |
|
2477915abe | 3 years ago |
|
0429442a80 | 3 years ago |
|
e4670a4379 | 3 years ago |
|
1f5918e81b | 3 years ago |
|
c6668a0e14 | 3 years ago |
|
b9d71363fe | 3 years ago |
|
1be5703c90 | 3 years ago |
|
1ef8c46760 | 3 years ago |
|
415b87ee77 | 3 years ago |
|
57682e78bc | 3 years ago |
|
af575aa2d4 | 3 years ago |
|
35fd05457e | 3 years ago |
|
99c41f6cf3 | 3 years ago |
|
d21056fdcb | 3 years ago |
|
b83ac8008c | 3 years ago |
|
06790aeb4f | 3 years ago |
|
b5d2602192 | 3 years ago |
|
5087a09c70 | 3 years ago |
|
ea67192ba8 | 3 years ago |
|
69dd1db0b7 | 3 years ago |
|
f41fd9dc5e | 3 years ago |
|
1d0d12b1f6 | 3 years ago |
|
fc72af05ab | 3 years ago |
|
dbaaa0459c | 3 years ago |
|
5f8cedc18d | 3 years ago |
|
b28a786e70 | 3 years ago |
|
f997737018 | 3 years ago |
|
3ceaf3a189 | 3 years ago |
|
d8cb47d9e3 | 3 years ago |
|
352f14e5df | 3 years ago |
|
a4dcc40d60 | 3 years ago |
|
a5e145d9d2 | 3 years ago |
|
b65073ba33 | 3 years ago |
|
9efdd1e20d | 3 years ago |
|
abbe1178a3 | 3 years ago |
|
971b9c3338 | 3 years ago |
|
a547c2715a | 3 years ago |
|
4f657e45d9 | 3 years ago |
|
5da4f99707 | 3 years ago |
|
b0e177f4f5 | 3 years ago |
|
0c2ae9f649 | 3 years ago |
|
d8a155e1f1 | 3 years ago |
|
8fa2d90747 | 3 years ago |
|
f653b17853 | 3 years ago |
|
2e02b734d2 | 3 years ago |
|
a2c22401f1 | 3 years ago |
|
d1df15b0e9 | 3 years ago |
|
8fed3b9e85 | 3 years ago |
|
778b293d9c | 3 years ago |
|
5d5ae65e90 | 3 years ago |
|
8cd13ba58c | 3 years ago |
|
c4f35b70b4 | 3 years ago |
|
836a980e41 | 3 years ago |
|
0ed49c92e8 | 3 years ago |
|
e102b549e2 | 3 years ago |
|
0a9748a208 | 3 years ago |
|
730d2ba4e0 | 3 years ago |
|
59f55fdb9a | 3 years ago |
|
e61c5390c7 | 3 years ago |
|
a3e85432cc | 3 years ago |
|
2c15d4f95b | 3 years ago |
|
e9bd79b231 | 3 years ago |
|
f556daac82 | 3 years ago |
|
709a700480 | 3 years ago |
|
7608cd12ef | 3 years ago |
|
e5623802a5 | 3 years ago |
|
19f76a8ccb | 3 years ago |
|
8cd6f9b706 | 3 years ago |
|
34ae96c9ae | 3 years ago |
|
18b67bee21 | 3 years ago |
|
1f50b3e7f7 | 3 years ago |
|
d862860a53 | 3 years ago |
|
41a5679270 | 3 years ago |
|
772c01be2b | 3 years ago |
|
9521290293 | 3 years ago |
|
d6d8d32e28 | 3 years ago |
|
2ba819be78 | 3 years ago |
|
dc446e47bf | 3 years ago |
|
81e70ad5b9 | 3 years ago |
|
417a01c6d6 | 3 years ago |
|
9e89549a8a | 3 years ago |
|
01c9ce6449 | 3 years ago |
|
f8d0dc6086 | 3 years ago |
|
f554e4ec9a | 3 years ago |
|
4dfcfac342 | 3 years ago |
|
8426685d9c | 3 years ago |
|
b5594cef54 | 3 years ago |
|
2d7111a9e9 | 3 years ago |
|
f6a78f468e | 3 years ago |
|
1e2796bbed | 3 years ago |
|
8f15946848 | 3 years ago |
|
3c48e67587 | 3 years ago |
|
8750954d69 | 3 years ago |
|
023f86d2db | 3 years ago |
|
24fab9bbbf | 3 years ago |
|
07a9b3534f | 3 years ago |
|
524caa1bcc | 3 years ago |
|
c65fcd8cde | 3 years ago |
|
72f1398aa9 | 3 years ago |
|
5bc204c4e4 | 3 years ago |
|
9cee3d7e99 | 3 years ago |
|
dc3a9e8305 | 3 years ago |
|
34c674ead5 | 3 years ago |
|
3b2850a040 | 3 years ago |
|
69e29ade54 | 3 years ago |
|
8e118496ef | 3 years ago |
|
474d6dd9d7 | 3 years ago |
|
198a4c73d1 | 3 years ago |
|
2855be6777 | 3 years ago |
|
297c481571 | 3 years ago |
|
0454f42f94 | 3 years ago |
|
d48db6aebe | 3 years ago |
|
d88c643d7a | 3 years ago |
|
7529749c50 | 3 years ago |
|
dffc1844a3 | 3 years ago |
|
abdd21c4a6 | 3 years ago |
|
a2a9356db3 | 3 years ago |
|
91322f90c8 | 3 years ago |
|
dccdb5f666 | 3 years ago |
|
a4693a07b4 | 3 years ago |
|
e827eb90b6 | 3 years ago |
|
c1c9ac2f2f | 3 years ago |
|
53089383d1 | 3 years ago |
|
8df47db160 | 3 years ago |
|
12e86728de | 3 years ago |
|
dde9f2809a | 3 years ago |
|
9409ffe58f | 3 years ago |
|
7c2a600831 | 3 years ago |
|
3ff206144b | 3 years ago |
|
a5daee9230 | 3 years ago |
|
f1b23ff8a1 | 3 years ago |
|
0a35ea42c3 | 3 years ago |
|
9729e9a554 | 3 years ago |
|
5731625fd5 | 3 years ago |
|
2508356745 | 3 years ago |
|
f17f8168bc | 3 years ago |
|
01abbacc4d | 3 years ago |
|
0de209cd44 | 3 years ago |
|
f46d7d69b1 | 3 years ago |
|
8d9efb721e | 3 years ago |
|
ff93918445 | 3 years ago |
|
95ede9da6d | 3 years ago |
|
6364d45ffa | 3 years ago |
|
a0fc9ac7dc | 3 years ago |
|
04c1d61063 | 3 years ago |
|
1a91633546 | 3 years ago |
|
ec2a8d21c4 | 3 years ago |
|
ffad823f75 | 3 years ago |
|
5378b74451 | 3 years ago |
|
8b4d7508c2 | 3 years ago |
|
e6f45b0f10 | 3 years ago |
|
ebc6bc86f4 | 3 years ago |
|
047bf6f33a | 3 years ago |
|
634fdf842a | 3 years ago |
|
98b5b3e521 | 3 years ago |
|
b0a6c9f3aa | 3 years ago |
|
06e482c538 | 3 years ago |
|
78c2d7964e | 3 years ago |
|
f1fb535cc0 | 3 years ago |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 35 KiB |
@ -1 +0,0 @@
|
|||||||
d1
|
|
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 76 KiB |
@ -0,0 +1,135 @@
|
|||||||
|
package com.example.demo.common;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.http.NameValuePair;
|
||||||
|
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.client.utils.URIBuilder;
|
||||||
|
import org.apache.http.entity.ContentType;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URI;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class HttpClientUtil {
|
||||||
|
|
||||||
|
public static String doGet(String url, Map<String, String> param) {
|
||||||
|
|
||||||
|
// 创建Httpclient对象
|
||||||
|
CloseableHttpClient httpclient = HttpClients.createDefault();
|
||||||
|
|
||||||
|
String resultString = "";
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
try {
|
||||||
|
// 创建uri
|
||||||
|
URIBuilder builder = new URIBuilder(url);
|
||||||
|
if (param != null) {
|
||||||
|
for (String key : param.keySet()) {
|
||||||
|
builder.addParameter(key, param.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
URI uri = builder.build();
|
||||||
|
|
||||||
|
// 创建http GET请求
|
||||||
|
HttpGet httpGet = new HttpGet(uri);
|
||||||
|
|
||||||
|
// 执行请求
|
||||||
|
response = httpclient.execute(httpGet);
|
||||||
|
// 判断返回状态是否为200
|
||||||
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
|
resultString = EntityUtils.toString(response.getEntity(), "UTF-8");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (response != null) {
|
||||||
|
response.close();
|
||||||
|
}
|
||||||
|
httpclient.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doGet(String url) {
|
||||||
|
return doGet(url, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doPost(String url, Map<String, String> param) {
|
||||||
|
// 创建Httpclient对象
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
String resultString = "";
|
||||||
|
try {
|
||||||
|
// 创建Http Post请求
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// 创建参数列表
|
||||||
|
if (param != null) {
|
||||||
|
List<NameValuePair> paramList = new ArrayList<>();
|
||||||
|
for (String key : param.keySet()) {
|
||||||
|
paramList.add(new BasicNameValuePair(key, param.get(key)));
|
||||||
|
}
|
||||||
|
// 模拟表单
|
||||||
|
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
}
|
||||||
|
// 执行http请求
|
||||||
|
response = httpClient.execute(httpPost);
|
||||||
|
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
response.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doPost(String url) {
|
||||||
|
return doPost(url, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String doPostJson(String url, String json) {
|
||||||
|
// 创建Httpclient对象
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
String resultString = "";
|
||||||
|
try {
|
||||||
|
// 创建Http Post请求
|
||||||
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
// 创建请求内容
|
||||||
|
StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
// 执行http请求
|
||||||
|
response = httpClient.execute(httpPost);
|
||||||
|
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
response.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultString;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.example.demo.common;
|
||||||
|
|
||||||
|
public class UploadFileTool {
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.example.demo.common.util;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ResponseResult {
|
||||||
|
/**
|
||||||
|
* 请求状态
|
||||||
|
*/
|
||||||
|
private boolean success;
|
||||||
|
/**
|
||||||
|
* 返回提示信息
|
||||||
|
*/
|
||||||
|
private String msg;
|
||||||
|
/**
|
||||||
|
* 返回数据
|
||||||
|
*/
|
||||||
|
private Object data;
|
||||||
|
|
||||||
|
public ResponseResult(boolean success, String msg, Object data) {
|
||||||
|
this.success = success;
|
||||||
|
this.msg = msg;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponseResult(boolean code, String msg) {
|
||||||
|
this.success = success;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponseResult(boolean success) {
|
||||||
|
this.success = success;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.example.demo.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MyMvcConfig implements WebMvcConfigurer {
|
||||||
|
@Override
|
||||||
|
public void addViewControllers(ViewControllerRegistry registry) {
|
||||||
|
registry.addViewController("/").setViewName("index");
|
||||||
|
registry.addViewController("/index.html").setViewName("index");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
registry.addInterceptor(new LoginHandleInterceptor()).addPathPatterns("/resource").excludePathPatterns("/index.html","dashboard","/","/login","/css/**","/js/**","/img/**");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
package com.example.demo.config;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.models.ExternalDocumentation;
|
||||||
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
|
import io.swagger.v3.oas.models.info.License;
|
||||||
|
import org.springdoc.core.GroupedOpenApi;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SpringDoc API文档相关配置
|
||||||
|
* Created by kirito on 2022/10/2.
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class SpringDocConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public GroupedOpenApi publicApi() {
|
||||||
|
return GroupedOpenApi.builder()
|
||||||
|
.group("") //分组
|
||||||
|
.pathsToMatch("") //匹配url路径
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.example.demo.config.config;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
|
import com.example.demo.domain.Task;
|
||||||
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class BaseEntityMetaObjectHandler implements MetaObjectHandler {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertFill(MetaObject metaObject) {
|
||||||
|
// 创建时间自动填充
|
||||||
|
if (metaObject.hasSetter(Task.CREATE_TIME) && ObjectUtil.isNull(getFieldValByName(Task.CREATE_TIME, metaObject))) {
|
||||||
|
this.strictInsertFill(metaObject, Task.CREATE_TIME, LocalDateTime.class, LocalDateTime.now());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
//修改时间自动填充
|
||||||
|
if (metaObject.hasSetter(Task.MODIFIED_TIME) && ObjectUtil.isNull(getFieldValByName(Task.MODIFIED_TIME, metaObject))) {
|
||||||
|
this.strictUpdateFill(metaObject, Task.MODIFIED_TIME, LocalDateTime.class, LocalDateTime.now());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.example.demo.config.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MybatisPlus 配置类
|
||||||
|
*
|
||||||
|
* @author huang
|
||||||
|
* @since 2022-03-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MybatisPlusConfig {
|
||||||
|
/**
|
||||||
|
* 分页插件
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||||
|
return interceptor;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package com.example.demo.controller;
|
||||||
|
|
||||||
|
import com.example.demo.common.util.FormatResponseUtil;
|
||||||
|
import com.example.demo.common.util.ResponseResult;
|
||||||
|
import com.example.demo.domain.Dragon;
|
||||||
|
import com.example.demo.service.impl.DragonServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/dragon")
|
||||||
|
public class DragonController {
|
||||||
|
@Autowired
|
||||||
|
DragonServiceImpl dragonService;
|
||||||
|
|
||||||
|
@GetMapping("/dragonList")
|
||||||
|
public ResponseResult queryAll() {
|
||||||
|
return FormatResponseUtil.formatResponse(dragonService.queryAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/addDragon")
|
||||||
|
public ResponseResult addDragon(@RequestBody Dragon dragon) {
|
||||||
|
//System.out.println("1111111111");
|
||||||
|
return FormatResponseUtil.formatResponse(dragonService.save(dragon));
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")//这里执行的是物理删除
|
||||||
|
public ResponseResult delTDragonById(Integer id) {
|
||||||
|
return FormatResponseUtil.formatResponse(dragonService.delDragonById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/one")
|
||||||
|
public ResponseResult queryById(int id) {
|
||||||
|
return FormatResponseUtil.formatResponse(dragonService.queryDragonById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/dragonInfo")
|
||||||
|
public ResponseResult updateArea(@RequestBody Dragon dragon) {
|
||||||
|
return FormatResponseUtil.formatResponse(dragonService.updateById(dragon));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|