-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright 2009-2015 the original author or authors. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright 2009-2018 the original author or authors. | ||
* <p> | ||
* 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 | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* 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})"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<String, Object> redisTemplate; | ||
@Autowired | ||
@Qualifier(value = "redis_2") | ||
private RedisTemplate<String, Object> 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)); | ||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |