diff --git a/docs/spring/cs3d8012a4-e65a-11ee-bf17-acde48001122.java b/docs/spring/cs3d8012a4-e65a-11ee-bf17-acde48001122.java new file mode 100644 index 00000000..d3fae409 --- /dev/null +++ b/docs/spring/cs3d8012a4-e65a-11ee-bf17-acde48001122.java @@ -0,0 +1,45 @@ +/** + * Copyright 2009-2015 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.batch_keys; + +public class User { + private Integer id; + private String name; + + public User() { + } + + public User(Integer id, String name) { + this.id = id; + this.name = name; + } + + 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; + } +} diff --git a/docs/spring/cs3dced326-e65a-11ee-bf17-acde48001122.java b/docs/spring/cs3dced326-e65a-11ee-bf17-acde48001122.java new file mode 100644 index 00000000..95b187a8 --- /dev/null +++ b/docs/spring/cs3dced326-e65a-11ee-bf17-acde48001122.java @@ -0,0 +1,26 @@ +package com.huifer.xz.entity; + +/** + * 描述: + * + * @author: huifer + * @date: 2019-10-16 + */ +public class RabbitMqType { + public static final String CITY_EXCHANGE = "city_id_exchange"; + + /** + * 存放 {@link CityUrlInfo} + */ + public static final String CITY_QUEUE_URL = "city_queue_url"; + /** + * 存放{@link com.huifer.xz.entity.TXz} + */ + public static final String USER_QUEUE_INFO = "user_queue_info"; + + /** + * 行者路线数据 + */ + public static final String XZ_WO = "xz_wo"; + +} diff --git a/docs/spring/cs3e2343b6-e65a-11ee-bf17-acde48001122.java b/docs/spring/cs3e2343b6-e65a-11ee-bf17-acde48001122.java new file mode 100644 index 00000000..415c5fe9 --- /dev/null +++ b/docs/spring/cs3e2343b6-e65a-11ee-bf17-acde48001122.java @@ -0,0 +1,23 @@ +/** + * 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.selectkey; + +public class SqlProvider { + + public String insertTable3_2(Name name) { + return "insert into table3 (id, name) values(#{nameId}, #{name})"; + } +} diff --git a/docs/spring/cs3e79ce8e-e65a-11ee-bf17-acde48001122.java b/docs/spring/cs3e79ce8e-e65a-11ee-bf17-acde48001122.java new file mode 100644 index 00000000..3790f192 --- /dev/null +++ b/docs/spring/cs3e79ce8e-e65a-11ee-bf17-acde48001122.java @@ -0,0 +1,72 @@ +package com.huifer.redis.config; + +import com.huifer.redis.pojo.Student; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@SpringBootTest +@RunWith(SpringJUnit4ClassRunner.class) +public class RedisConfigTest { + + @Autowired + private StringRedisTemplate redis; + @Autowired + private RedisTemplate redisTemplate; + @Autowired + @Qualifier(value = "redis_2") + private RedisTemplate r2; + + @Test + public void a() { + StringBuilder platWaringIds = new StringBuilder(); + for (int i = 0; i < 10; i++) { + platWaringIds.append(i + ","); + } + redis.opsForValue().set("plat:waring:", platWaringIds.toString()); + String s = redis.opsForValue().get("plat:waring:"); + if (s != null && s.contains(String.valueOf(1))) { + System.out.println(s); + } + } + + @Test + public void testSet() { + Student student = new Student(); + student.setAge(10); + student.setName("zhangsan"); + + redisTemplate.opsForValue().set("student-02", student); + + Student s = new Student(); + Object o = redisTemplate.opsForValue().get("student-02"); + BeanUtils.copyProperties(o, s); + Assert.assertTrue(s.equals(student)); + + } + + + @Test + public void testSet2() { + Student student = new Student(); + student.setAge(10); + student.setName("wangwu"); + + r2.opsForValue().set("student-03", student); + + Student s = new Student(); + Object o = r2.opsForValue().get("student-03"); + BeanUtils.copyProperties(o, s); + Assert.assertTrue(s.equals(student)); + + } + + +} diff --git a/docs/spring/cs3ed26c9c-e65a-11ee-bf17-acde48001122.java b/docs/spring/cs3ed26c9c-e65a-11ee-bf17-acde48001122.java new file mode 100644 index 00000000..4693abc8 --- /dev/null +++ b/docs/spring/cs3ed26c9c-e65a-11ee-bf17-acde48001122.java @@ -0,0 +1,15 @@ +package com.github.huifer.full.shiro.service; + +import com.github.huifer.full.shiro.entity.ShiroDept; +import com.github.huifer.full.shiro.model.req.dept.DeptCreateParam; + +public interface DeptService { + + boolean create(DeptCreateParam param); + + boolean update(DeptCreateParam param, int id); + + boolean delete(int id); + + ShiroDept byId(int id); +}