From 935736753feab4004fe46ca1f4fe7fe8d3026f49 Mon Sep 17 00:00:00 2001 From: Zen Huifer Date: Fri, 27 Sep 2024 09:36:07 +0800 Subject: [PATCH] write a line into test.file --- ...sdbd39500-7c70-11ef-bd43-acde48001122.java | 46 +++++++ ...sdc0dbe10-7c70-11ef-bd43-acde48001122.java | 33 +++++ ...sdc5329a0-7c70-11ef-bd43-acde48001122.java | 32 +++++ ...sdc81cd8c-7c70-11ef-bd43-acde48001122.java | 53 ++++++++ ...sdcb70150-7c70-11ef-bd43-acde48001122.java | 119 ++++++++++++++++++ ...sdcf8fa7e-7c70-11ef-bd43-acde48001122.java | 21 ++++ ...sdd32e9d2-7c70-11ef-bd43-acde48001122.java | 28 +++++ ...sdd68d308-7c70-11ef-bd43-acde48001122.java | 22 ++++ ...sddcc71f6-7c70-11ef-bd43-acde48001122.java | 65 ++++++++++ 9 files changed, 419 insertions(+) create mode 100644 docs/spring/csdbd39500-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csdc0dbe10-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csdc5329a0-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csdc81cd8c-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csdcb70150-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csdcf8fa7e-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csdd32e9d2-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csdd68d308-7c70-11ef-bd43-acde48001122.java create mode 100644 docs/spring/csddcc71f6-7c70-11ef-bd43-acde48001122.java diff --git a/docs/spring/csdbd39500-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdbd39500-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..d184aa8b --- /dev/null +++ b/docs/spring/csdbd39500-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,46 @@ +/** + * Copyright 2009-2018 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ibatis.submitted.map_class_name_conflict; + +public class Person { + private Long id; + private String firstName; + private String lastName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/docs/spring/csdc0dbe10-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdc0dbe10-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..ac85f650 --- /dev/null +++ b/docs/spring/csdc0dbe10-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,33 @@ +/** + * Copyright 2009-2018 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.ibatis.domain.misc; + +import org.apache.ibatis.domain.blog.Author; +import org.apache.ibatis.reflection.MetaObject; +import org.apache.ibatis.reflection.wrapper.ObjectWrapper; +import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory; + +public class CustomBeanWrapperFactory implements ObjectWrapperFactory { + @Override + public boolean hasWrapperFor(Object object) { + return object instanceof Author; + } + + @Override + public ObjectWrapper getWrapperFor(MetaObject metaObject, Object object) { + return new CustomBeanWrapper(metaObject, object); + } +} diff --git a/docs/spring/csdc5329a0-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdc5329a0-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..e40d8b21 --- /dev/null +++ b/docs/spring/csdc5329a0-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,32 @@ +package com.huifer.hystrix.controller; + +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import java.io.IOException; +import java.io.Writer; +import java.util.concurrent.TimeoutException; + +/** + *

Title : TimeoutController

+ *

Description :

+ * + * @author huifer + * @date 2019-05-30 + */ +@RestControllerAdvice(assignableTypes = {MyHystrixController.class}) +public class TimeoutController { + + + @ExceptionHandler + public void onTimeoutException(TimeoutException timeoutException, Writer writer) + throws IOException { + writer.write(s("")); + + } + + private String s(String mse) { + return "error " + mse; + } + +} diff --git a/docs/spring/csdc81cd8c-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdc81cd8c-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..15fb3692 --- /dev/null +++ b/docs/spring/csdc81cd8c-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,53 @@ +package com.huifer.feign.annotation; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.client.ClientHttpRequestInterceptor; +import org.springframework.web.client.RestTemplate; + +import java.util.Arrays; +import java.util.Collection; + +/** + *

Title : RibbonRestController

+ *

Description :

+ * + * @author huifer + * @date 2019-05-30 + */ +@Configuration +public class RibbonConfig { + + + @Autowired + @Qualifier(value = "ribbon") + private RestTemplate restTemplate3; + + + @Bean + @Autowired + @Qualifier(value = "ribbon") // 固定搜索范围 + public RestTemplate restTemplate3() { + return new RestTemplate(); + } + + + /** + * 所有的restTemplate 都增加 + */ + @Bean + @Autowired + public Object f(@Qualifier(value = "ribbon") Collection restTemplates, + ClientHttpRequestInterceptor interceptor) { + restTemplates.forEach( + restTemplate -> { + restTemplate.setInterceptors(Arrays.asList(interceptor)); + } + ); + return new Object(); + } + + +} diff --git a/docs/spring/csdcb70150-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdcb70150-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..f849f6be --- /dev/null +++ b/docs/spring/csdcb70150-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,119 @@ +package com.github.huifer.full.shiro.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.Version; +import java.util.Date; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import java.io.Serializable; + +/** + * 企业表(ShiroCompany)表实体类 + * + * @author huifer + * @since 2021-04-18 10:08:17 + */ +@SuppressWarnings("serial") +public class ShiroCompany extends Model { + + private Integer id; + //企业名称 + private String name; + //企业地址 + private String address; + + private Date createTime; + + private Integer createUser; + + private Integer updateUser; + + private Date updateTime; + + @Version + private Integer version; + @TableField + private Integer deleted; + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Integer getCreateUser() { + return createUser; + } + + public void setCreateUser(Integer createUser) { + this.createUser = createUser; + } + + public Integer getUpdateUser() { + return updateUser; + } + + public void setUpdateUser(Integer updateUser) { + this.updateUser = updateUser; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Integer getVersion() { + return version; + } + + public void setVersion(Integer version) { + this.version = version; + } + + public Integer getDeleted() { + return deleted; + } + + public void setDeleted(Integer deleted) { + this.deleted = deleted; + } + + /** + * 获取主键值 + * + * @return 主键值 + */ + @Override + protected Serializable pkVal() { + return this.id; + } +} diff --git a/docs/spring/csdcf8fa7e-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdcf8fa7e-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..700c7a37 --- /dev/null +++ b/docs/spring/csdcf8fa7e-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,21 @@ +package com.huifer.design.factory.method; + +import com.huifer.design.factory.MengNiu; +import com.huifer.design.factory.Milk; + +/** + *

Title : MengNiuFactory

+ *

Description : 蒙牛的生产工厂 ,该工厂只生产蒙牛

+ * + * @author huifer + * @date 2019-05-15 + */ +public class MengNiuFactory implements MethodFactory { + + @Override + public Milk createMilk() { + System.out.println("蒙牛材料清单 : 牛奶 100 克"); + return new MengNiu(); + } + +} diff --git a/docs/spring/csdd32e9d2-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdd32e9d2-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..41a490f6 --- /dev/null +++ b/docs/spring/csdd32e9d2-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,28 @@ +package com.huifer.idgen.my.service.exmple; + +import com.huifer.idgen.my.service.GenIdService; +import com.huifer.idgen.my.service.bean.Id; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + * @author: wang + * @description: + */ +@Slf4j +public class SpringIdGenRun { + + public static void main(String[] args) { + ApplicationContext context = new ClassPathXmlApplicationContext("spring-factory-beans.xml"); + GenIdService idServiceFactory = + (GenIdService) context.getBean("idServiceFactory"); + for (int i = 0; i < 10; i++) { + + long l = idServiceFactory.genId(); + Id id = idServiceFactory.expId(l); + log.info("{}", id); + } + } + +} \ No newline at end of file diff --git a/docs/spring/csdd68d308-7c70-11ef-bd43-acde48001122.java b/docs/spring/csdd68d308-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..fb5a672f --- /dev/null +++ b/docs/spring/csdd68d308-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,22 @@ +package com.huifer.mybatis.pojo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 描述: + * 职员 + * + * @author huifer + * @date 2019-02-24 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Employee { + private Integer empNo; + private String ename; + private String job; + private Double sal; +} diff --git a/docs/spring/csddcc71f6-7c70-11ef-bd43-acde48001122.java b/docs/spring/csddcc71f6-7c70-11ef-bd43-acde48001122.java new file mode 100644 index 00000000..12b78a53 --- /dev/null +++ b/docs/spring/csddcc71f6-7c70-11ef-bd43-acde48001122.java @@ -0,0 +1,65 @@ +//package com.huifer.feign.controller; +// +//import java.util.Arrays; +//import java.util.Collection; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.beans.factory.annotation.Qualifier; +//import org.springframework.context.annotation.Bean; +//import org.springframework.http.client.ClientHttpRequestInterceptor; +//import org.springframework.web.bind.annotation.GetMapping; +//import org.springframework.web.bind.annotation.PathVariable; +//import org.springframework.web.bind.annotation.RequestParam; +//import org.springframework.web.bind.annotation.RestController; +//import org.springframework.web.client.RestTemplate; +// +///** +// *

Title : RibbonRestController

+// *

Description :

+// * +// * @author huifer +// * @date 2019-05-30 +// */ +//@RestController +//public class OldRestController { +// +// +// @Autowired +// @Qualifier(value = "ribbon") +// private RestTemplate restTemplate3; +// +// +// @Bean +// @Autowired +// @Qualifier(value = "ribbon") // 固定搜索范围 +// public RestTemplate restTemplate3() { +// return new RestTemplate(); +// } +// +// @GetMapping("/lb/{service}/say") +// public String lbSay(@PathVariable String service, +// @RequestParam String message) { +// return restTemplate3 +// .getForObject("http://" + service + "/say?message=" + message, String.class); +// } +// +// +// /** +// * 所有的restTemplate 都增加 +// * @param restTemplates +// * @param interceptor +// * @return +// */ +// @Bean +// @Autowired +// public Object f(@Qualifier(value = "ribbon") Collection restTemplates, +// ClientHttpRequestInterceptor interceptor) { +// restTemplates.forEach( +// restTemplate -> { +// restTemplate.setInterceptors(Arrays.asList(interceptor)); +// } +// ); +// return new Object(); +// } +// +// +//}