diff --git a/docs/spring/cs125af9bc-7abd-11ee-98f1-acde48001122.java b/docs/spring/cs125af9bc-7abd-11ee-98f1-acde48001122.java new file mode 100644 index 00000000..656e461a --- /dev/null +++ b/docs/spring/cs125af9bc-7abd-11ee-98f1-acde48001122.java @@ -0,0 +1,120 @@ +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; + +/** + * 角色和资源绑定表(ShiroRoleBindResource)表实体类 + * + * @author huifer + * @since 2021-04-18 10:08:21 + */ +@SuppressWarnings("serial") +public class ShiroRoleBindResource extends Model { + + private Integer id; + + private Integer roleId; + + private Integer resourceId; + + 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 Integer getRoleId() { + return roleId; + } + + public void setRoleId(Integer roleId) { + this.roleId = roleId; + } + + public Integer getResourceId() { + return resourceId; + } + + public void setResourceId(Integer resourceId) { + this.resourceId = resourceId; + } + + 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/cs132315a0-7abd-11ee-98f1-acde48001122.java b/docs/spring/cs132315a0-7abd-11ee-98f1-acde48001122.java new file mode 100644 index 00000000..53d4e084 --- /dev/null +++ b/docs/spring/cs132315a0-7abd-11ee-98f1-acde48001122.java @@ -0,0 +1,51 @@ +/** + * Copyright 2009-2019 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.nonexistentvariables; + +import org.apache.ibatis.BaseDataTest; +import org.apache.ibatis.exceptions.PersistenceException; +import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; +import org.apache.ibatis.session.SqlSessionFactoryBuilder; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.io.Reader; + +class NonExistentVariablesTest { + + protected static SqlSessionFactory sqlSessionFactory; + + @BeforeAll + static void setUp() throws Exception { + try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/nonexistentvariables/mybatis-config.xml")) { + sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader); + } + + BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(), + "org/apache/ibatis/submitted/nonexistentvariables/CreateDB.sql"); + } + + @Test + void testWrongParameter() { + try (SqlSession sqlSession = sqlSessionFactory.openSession()) { + Mapper mapper = sqlSession.getMapper(Mapper.class); + Assertions.assertThrows(PersistenceException.class, () -> mapper.count(1, "John")); + } + } +} diff --git a/docs/spring/cs13ed6918-7abd-11ee-98f1-acde48001122.java b/docs/spring/cs13ed6918-7abd-11ee-98f1-acde48001122.java new file mode 100644 index 00000000..37354149 --- /dev/null +++ b/docs/spring/cs13ed6918-7abd-11ee-98f1-acde48001122.java @@ -0,0 +1,9 @@ +package com.huifer.dubbo.client.spi; + +public class Bumblebee implements Robot { + + @Override + public void sayHello() { + System.out.println("Hello, I am Bumblebee."); + } +} diff --git a/docs/spring/cs14b5bfb2-7abd-11ee-98f1-acde48001122.java b/docs/spring/cs14b5bfb2-7abd-11ee-98f1-acde48001122.java new file mode 100644 index 00000000..42d5cf0c --- /dev/null +++ b/docs/spring/cs14b5bfb2-7abd-11ee-98f1-acde48001122.java @@ -0,0 +1,17 @@ +package com.github.huifer.full.shiro.service; + +import com.github.huifer.full.shiro.entity.ShiroPost; +import com.github.huifer.full.shiro.entity.ShiroRole; +import com.github.huifer.full.shiro.model.req.post.PostCreateParam; +import com.github.huifer.full.shiro.model.req.role.RoleCreateParam; + +public interface RoleService { + + boolean create(RoleCreateParam param); + + boolean update(RoleCreateParam param, int id); + + boolean delete(int id); + + ShiroRole byId(int id); +}