(CRM项目)
复制配置文件
创建包cn.wolfcode.config
cn.wolfcode.controller
cn.wolfcode.service
cn.wolfcode.service.impl
cn.wolfcode.qo
cn.wolfcode.util
在main路径下创建webapp/WEB-INF/web.xml和views包
cn.wolfcode.config里写MyFreemarkerConfig
MyFreemarkerConfig类
public class MyFreemarkerConfig extends FreeMarkerConfigurer {
@Override
public void afterPropertiesSet() throws IOException, TemplateException {
super.afterPropertiesSet();
Configuration configuration = this.getConfiguration();
configuration.setSharedVariable("shiro",new ShiroTags());
}
}
PermissionMapper接口
public interface PermissionMapper {
int deleteByPrimaryKey(Long id);
int insert(Permission record);
Permission selectByPrimaryKey(Long id);
List<Permission> selectAll();
int updateByPrimaryKey(Permission record);
int count();
List<Permission> list(QueryObject qo);
List<String> selectExpressionByCurrentuserId(Long id);
List<String> selectAllExpression();
}
IPermissionService类
public interface IPermissionService {
int deleteByPrimaryKey(Long id);
int insert(Permission record);
Permission selectByPrimaryKey(Long id);
List<Permission> selectAll();
int updateByPrimaryKey(Permission record);
PageInfo<Permission> list(QueryObject qo);
List<String> selectExpressionByCurrentuserId(Long id);
List<String> selectAllExpression();
}
PermissionServiceImpl类
@Service
public class PermissionServiceImpl implements IPermissionService {
@Autowired
private PermissionMapper mapper;
@Override
public int deleteByPrimaryKey(Long id) {
return mapper.deleteByPrimaryKey(id);
}
@Override
public int insert(Permission record) {
return