Skip to content

Commit

Permalink
write a line into test.file
Browse files Browse the repository at this point in the history
  • Loading branch information
huifer committed Mar 20, 2024
1 parent db1063f commit 1dbc2d7
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docs/spring/cs3d8012a4-e65a-11ee-bf17-acde48001122.java
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;
}
}
26 changes: 26 additions & 0 deletions docs/spring/cs3dced326-e65a-11ee-bf17-acde48001122.java
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";

}
23 changes: 23 additions & 0 deletions docs/spring/cs3e2343b6-e65a-11ee-bf17-acde48001122.java
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})";
}
}
72 changes: 72 additions & 0 deletions docs/spring/cs3e79ce8e-e65a-11ee-bf17-acde48001122.java
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));

}


}
15 changes: 15 additions & 0 deletions docs/spring/cs3ed26c9c-e65a-11ee-bf17-acde48001122.java
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);
}

0 comments on commit 1dbc2d7

Please sign in to comment.