随笔分类 -  java

摘要:设置NGINX,把真实IP转发过来 location / { proxy_pass http://127.0.0.1:8008/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_head 阅读全文
posted @ 2021-08-02 14:43 浅笑19 阅读(1285) 评论(0) 推荐(0) 编辑
摘要:ExecCommandController: package com.neusoft.shell; //@CrossOrigin //@RestController //@RequestMapping("/linux") public class ExecCommandController { // 阅读全文
posted @ 2021-07-28 13:18 浅笑19 阅读(322) 评论(0) 推荐(0) 编辑
摘要:解压读取: import com.alibaba.fastjson.JSONObject; import java.io.*; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; impor 阅读全文
posted @ 2021-07-28 12:51 浅笑19 阅读(681) 评论(0) 推荐(0) 编辑
摘要:/** * 获取文件扩展名 * @return */ public static String ext(String filename) { int index = filename.lastIndexOf("."); if (index == -1) { return null; } String 阅读全文
posted @ 2021-07-28 12:51 浅笑19 阅读(213) 评论(0) 推荐(0) 编辑
摘要:list.stream().filter(m->m.getName().equals("张三")).findAny().isPresent(); 阅读全文
posted @ 2021-07-20 14:34 浅笑19 阅读(4053) 评论(1) 推荐(0) 编辑
摘要:reload-jar.sh #!/bin/bash cd /data/energy/jar/ echo "change dir success" sleep 2s curl -X POST "http://127.0.0.1:12315/restartactuator/shutdown" print 阅读全文
posted @ 2021-07-19 09:57 浅笑19 阅读(176) 评论(0) 推荐(0) 编辑
摘要:package com.ljq.test.thread; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executo 阅读全文
posted @ 2021-07-15 17:34 浅笑19 阅读(432) 评论(0) 推荐(0) 编辑
摘要:@Select({ "<script>" , "SELECT COUNT(*) FROM category", "<if test='query != null and query != \" \" '>", "where cat_name like '%${query}%'", "</if>", 阅读全文
posted @ 2021-07-01 09:25 浅笑19 阅读(1219) 评论(0) 推荐(0) 编辑
摘要:运行时报错信息如下: *************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to call a method that 阅读全文
posted @ 2021-06-28 08:45 浅笑19 阅读(4413) 评论(0) 推荐(0) 编辑
摘要:在pom文件中引入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> 编写AOP类,在类上使用@Aspec 阅读全文
posted @ 2021-06-11 15:58 浅笑19 阅读(147) 评论(0) 推荐(0) 编辑
摘要:在实体类中添加@TableId注解: @Data public class DxApplication { @TableId(type = IdType.AUTO) private Long id; private String name; private Integer sort; } 在navi 阅读全文
posted @ 2021-06-11 10:12 浅笑19 阅读(512) 评论(0) 推荐(0) 编辑
摘要:@Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket createRestApi() { ParameterBuilder aParameterBuilder = new ParameterBu 阅读全文
posted @ 2021-06-11 10:09 浅笑19 阅读(1818) 评论(0) 推荐(1) 编辑
摘要:分层领域模型规约: DO( Data Object):与数据库表结构一一对应,通过DAO层向上传输数据源对象。 DTO( Data Transfer Object):数据传输对象,Service或Manager向外传输的对象。 BO( Business Object):业务对象。 由Service层 阅读全文
posted @ 2021-06-11 10:08 浅笑19 阅读(206) 评论(0) 推荐(0) 编辑
摘要:代码如下: @Bean public Docket docket(Environment environment) { // 设置要显示的swagger 环境 Profiles p = Profiles.of("dev","test"); // 通过environment.acceptsProfil 阅读全文
posted @ 2021-06-10 10:27 浅笑19 阅读(530) 评论(0) 推荐(0) 编辑
摘要:Maven依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.6.1</version> </dependency> <dependency> < 阅读全文
posted @ 2021-06-10 10:25 浅笑19 阅读(607) 评论(0) 推荐(0) 编辑
摘要:详情请移步:https://www.jianshu.com/p/7b7e757cc753 阅读全文
posted @ 2021-06-10 10:21 浅笑19 阅读(152) 评论(0) 推荐(0) 编辑
摘要:IService使用 service层需要继承IService,当然实现层也要继承对应的实现类。 /** * <p> * 用户 服务类 * </p> * * @author IT贱男 * @since 2019-06-14 */ public interface UserService extend 阅读全文
posted @ 2021-06-10 10:19 浅笑19 阅读(3652) 评论(0) 推荐(0) 编辑
摘要:手动快捷键 Ctrl + Alt + O 配置自动清理 Ctrl + Alt + S 打开设置 然后,进行如下配置操作: 批量删除指定目录下无用的import包 使用idea一次性清理所有java文件中多余导入未使用的包,首先ctrl+alt+s打开设置界面,红框中的位置打勾,如图: 点击ok后关闭 阅读全文
posted @ 2021-05-31 09:54 浅笑19 阅读(7853) 评论(0) 推荐(1) 编辑
摘要:<dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.5.0</version> <scope>test</scope> </dependency 阅读全文
posted @ 2021-05-28 11:12 浅笑19 阅读(1561) 评论(0) 推荐(0) 编辑
摘要:public static String getSha1(String str){ if(str==null||str.length()==0){ return null; } char hexDigits[] = {'0','1','2','3','4','5','6','7','8','9', 阅读全文
posted @ 2021-05-12 17:02 浅笑19 阅读(196) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示