ITeye博客

e_e的博客

e_e · 共 93 篇文章

配置mysql日志打印

# 配置sql打印日志 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl logging: level: root: info com.***.telemarket.mapper: trace 引入jar包并配置resources下的logback-spring.xml文件如下 <?xml version="1.0" encoding="UTF-8"?> <configuration> <!--获取podIp--> <conversionRule conversionWord=…

2023-07-12 16:49 · java · springboot · 评论(0)

excel 求A列与B列的交集、差集

求A列和B列的交集 =IF(ISNUMBER(MATCH(A5,$B$1:$B$2000,0)),A5,"") 求A列和B列的差集 =IF(ISERROR(MATCH(A1,$B$1:$B$200,0)),A1,"")

2023-07-11 13:45 · excell · 评论(0)

service 接口测试用例

@SpringBootTest(classes = TelemarketCoreApplication.class) @RunWith(SpringRunner.class) @ActiveProfiles("test") public class CouponsInfoServiceTest { @MockBean RestTemplate restTemplate; @Autowired private CouponsInfoService couponsInfoService; @Before public void setUp() { MockitoAnnotations.initM…

2022-06-24 16:35 · java · 评论(0)

读excel文件生成sql

import java.io.*; import java.util.ArrayList; import java.util.List; public class StringToolSqlFormatter { private static final String SQL_1 = "update t_call_data set DECISION_COMPLETE_TYPE='BATCH_DECISION_COMPILTE' where REGISTER_ID=%s and DATE_FORMAT(IMPORT_TIME,'%Y-%m-%e')=" + "DATE_FORMAT(IMPOR…

2022-02-11 11:45 · java · 评论(0)

spring cloud 配置中心

@EnableConfigServer @EnableDiscoveryClient @SpringBootApplication public class ConfigCenterApplication { public static void main(String[] args) { SpringApplication.run(ConfigCenterApplication.class, args); } } pom.xml <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-clou…

2021-02-03 17:43 · spring · 评论(0)

rabbitmq 使用

API模块接收请求,推送到消息队列 router模块消费消息,分发到各个模块 每个模块消费消息,在推回API模块,因为api模块需要知道最终执行结果 API模块配置: spring: cloud: stream: bindings: outbound-agent-state-list.destination: outbound.agent-state-list #生产 agent-state-list-reply-channel: #消费回调回来的消息 destination: outbound.agent-state-list-reply group: ${nodeNo:0} durabl…

2020-05-07 19:07 · java · 评论(0)

gitlab readme 测试覆盖率添加

第一步:添加一个子模块:contract-coverage,然后在这个空的模块里只要发一个pom.xml即可,内容如下: <?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 http://maven.apache.org/xsd/maven-4.0.0.…

2019-04-15 14:39 · git · springboot · coverage · 评论(0)

mysql idea 连接被否决[28000][1045] Access denied for user 'root'@'172.17.0.1' (using

idea连接docker里的mysql镜像时报错: [28000][1045] Access denied for user 'root'@'172.17.0.1' (using password: YES) 解决: 命令:docker exec -it mysql /bin/bash 进入mysql:mysql -uroot -proot 开启远程访问: ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';

2019-04-01 20:10 · 评论(0)

重写rest delete

第一种: @Transactional @Modifying @Query(value = "UPDATE UserPO SET voided = 1 where id = ?1") @Override void deleteById(@NotNull Long userId); 第二种:(更底层) @Entity @Table(name="TABLE") @ActionOverride(action="delete", with="activeFlag = false") public class Table { @Column(name="ACTIVE_FLAG") boolean ac…

2019-03-04 11:32 · mysql,jpa,hibernate · 评论(0)

word 宏 更新域 VBA语法

打开一个word文档 第一步:定义宏 视图 中找到宏 输入宏名称setValue ,回车后编辑宏的内容如下 Sub setValue() ' ' setValue 宏 ' Dim doc_var As Variable For Each doc_var In ActiveDocument.Variables doc_var.Delete Next ActiveDocument.Variables("name").value = "zhangyan" ActiveDocument.Variables("address").value = "shanghai" ActiveDocument.Va…

2019-02-01 17:50 · office · 评论(0)

CommandLineRunner 的使用

@SpringBootApplication @EnableJpaAuditing public class ContractElementApplication extends MyApplication implements CommandLineRunner { public static void main(String[] args) { run(ContractElementApplication.class, args); } @Autowired private ElementDatasourceConfig elementDatasourceConfig; @Overrid…

2019-01-28 10:19 · springboot · 评论(0)

springboot map<String,MyObject> config application.yml

参考官网:https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html 章节: 24.8.3 Merging Complex Types application.yml element-datasource: config: service1: url: method: content-type: service2: url: method: content-type: @Component @Configuration @ConfigurationPrope…

2019-01-25 23:34 · springboot · 评论(0)

JPA操作多对多中间表CRUD

authority 角色 permission 权限 authority_permission 中间表 现在要对中间表进行操作,但是中间表的两个字段分别是两个主表的外键,而不是主键,所以要给这张中间表创建一个联合主键,然后就可以对中间表进行操作了, 详见 AuthorityPermission.java AuthorityPermissionId.java @Entity @Table(name = "authority", schema = "msa") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Data …

2019-01-14 15:41 · mysql,jpa,hibernate · 评论(0)

mysql JPA @Table 大写表名不识别问题解决

自定义表或者字段识别机制的前提条件是:springboot本身提供的策略解决不了我们的问题。 //在配置文件中加入这个,暂时还不可以识别大写表,但是列名映射createTime-->create_time spring.jpa.hibernate.naming.physical-strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy //如果配置为这个,可以识别表,但是不能将createTime-->create_time spring.jpa.hibernate.naming.phys…

2018-11-21 19:39 · springboot · 评论(0)

axios 跨域问题解决

1.main.js 引入axios import axios from 'axios'; Vue.prototype.$http = axios; 2. 发起post请求 methods: submitForm:function(){ this.$http.get("/user/find?id=1").then(r=> console.log(r.data)); this.$http.defaults.headers.post['Content-Type']='application/json;charse=UTF-8'; this.$http.post(this.url, JSON.str…

2018-10-18 09:27 · vue · axios · 评论(0)