代孕包成功多少钱?【正规代孕】【微*电138*0226*9370】代孕,是指将受精卵子植入代孕妈妈子宫,由孕母替他人完成“十月怀胎一朝分娩”的过程。妇女代孕时需植入他人的受精卵子,精子与卵子在人体外的结合,必须实施“人类辅助生殖技术”。我国有关法律对“人类辅助生殖技术”的实施做了严格的规定。
代孕是一种新的观念,新的趋势。在现今社会里人类文明高度发达,依然有不少不孕不育的夫妇。随着人工生殖科技的迅速发展,七十年代以来,欧美各国陆续开始有人委托代理孕母怀孕生子,代孕是一种解决不孕不育的临床选择。
在spring boot中使用Jedis
1.新建一个SpringBoot项目,选择WEB选项。
2.pom文件增加依赖。
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-redis</artifactId> <version>1.4.7.RELEASE</version> </dependency>
3.redis配置,这里密码为空,所以password没有赋值
# Redis数据库索引(默认为0) spring.redis.database=0 # Redis服务器地址 spring.redis.host=127.0.0.1 # Redis服务器连接端口 spring.redis.port=6379 # Redis服务器连接密码(默认为空) spring.redis.password= # 连接池最大连接数(使用负值表示没有限制) spring.redis.jedis.pool.max-active=8 # 连接池最大阻塞等待时间(使用负值表示没有限制) spring.redis.jedis.pool.max-wait=-1 # 连接池中的最大空闲连接 spring.redis.jedis.pool.max-idle=8 # 连接池中的最小空闲连接 spring.redis.jedis.pool.min-idle=0 # 连接超时时间(毫秒) spring.redis.timeout=0
4.编写缓存配置类
@Configuration @EnableCaching public class RedisCacheConfiguration extends CachingConfigurerSupport { Logger logger = LoggerFactory.getLogger(RedisCacheConfiguration.class); @Value("${spring.redis.host}") private String host; @Value("${spring.redis.port}") private int port; @Value("${spring.redis.timeout}") private int timeout; @Value("${spring.redis.jedis.pool.max-idle}") private int maxIdle; @Value("${spring.redis.jedis.pool.max-wait}") private long maxWaitMillis; @Value("${spring.redis.password}") private String password; @Bean(name = "jedisPool") public JedisPool redisPoolFactory() { logger.info("JedisPool注入成功!!"); logger.info("redis地址:" + host + ":" + port); JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxIdle(maxIdle); jedisPoolConfig.setMaxWaitMillis(maxWaitMillis); JedisPool jedisPool = null; if(password == null || password.equals("")){ jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout); }else{ jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout,password); } return jedisPool; } }
上面的判断用来支持密码为空和不微空的两种情况
5.编写缓存工具类
@Service @Lazy(false) public class SpringContextHolder implements ApplicationContextAware, DisposableBean { private static ApplicationContext applicationContext = null; private static Logger logger = LoggerFactory.getLogger(SpringContextHolder.class); /** * 取得存储在静态变量中的ApplicationContext. */ public static ApplicationContext getApplicationContext() { assertContextInjected(); return applicationContext; } /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. */ @SuppressWarnings("unchecked") public static <T> T getBean(String name) { assertContextInjected(); return (T) applicationContext.getBean(name); } /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. */ public static <T> T getBean(Class<T> requiredType) { assertContextInjected(); return applicationContext.getBean(requiredType); } /** * 清除SpringContextHolder中的ApplicationContext为Null. */ public static void clearHolder() { if (logger.isDebugEnabled()){ logger.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext); } applicationContext = null; } /** * 实现DisposableBean接口, 在Context关闭时清理静态变量. */ @Override public void destroy() throws Exception { SpringContextHolder.clearHolder(); } /** * 检查ApplicationContext不为空. */ private static void assertContextInjected() { //Validate.validState(applicationContext != null, "applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder."); } /* (non-Javadoc) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) */ @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { SpringContextHolder.applicationContext = applicationContext; } }
public class JedisUtils { private static JedisPool jedisPool = SpringContextHolder.getBean("jedisPool"); public static void set(String key, String value) { Jedis jedis = jedisPool.getResource(); jedis.set(key, value); } public static String get(String key) { Jedis jedis = jedisPool.getResource(); return jedis.get(key); } }
6.测试
@RestController public class TestController { @GetMapping("/testPutJedis") public String testPutJedis() { JedisUtils.set("test", "Redis"); return "hi, I'm Jedis,OK !"; } @GetMapping("/testGetJedis") public String testGetJedis() { JedisUtils.get("test"); return JedisUtils.get("test"); } }
可以发现输入127.0.0.1:8080/testPutJedis后,缓存被放入,输入127.0.0.1:8080/testGetJedis后,缓存数据被查出来
1.新建一个SpringBoot项目,选择WEB选项。
2.pom文件增加依赖。
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-redis</artifactId> <version>1.4.7.RELEASE</version> </dependency>
3.redis配置,这里密码为空,所以password没有赋值
# Redis数据库索引(默认为0) spring.redis.database=0 # Redis服务器地址 spring.redis.host=127.0.0.1 # Redis服务器连接端口 spring.redis.port=6379 # Redis服务器连接密码(默认为空) spring.redis.password= # 连接池最大连接数(使用负值表示没有限制) spring.redis.jedis.pool.max-active=8 # 连接池最大阻塞等待时间(使用负值表示没有限制) spring.redis.jedis.pool.max-wait=-1 # 连接池中的最大空闲连接 spring.redis.jedis.pool.max-idle=8 # 连接池中的最小空闲连接 spring.redis.jedis.pool.min-idle=0 # 连接超时时间(毫秒) spring.redis.timeout=0
4.编写缓存配置类
@Configuration @EnableCaching public class RedisCacheConfiguration extends CachingConfigurerSupport { Logger logger = LoggerFactory.getLogger(RedisCacheConfiguration.class); @Value("${spring.redis.host}") private String host; @Value("${spring.redis.port}") private int port; @Value("${spring.redis.timeout}") private int timeout; @Value("${spring.redis.jedis.pool.max-idle}") private int maxIdle; @Value("${spring.redis.jedis.pool.max-wait}") private long maxWaitMillis; @Value("${spring.redis.password}") private String password; @Bean(name = "jedisPool") public JedisPool redisPoolFactory() { logger.info("JedisPool注入成功!!"); logger.info("redis地址:" + host + ":" + port); JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxIdle(maxIdle); jedisPoolConfig.setMaxWaitMillis(maxWaitMillis); JedisPool jedisPool = null; if(password == null || password.equals("")){ jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout); }else{ jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout,password); } return jedisPool; } }
上面的判断用来支持密码为空和不微空的两种情况
5.编写缓存工具类
@Service @Lazy(false) public class SpringContextHolder implements ApplicationContextAware, DisposableBean { private static ApplicationContext applicationContext = null; private static Logger logger = LoggerFactory.getLogger(SpringContextHolder.class); /** * 取得存储在静态变量中的ApplicationContext. */ public static ApplicationContext getApplicationContext() { assertContextInjected(); return applicationContext; } /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. */ @SuppressWarnings("unchecked") public static <T> T getBean(String name) { assertContextInjected(); return (T) applicationContext.getBean(name); } /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. */ public static <T> T getBean(Class<T> requiredType) { assertContextInjected(); return applicationContext.getBean(requiredType); } /** * 清除SpringContextHolder中的ApplicationContext为Null. */ public static void clearHolder() { if (logger.isDebugEnabled()){ logger.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext); } applicationContext = null; } /** * 实现DisposableBean接口, 在Context关闭时清理静态变量. */ @Override public void destroy() throws Exception { SpringContextHolder.clearHolder(); } /** * 检查ApplicationContext不为空. */ private static void assertContextInjected() { //Validate.validState(applicationContext != null, "applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder."); } /* (non-Javadoc) * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) */ @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { SpringContextHolder.applicationContext = applicationContext; } }
public class JedisUtils { private static JedisPool jedisPool = SpringContextHolder.getBean("jedisPool"); public static void set(String key, String value) { Jedis jedis = jedisPool.getResource(); jedis.set(key, value); } public static String get(String key) { Jedis jedis = jedisPool.getResource(); return jedis.get(key); } }
6.测试
@RestController public class TestController { @GetMapping("/testPutJedis") public String testPutJedis() { JedisUtils.set("test", "Redis"); return "hi, I'm Jedis,OK !"; } @GetMapping("/testGetJedis") public String testGetJedis() { JedisUtils.get("test"); return JedisUtils.get("test"); } }
可以发现输入127.0.0.1:8080/testPutJedis后,缓存被放入,输入127.0.0.1:8080/testGetJedis后,缓存数据被查出来