-
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
4 changed files
with
197 additions
and
0 deletions.
There are no files selected for viewing
120 changes: 120 additions & 0 deletions
120
docs/spring/cs125af9bc-7abd-11ee-98f1-acde48001122.java
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,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<ShiroRoleBindResource> { | ||
|
||
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; | ||
} | ||
} |
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,51 @@ | ||
/** | ||
* Copyright 2009-2019 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.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")); | ||
} | ||
} | ||
} |
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,9 @@ | ||
package com.huifer.dubbo.client.spi; | ||
|
||
public class Bumblebee implements Robot { | ||
|
||
@Override | ||
public void sayHello() { | ||
System.out.println("Hello, I am Bumblebee."); | ||
} | ||
} |
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,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); | ||
} |