mirror of https://gitee.com/stylefeng/guns
【7.0.4】增强beetl和纯restful项目之前的切换
parent
4e3f467d64
commit
baa343ad26
9
pom.xml
9
pom.xml
|
@ -97,7 +97,7 @@
|
|||
<!--系统管理基础业务-->
|
||||
<dependency>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>system-spring-boot-starter</artifactId>
|
||||
<artifactId>system-integration-beetl</artifactId>
|
||||
<version>${roses.kernel.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
@ -171,13 +171,6 @@
|
|||
<version>${mysql-connector-java.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- beet模板引擎 -->
|
||||
<dependency>
|
||||
<groupId>com.ibeetl</groupId>
|
||||
<artifactId>beetl</artifactId>
|
||||
<version>${beetl.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
package cn.stylefeng.guns.config.web;
|
||||
|
||||
import cn.stylefeng.guns.core.beetl.CustomBeetlGroupUtilConfiguration;
|
||||
import cn.stylefeng.guns.core.beetl.expander.BeetlConfigExpander;
|
||||
import cn.stylefeng.roses.kernel.auth.api.LoginUserApi;
|
||||
import org.beetl.core.resource.ClasspathResourceLoader;
|
||||
import org.beetl.ext.spring.BeetlSpringViewResolver;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Beetl模板引擎的配置
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:34
|
||||
*/
|
||||
@Configuration
|
||||
public class BeetlConfiguration {
|
||||
|
||||
@Value("${spring.mvc.view.prefix}")
|
||||
private String prefix;
|
||||
|
||||
/**
|
||||
* Beetl的自定义配置
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:34
|
||||
*/
|
||||
@Bean(initMethod = "init")
|
||||
public CustomBeetlGroupUtilConfiguration customBeetlGroupUtilConfiguration(LoginUserApi loginUserApi) {
|
||||
CustomBeetlGroupUtilConfiguration customBeetlGroupUtilConfiguration = new CustomBeetlGroupUtilConfiguration(loginUserApi);
|
||||
|
||||
// 设置beetl的资源加载器
|
||||
customBeetlGroupUtilConfiguration.setResourceLoader(new ClasspathResourceLoader(BeetlConfiguration.class.getClassLoader(), prefix));
|
||||
|
||||
// 设置beetl的配置
|
||||
customBeetlGroupUtilConfiguration.setConfigProperties(createBeetlProperties());
|
||||
|
||||
return customBeetlGroupUtilConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* beetl的视图解析器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:34
|
||||
*/
|
||||
@Bean
|
||||
public BeetlSpringViewResolver beetlViewResolver(CustomBeetlGroupUtilConfiguration customBeetlGroupUtilConfiguration) {
|
||||
BeetlSpringViewResolver beetlSpringViewResolver = new BeetlSpringViewResolver();
|
||||
beetlSpringViewResolver.setConfig(customBeetlGroupUtilConfiguration);
|
||||
beetlSpringViewResolver.setContentType("text/html;charset=UTF-8");
|
||||
beetlSpringViewResolver.setOrder(0);
|
||||
return beetlSpringViewResolver;
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装beetl初始化需要的properties
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:33
|
||||
*/
|
||||
private Properties createBeetlProperties() {
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("DELIMITER_STATEMENT_START", BeetlConfigExpander.getDelimiterStatementStart());
|
||||
properties.setProperty("DELIMITER_STATEMENT_END", BeetlConfigExpander.getDelimiterStatementEnd());
|
||||
properties.setProperty("HTML_TAG_FLAG", BeetlConfigExpander.getHtmlTagFlag());
|
||||
properties.setProperty("RESOURCE.tagRoot", BeetlConfigExpander.getResourceTagRoot());
|
||||
properties.setProperty("RESOURCE.tagSuffix", BeetlConfigExpander.getResourceTagSuffix());
|
||||
properties.setProperty("RESOURCE.autoCheck", BeetlConfigExpander.getResourceAutoCheck());
|
||||
return properties;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,6 @@
|
|||
package cn.stylefeng.guns.config.web;
|
||||
|
||||
import cn.stylefeng.guns.core.beetl.CustomBeetlGroupUtilConfiguration;
|
||||
import cn.stylefeng.guns.core.error.CustomErrorAttributes;
|
||||
import cn.stylefeng.guns.core.error.CustomErrorView;
|
||||
import cn.stylefeng.guns.core.security.AuthJwtTokenSecurityInterceptor;
|
||||
import cn.stylefeng.guns.core.security.PermissionSecurityInterceptor;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -46,20 +42,6 @@ public class SpringMvcConfiguration implements WebMvcConfigurer {
|
|||
return new CustomErrorAttributes();
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认错误页面,返回json
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/16 15:47
|
||||
*/
|
||||
@Bean("error")
|
||||
public CustomErrorView error(CustomBeetlGroupUtilConfiguration customBeetlGroupUtilConfiguration) {
|
||||
CustomErrorView customErrorView = new CustomErrorView();
|
||||
customErrorView.setUrl("/404.html");
|
||||
customErrorView.setGroupTemplate(customBeetlGroupUtilConfiguration.getGroupTemplate());
|
||||
return customErrorView;
|
||||
}
|
||||
|
||||
/**
|
||||
* json自定义序列化工具,long转string
|
||||
*
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.guns.core.beetl.tag.SysDictCheckBoxTag;
|
||||
import cn.stylefeng.guns.core.beetl.tag.SysDictRadioTag;
|
||||
import cn.stylefeng.guns.core.beetl.tag.SysDictSelectTag;
|
||||
import cn.stylefeng.roses.kernel.auth.api.LoginUserApi;
|
||||
import cn.stylefeng.roses.kernel.i18n.util.QuickTranslateUtil;
|
||||
import cn.stylefeng.roses.kernel.system.api.expander.SystemConfigExpander;
|
||||
import org.beetl.ext.spring.BeetlGroupUtilConfiguration;
|
||||
|
||||
/**
|
||||
* beetl拓展配置,绑定一些工具类,方便在模板中直接调用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 11:18
|
||||
*/
|
||||
public class CustomBeetlGroupUtilConfiguration extends BeetlGroupUtilConfiguration {
|
||||
|
||||
private final LoginUserApi loginUserApi;
|
||||
|
||||
public CustomBeetlGroupUtilConfiguration(LoginUserApi loginUserApi) {
|
||||
this.loginUserApi = loginUserApi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initOther() {
|
||||
|
||||
// 获取当前用户的接口
|
||||
groupTemplate.registerFunctionPackage("loginUser", loginUserApi);
|
||||
|
||||
// 对象工具类
|
||||
groupTemplate.registerFunctionPackage("objectUtil", ObjectUtil.class);
|
||||
|
||||
// 获取基本信息的工具
|
||||
groupTemplate.registerFunctionPackage("constants", SystemConfigExpander.class);
|
||||
|
||||
// 多语言
|
||||
groupTemplate.registerFunctionPackage("translate", QuickTranslateUtil.class);
|
||||
|
||||
// 下拉选字典
|
||||
groupTemplate.registerTag("dict_select", SysDictSelectTag.class);
|
||||
|
||||
// 单选字典
|
||||
groupTemplate.registerTag("dict_radio", SysDictRadioTag.class);
|
||||
|
||||
// 多选字典
|
||||
groupTemplate.registerTag("dict_checkbox", SysDictCheckBoxTag.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.consts;
|
||||
|
||||
/**
|
||||
* beetl模板引擎的常量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:20
|
||||
*/
|
||||
public interface BeetlConstants {
|
||||
|
||||
/**
|
||||
* 默认边界符开始
|
||||
* <p>
|
||||
* beetl默认的是 '<%'
|
||||
*/
|
||||
String DEFAULT_DELIMITER_STATEMENT_START = "@";
|
||||
|
||||
/**
|
||||
* 默认beetl边界符的结束
|
||||
* <p>
|
||||
* beetl默认的是 '%>'
|
||||
*/
|
||||
String DEFAULT_DELIMITER_STATEMENT_END = "null";
|
||||
|
||||
/**
|
||||
* 自定义标签文件Root目录
|
||||
*/
|
||||
String DEFAULT_RESOURCE_TAG_ROOT = "common/tags";
|
||||
|
||||
/**
|
||||
* 自定义标签文件后缀
|
||||
*/
|
||||
String DEFAULT_RESOURCE_TAG_SUFFIX = "tag";
|
||||
|
||||
/**
|
||||
* 是否检测文件变化,开发用true合适,但线上要改为false
|
||||
*/
|
||||
String DEFAULT_RESOURCE_AUTO_CHECK = "false";
|
||||
|
||||
/**
|
||||
* 默认beetl 支持HTML标签
|
||||
* <p>
|
||||
* beetl默认的是 '#'
|
||||
*/
|
||||
String DEFAULT_HTML_TAG_FLAG = "tag:";
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.consts;
|
||||
|
||||
/**
|
||||
* 字典html属性常量
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 21:06
|
||||
*/
|
||||
|
||||
public interface DictTagConstants {
|
||||
|
||||
/**
|
||||
* html组件 id
|
||||
*/
|
||||
String ID = "id";
|
||||
|
||||
/**
|
||||
* html组件 name
|
||||
*/
|
||||
String NAME = "name";
|
||||
|
||||
/**
|
||||
* html组件 type
|
||||
*/
|
||||
String TYPE = "type";
|
||||
|
||||
/**
|
||||
* 字典类型编码
|
||||
*/
|
||||
String DICT_TYPE_CODE = "dictTypeCode";
|
||||
|
||||
/**
|
||||
* layui元素的风格
|
||||
*/
|
||||
String LAY_SKIN = "laySkin";
|
||||
|
||||
/**
|
||||
* layui事件过滤器
|
||||
*/
|
||||
String LAY_FILTER = "layFilter";
|
||||
|
||||
/**
|
||||
* layui校验
|
||||
*/
|
||||
String LAY_VERIFY = "layVerify";
|
||||
|
||||
/**
|
||||
* select控件提示name
|
||||
*/
|
||||
String HEAD_NAME = "headName";
|
||||
|
||||
/**
|
||||
* select控件提示value
|
||||
*/
|
||||
String HEAD_VALUE = "headValue";
|
||||
|
||||
/**
|
||||
* select控件提示类型::1-全部,2-请选择
|
||||
*/
|
||||
String HEAD_TYPE = "headType";
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
String DEFAULT_VALUE = "defaultValue";
|
||||
|
||||
/**
|
||||
* 工作流相关
|
||||
*/
|
||||
String WORKFLOW_FORM = "workflowForm";
|
||||
|
||||
/**
|
||||
* 工作流相关
|
||||
*/
|
||||
String ITEM_NAME = "itemName";
|
||||
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 字典下拉选头类型
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 20:36
|
||||
*/
|
||||
@Getter
|
||||
public enum SelectTagHeadTypeEnum {
|
||||
|
||||
/**
|
||||
* 全部
|
||||
*/
|
||||
ALL("1", "全部"),
|
||||
|
||||
/**
|
||||
* 请选择
|
||||
*/
|
||||
SELECT("2", "请选择");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String name;
|
||||
|
||||
SelectTagHeadTypeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取枚举
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 20:36
|
||||
*/
|
||||
public static SelectTagHeadTypeEnum codeToEnum(String code) {
|
||||
if (null != code) {
|
||||
for (SelectTagHeadTypeEnum e : SelectTagHeadTypeEnum.values()) {
|
||||
if (e.getCode().equals(code)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码转化成中文含义
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 20:36
|
||||
*/
|
||||
public static String codeToName(String code) {
|
||||
if (null != code) {
|
||||
for (SelectTagHeadTypeEnum e : SelectTagHeadTypeEnum.values()) {
|
||||
if (e.getCode().equals(code)) {
|
||||
return e.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
return "未知";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.expander;
|
||||
|
||||
import cn.stylefeng.guns.core.beetl.consts.BeetlConstants;
|
||||
import cn.stylefeng.roses.kernel.config.api.context.ConfigContext;
|
||||
|
||||
/**
|
||||
* Beetl模板引擎相关配置
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 11:36
|
||||
*/
|
||||
public class BeetlConfigExpander {
|
||||
|
||||
/**
|
||||
* 边界符开始符号
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:27
|
||||
*/
|
||||
public static String getDelimiterStatementStart() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("DELIMITER_STATEMENT_START", String.class, BeetlConstants.DEFAULT_DELIMITER_STATEMENT_START);
|
||||
}
|
||||
|
||||
/**
|
||||
* beetl边界符的结束符号
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:27
|
||||
*/
|
||||
public static String getDelimiterStatementEnd() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("DELIMITER_STATEMENT_END", String.class, BeetlConstants.DEFAULT_DELIMITER_STATEMENT_END);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义标签文件Root目录
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:27
|
||||
*/
|
||||
public static String getResourceTagRoot() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("RESOURCE_TAG_ROOT", String.class, BeetlConstants.DEFAULT_RESOURCE_TAG_ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义标签文件后缀
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:27
|
||||
*/
|
||||
public static String getResourceTagSuffix() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("RESOURCE_TAG_SUFFIX", String.class, BeetlConstants.DEFAULT_RESOURCE_TAG_SUFFIX);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否检测文件变化,开发用true合适,但线上要改为false
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 12:27
|
||||
*/
|
||||
public static String getResourceAutoCheck() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("RESOURCE_AUTO_CHECK", String.class, BeetlConstants.DEFAULT_RESOURCE_AUTO_CHECK);
|
||||
}
|
||||
/**
|
||||
* 自定义支持HTML标签
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 21:06
|
||||
*/
|
||||
public static String getHtmlTagFlag() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("HTML_TAG_FLAG", String.class, BeetlConstants.DEFAULT_HTML_TAG_FLAG);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,182 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.tag;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.stylefeng.guns.core.beetl.consts.DictTagConstants;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.service.DictService;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.service.DictTypeService;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.beetl.core.tag.GeneralVarTagBinding;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* beetl字典标签基类
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 18:45
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SysDictBaseTag extends GeneralVarTagBinding {
|
||||
|
||||
public DictService dictService = SpringUtil.getBean(DictService.class);
|
||||
|
||||
public DictTypeService dictTypeService = SpringUtil.getBean(DictTypeService.class);
|
||||
|
||||
/**
|
||||
* html组件 id
|
||||
*/
|
||||
public String id;
|
||||
|
||||
/**
|
||||
* html组件 name
|
||||
*/
|
||||
public String name;
|
||||
|
||||
/**
|
||||
* html组件 type
|
||||
*/
|
||||
public String type;
|
||||
|
||||
/**
|
||||
* 字典类型编码
|
||||
*/
|
||||
public String dictTypeCode;
|
||||
|
||||
/**
|
||||
* layui元素的风格
|
||||
*/
|
||||
public String laySkin;
|
||||
|
||||
/**
|
||||
* layui事件过滤器
|
||||
*/
|
||||
public String layFilter;
|
||||
|
||||
/**
|
||||
* layui校验
|
||||
*/
|
||||
public String layVerify;
|
||||
|
||||
/**
|
||||
* select控件提示name
|
||||
*/
|
||||
public String headName;
|
||||
|
||||
/**
|
||||
* select控件提示value
|
||||
*/
|
||||
public String headValue;
|
||||
|
||||
/**
|
||||
* select控件提示类型::1-全部,2-请选择
|
||||
*/
|
||||
public String headType;
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
public String defaultValue;
|
||||
|
||||
/**
|
||||
* 工作流相关
|
||||
*/
|
||||
public String workflowForm;
|
||||
|
||||
/**
|
||||
* 工作流相关
|
||||
*/
|
||||
public String itemName;
|
||||
|
||||
/**
|
||||
* 初始化绑定属性
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 23:49
|
||||
*/
|
||||
public void initAttr() {
|
||||
Map<String, Object> attrs = this.getAttributes();
|
||||
if (attrs.size() > 0) {
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.ID))) {
|
||||
this.setId(attrs.get(DictTagConstants.ID).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.NAME))) {
|
||||
this.setName(attrs.get(DictTagConstants.NAME).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.TYPE))) {
|
||||
this.setType(attrs.get(DictTagConstants.TYPE).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.DICT_TYPE_CODE))) {
|
||||
this.setDictTypeCode(attrs.get(DictTagConstants.DICT_TYPE_CODE).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.LAY_SKIN))) {
|
||||
this.setLaySkin(attrs.get(DictTagConstants.LAY_SKIN).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.LAY_FILTER))) {
|
||||
this.setLayFilter(attrs.get(DictTagConstants.LAY_FILTER).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.LAY_VERIFY))) {
|
||||
this.setLayVerify(attrs.get(DictTagConstants.LAY_VERIFY).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.HEAD_NAME))) {
|
||||
this.setHeadName(attrs.get(DictTagConstants.HEAD_NAME).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.HEAD_VALUE))) {
|
||||
this.setHeadValue(attrs.get(DictTagConstants.HEAD_VALUE).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.HEAD_TYPE))) {
|
||||
this.setHeadType(attrs.get(DictTagConstants.HEAD_TYPE).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.DEFAULT_VALUE))) {
|
||||
this.setDefaultValue(attrs.get(DictTagConstants.DEFAULT_VALUE).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.WORKFLOW_FORM))) {
|
||||
this.setWorkflowForm(attrs.get(DictTagConstants.WORKFLOW_FORM).toString());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(attrs.get(DictTagConstants.ITEM_NAME))) {
|
||||
this.setItemName(attrs.get(DictTagConstants.ITEM_NAME).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典类型
|
||||
*
|
||||
* @return 字典类型
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 23:46
|
||||
*/
|
||||
public SysDictType getDictType() {
|
||||
// 根据字典类型编码去查询字典类型
|
||||
LambdaQueryWrapper<SysDictType> dictTypeQueryWrapper = new LambdaQueryWrapper<>();
|
||||
dictTypeQueryWrapper.eq(SysDictType::getDictTypeCode, this.getDictTypeCode());
|
||||
dictTypeQueryWrapper.ne(SysDictType::getDelFlag, YesOrNotEnum.Y.getCode());
|
||||
return dictTypeService.getOne(dictTypeQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 根据字典类型返回字典集合
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 23:46
|
||||
*/
|
||||
public List<SysDict> getDictList() {
|
||||
// 查询字典列表
|
||||
LambdaQueryWrapper<SysDict> dictQueryWrapper = new LambdaQueryWrapper<>();
|
||||
dictQueryWrapper.eq(SysDict::getDictTypeCode, this.getDictTypeCode());
|
||||
dictQueryWrapper.ne(SysDict::getDelFlag, YesOrNotEnum.Y.getCode());
|
||||
dictQueryWrapper.orderByAsc(SysDict::getDictSort);
|
||||
return dictService.list(dictQueryWrapper);
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.tag;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* checkbox字典组件
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 19:06
|
||||
*/
|
||||
@Slf4j
|
||||
public class SysDictCheckBoxTag extends SysDictBaseTag {
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
// 初始属性
|
||||
initAttr();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 当字典类型编码不为空
|
||||
if (StrUtil.isNotBlank(this.getDictTypeCode())) {
|
||||
// 根据字典类型编码去查询字典类型
|
||||
SysDictType dictType = getDictType();
|
||||
// 判断字典类型不为空
|
||||
if (dictType != null) {
|
||||
List<SysDict> lst = getDictList();
|
||||
// 默认选中值
|
||||
String defaultValue = this.getDefaultValue();
|
||||
// 循环字典列表
|
||||
for (SysDict option : lst) {
|
||||
// 生成input的id
|
||||
String id = this.getType() + "_" + this.getName() + "_" + option.getDictCode();
|
||||
// 拼接html
|
||||
sb.append(" <input type='checkbox' name='").append(this.getName())
|
||||
.append("' id='").append(id)
|
||||
.append("' title='").append(option.getDictName())
|
||||
.append("' value='").append(option.getDictCode())
|
||||
.append("'");
|
||||
// layui 元素的风格
|
||||
if (StrUtil.isNotBlank(this.getLaySkin())) {
|
||||
sb.append(" lay-skin='").append(this.getLaySkin()).append("'");
|
||||
}
|
||||
// layui 事件过滤器
|
||||
if (StrUtil.isNotBlank(this.getLayFilter())) {
|
||||
sb.append(" lay-filter='").append(this.getLayFilter()).append("'");
|
||||
}
|
||||
// layui 表单验证
|
||||
if (StrUtil.isNotBlank(this.getLayVerify())) {
|
||||
sb.append(" lay-verify='").append(this.getLayVerify()).append("'");
|
||||
}
|
||||
// 默认选中值
|
||||
if (StrUtil.isNotBlank(defaultValue) && defaultValue.equals(option.getDictCode())) {
|
||||
sb.append(" checked ");
|
||||
}
|
||||
sb.append(" /> ");
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
this.ctx.byteWriter.writeString(sb.toString());
|
||||
} catch (IOException e) {
|
||||
log.error("checkbox字典初始化异常:",e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.tag;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* radio字典组件
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 19:59
|
||||
*/
|
||||
@Slf4j
|
||||
public class SysDictRadioTag extends SysDictBaseTag {
|
||||
@Override
|
||||
public void render() {
|
||||
// 初始属性
|
||||
initAttr();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 当字典类型编码不为空
|
||||
if (StrUtil.isNotBlank(this.getDictTypeCode())) {
|
||||
// 根据字典类型编码去查询字典类型
|
||||
SysDictType dictType = getDictType();
|
||||
// 判断字典类型不为空
|
||||
if (dictType != null) {
|
||||
List<SysDict> lst = getDictList();
|
||||
// 默认选中值
|
||||
String defaultValue = this.getDefaultValue();
|
||||
int index = 0;
|
||||
for (SysDict option : lst) {
|
||||
// 生成input的id
|
||||
String id = this.getType() + "_" + this.getName() + "_" + option.getDictCode();
|
||||
// 拼接html
|
||||
sb.append(" <input type='radio' name='").append(this.getName())
|
||||
.append("' id='").append(id)
|
||||
.append("' title='").append(option.getDictName())
|
||||
.append("' value='").append(option.getDictCode())
|
||||
.append("'");
|
||||
|
||||
// layui 元素的风格
|
||||
if (StrUtil.isNotBlank(this.getLaySkin())) {
|
||||
sb.append(" lay-skin='").append(this.getLaySkin()).append("'");
|
||||
}
|
||||
// layui 事件过滤器
|
||||
if (StrUtil.isNotBlank(this.getLayFilter())) {
|
||||
sb.append(" lay-filter='").append(this.getLayFilter()).append("'");
|
||||
}
|
||||
// layui 表单验证
|
||||
if (StrUtil.isNotBlank(this.getLayVerify())) {
|
||||
sb.append(" lay-verify='").append(this.getLayVerify()).append("'");
|
||||
}
|
||||
// 默认选中值
|
||||
if (StrUtil.isNotBlank(defaultValue) && defaultValue.equals(option.getDictCode())) {
|
||||
sb.append(" checked ");
|
||||
} else {
|
||||
// 无默认值选中第一个(忘了为什么设计先保留逻辑)
|
||||
if (index == 0) {
|
||||
sb.append(" checked ");
|
||||
}
|
||||
}
|
||||
|
||||
sb.append(" /> ");
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
this.ctx.byteWriter.writeString(sb.toString());
|
||||
} catch (IOException e) {
|
||||
log.error("select字典初始化异常:", e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,98 +0,0 @@
|
|||
package cn.stylefeng.guns.core.beetl.tag;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.stylefeng.guns.core.beetl.enums.SelectTagHeadTypeEnum;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* select字典组件
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/16 19:37
|
||||
*/
|
||||
@Slf4j
|
||||
public class SysDictSelectTag extends SysDictBaseTag {
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
// 初始属性
|
||||
initAttr();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 当字典类型编码不为空
|
||||
if (StrUtil.isNotBlank(this.getDictTypeCode())) {
|
||||
sb.append("<select name='").append(this.getName())
|
||||
.append("' id='").append(this.getId())
|
||||
.append("'");
|
||||
|
||||
// layui 事件过滤器
|
||||
if (StrUtil.isNotBlank(this.getLayFilter())) {
|
||||
sb.append(" lay-filter='").append(this.getLayFilter()).append("' ");
|
||||
}
|
||||
// layui 表单验证
|
||||
if (StrUtil.isNotBlank(this.getLayVerify())) {
|
||||
sb.append(" lay-verify='").append(this.getLayVerify()).append("' ");
|
||||
}
|
||||
// 原有工作流用到
|
||||
if (StrUtil.isNotBlank(this.getWorkflowForm())) {
|
||||
sb.append(" workFlowForm='").append(this.getWorkflowForm()).append("' ");
|
||||
}
|
||||
if (StrUtil.isNotBlank(this.getItemName())) {
|
||||
sb.append(" itemName='").append(this.getItemName()).append("' ");
|
||||
}
|
||||
sb.append(" >");
|
||||
|
||||
if (StrUtil.isNotBlank(this.getHeadName())) {
|
||||
sb.append("<option value='").append(this.getHeadValue()).append("' selected>")
|
||||
.append(this.getHeadName()).append("</option>");
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(this.getHeadType())) {
|
||||
if (SelectTagHeadTypeEnum.ALL.getCode().equals(this.getHeadType())) {
|
||||
sb.append("<option value='").append(this.getHeadValue()).append("' selected>")
|
||||
.append(" - 全部 - ").append("</option>");
|
||||
}
|
||||
if (SelectTagHeadTypeEnum.SELECT.getCode().equals(this.getHeadType())) {
|
||||
sb.append("<option value='").append(this.getHeadValue()).append("' selected>")
|
||||
.append(" - 请选择 - ").append("</option>");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 根据字典类型编码去查询字典类型
|
||||
SysDictType dictType = getDictType();
|
||||
// 判断字典类型不为空
|
||||
if (dictType != null) {
|
||||
List<SysDict> lst = getDictList();
|
||||
// 默认选中值
|
||||
String defaultValue = this.getDefaultValue();
|
||||
// 循环字典列表,添加下拉选项
|
||||
int index = 0;
|
||||
for (SysDict option : lst) {
|
||||
sb.append("<option value='").append(option.getDictCode()).append("'");
|
||||
// 设置默认选中值
|
||||
if (StrUtil.isNotBlank(defaultValue) && defaultValue.equals(option.getDictCode())) {
|
||||
sb.append(" selected ");
|
||||
} else {
|
||||
// 未设置headName和headType 默认选中第一个
|
||||
if (index == 0 && StrUtil.isNotBlank(this.getHeadName()) && StrUtil.isNotBlank(this.getHeadType())) {
|
||||
sb.append(" selected ");
|
||||
}
|
||||
}
|
||||
sb.append(">").append(option.getDictName()).append("</option>");
|
||||
index++;
|
||||
}
|
||||
}
|
||||
sb.append("</select>");
|
||||
}
|
||||
try {
|
||||
this.ctx.byteWriter.writeString(sb.toString());
|
||||
} catch (IOException e) {
|
||||
log.error("select字典初始化异常:",e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package cn.stylefeng.guns.core.error;
|
||||
|
||||
import org.beetl.ext.spring.BeetlSpringView;
|
||||
|
||||
/**
|
||||
* 错误页面的默认跳转(例如请求404的时候,默认走这个视图解析器)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2017-05-21 11:34
|
||||
*/
|
||||
public class CustomErrorView extends BeetlSpringView {
|
||||
|
||||
@Override
|
||||
public String getContentType() {
|
||||
return "text/html;charset=UTF-8";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package cn.stylefeng.guns.modular.business.controller;
|
||||
package cn.stylefeng.guns.modular.demo.controller;
|
||||
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.stylefeng.guns.modular.business.service.DemoService;
|
||||
import cn.stylefeng.guns.modular.demo.service.DemoService;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* 这个包写用户的业务的代码
|
||||
*/
|
||||
package cn.stylefeng.guns.modular.business;
|
||||
package cn.stylefeng.guns.modular.demo;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.stylefeng.guns.modular.business.service;
|
||||
package cn.stylefeng.guns.modular.demo.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.api;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* API文档管理
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/14 21:05
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "API文档管理")
|
||||
public class ApiViewController {
|
||||
|
||||
/**
|
||||
* 编辑应用界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:37
|
||||
*/
|
||||
@GetResource(name = "API文档界面", path = "/view/api")
|
||||
public String apiIndex() {
|
||||
return "/modular/system/api/api.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.app;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 应用管理界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:32
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "应用管理界面")
|
||||
public class AppViewController {
|
||||
|
||||
/**
|
||||
* 应用管理首页
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:32
|
||||
*/
|
||||
@GetResource(name = "应用管理首页", path = "/view/app")
|
||||
public String appIndex() {
|
||||
return "/modular/system/app/app.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增应用界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:37
|
||||
*/
|
||||
@GetResource(name = "新增应用界面", path = "/view/app/add")
|
||||
public String appAdd() {
|
||||
return "/modular/system/app/app_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑应用界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:37
|
||||
*/
|
||||
@GetResource(name = "编辑应用界面", path = "/view/app/edit")
|
||||
public String appEdit() {
|
||||
return "/modular/system/app/app_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.common;
|
||||
|
||||
import cn.stylefeng.guns.modular.system.common.pojo.CommonTreeRequest;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.enums.defaults.DefaultBusinessExceptionEnum;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
/**
|
||||
* 通用界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 20:18
|
||||
*/
|
||||
@Controller
|
||||
@Slf4j
|
||||
@ApiResource(name = "通用界面")
|
||||
public class CommonViewController {
|
||||
|
||||
/**
|
||||
* 通用的树列表选择器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 20:19
|
||||
*/
|
||||
@GetResource(name = "通用的树列表选择器", path = "/view/common/tree")
|
||||
public String commonTreeSelect(@Valid CommonTreeRequest commonTreeRequest, Model model) {
|
||||
try {
|
||||
model.addAttribute("formName", URLDecoder.decode(commonTreeRequest.getFormName(), "UTF-8"));
|
||||
model.addAttribute("formId", URLDecoder.decode(commonTreeRequest.getFormId(), "UTF-8"));
|
||||
model.addAttribute("treeUrl", URLDecoder.decode(commonTreeRequest.getTreeUrl(), "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
log.error("解析url的参数出错!", e);
|
||||
throw new ServiceException("guns-standalone-beetl", DefaultBusinessExceptionEnum.SYSTEM_RUNTIME_ERROR);
|
||||
}
|
||||
return "/component/tree_dlg.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.common.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 通用树选择器界面的请求参数
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 20:20
|
||||
*/
|
||||
@Data
|
||||
public class CommonTreeRequest {
|
||||
|
||||
/**
|
||||
* 传递给上级页面的哪个字段,例如 parent.MenuInfoDlg.data.pcodeName
|
||||
*/
|
||||
@NotBlank(message = "fromName不能为空")
|
||||
private String formName;
|
||||
|
||||
/**
|
||||
* 传递给上级页面的哪个id值,例如 parent.MenuInfoDlg.data.pid
|
||||
*/
|
||||
@NotBlank(message = "formId不能为空")
|
||||
private String formId;
|
||||
|
||||
/**
|
||||
* 渲染出数据的url,例如/menu/selectMenuTreeList
|
||||
*/
|
||||
@NotBlank(message = "tree渲染的url参数不能为空")
|
||||
private String treeUrl;
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.config;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 系统配置相关页面渲染
|
||||
*
|
||||
* @author jiawei
|
||||
* @date 2021/1/10 14:28
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "系统配置相关页面")
|
||||
public class ConfigViewController {
|
||||
|
||||
/**
|
||||
* 系统配置-首页-视图
|
||||
*
|
||||
* @author jiawei
|
||||
* @date 2021/1/4 13:33
|
||||
*/
|
||||
@GetResource(name = "系统配置-列表-视图", path = "/view/config")
|
||||
public String indexView() {
|
||||
return "/modular/system/config/config.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统配置—新增-视图
|
||||
*
|
||||
* @author jiawei
|
||||
* @date 2021/1/4 13:34
|
||||
*/
|
||||
@GetResource(name = "系统配置—新增-视图", path = "/view/config/addView")
|
||||
public String addView() {
|
||||
return "/modular/system/config/sysConfig_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统配置-修改-视图
|
||||
*
|
||||
* @author jiawei
|
||||
* @date 2021/1/4 13:35
|
||||
*/
|
||||
@GetResource(name = "系统配置-修改-视图", path = "/view/config/editView")
|
||||
public String editView() {
|
||||
return "/modular/system/config/sysConfig_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.dashboard;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 工作台和分析页界面渲染
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/29 21:29
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "工作台和分析页面")
|
||||
public class DashboardViewController {
|
||||
|
||||
/**
|
||||
* 工作台
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2018/12/24 22:43
|
||||
*/
|
||||
@GetResource(name = "工作台", path = "/view/dashboard/workplace", requiredPermission = false)
|
||||
public String platform() {
|
||||
return "/modular/system/dashboard/board_platform.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分析页面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/29 21:27
|
||||
*/
|
||||
@GetResource(name = "分析页面", path = "/view/dashboard/analysis", requiredPermission = false)
|
||||
public String analyse() {
|
||||
return "/modular/system/dashboard/board_analyse.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.dataCenter;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 数据中心视图控制器
|
||||
*
|
||||
* @author linjinfeng
|
||||
* @date 2021/3/29 10:00
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "数据中心导入导出相关的界面渲染")
|
||||
public class dataCenterViewController {
|
||||
|
||||
/**
|
||||
* 基础数据-导出中心-视图
|
||||
*
|
||||
* @author linjinfeng
|
||||
* @date 2021/3/29 10:00
|
||||
*/
|
||||
@GetResource(name = "基础数据-导出中心-视图", path = "/view/export")
|
||||
public String exportView() {
|
||||
return "/modular/system/dataCenter/exportCenter.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础数据-导入中心-视图
|
||||
*
|
||||
* @author linjinfeng
|
||||
* @date 2021/3/29 10:00
|
||||
*/
|
||||
@GetResource(name = "基础数据-导出中心-视图", path = "/view/import")
|
||||
public String importView() {
|
||||
return "/modular/system/dataCenter/importCenter.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.datasource;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 多数据源界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/23 21:45
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "多数据源界面")
|
||||
public class DataSourceViewController {
|
||||
|
||||
/**
|
||||
* 多数据源列表界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/23 21:45
|
||||
*/
|
||||
@GetResource(name = "多数据源列表界面", path = "/view/datasource")
|
||||
public String indexView() {
|
||||
return "/modular/system/datasource/datasource.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多数据源新增界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/23 21:59
|
||||
*/
|
||||
@GetResource(name = "多数据源新增界面", path = "/view/datasource/add")
|
||||
public String addView() {
|
||||
return "/modular/system/datasource/datasource_add.html";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.dict;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 字典类型视图控制器
|
||||
*
|
||||
* @author huangyao
|
||||
* @date 2021/1/6 20:53
|
||||
**/
|
||||
@Controller
|
||||
@ApiResource(name = "字典类型管理相关的界面渲染")
|
||||
public class DictTypeViewController {
|
||||
|
||||
/**
|
||||
* 字典管理-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "字典类型管理-列表-视图", path = "/view/dictType")
|
||||
public String indexView() {
|
||||
return "/modular/system/dict/dictType.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典类型管理-添加-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "字典类型管理-添加-视图", path = "/view/dictType/addView")
|
||||
public String addView() {
|
||||
return "/modular/system/dict/dictType_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典类型管理-编辑-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "字典类型管理-编辑-视图", path = "/view/dictType/editView")
|
||||
public String editView() {
|
||||
return "/modular/system/dict/dictType_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.dict;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 字典视图控制器
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "字典管理相关的界面渲染")
|
||||
public class DictViewController {
|
||||
|
||||
/**
|
||||
* 字典管理-列表-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "字典管理-列表-视图", path = "/view/dict")
|
||||
public String indexView() {
|
||||
return "/modular/system/dict/dict.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典管理-添加-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "字典管理-添加-视图", path = "/view/dict/addView")
|
||||
public String addView() {
|
||||
return "/modular/system/dict/dict_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典管理-添加系统配置字典-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "字典管理-添加系统配置字典-视图", path = "/view/dict/addConfigView")
|
||||
public String addConfigView() {
|
||||
return "/modular/system/dict/dict_add_config.html";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 字典管理-编辑-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "字典管理-编辑-视图", path = "/view/dict/editView")
|
||||
public String editView() {
|
||||
return "/modular/system/dict/dict_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.error;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
/**
|
||||
* 错误页面的跳转
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/1 21:20
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "错误页面的跳转")
|
||||
public class ErrorViewController {
|
||||
|
||||
/**
|
||||
* 跳转到session超时页面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/1 21:21
|
||||
*/
|
||||
@GetResource(name = "跳转到session超时页面", path = "/view/global/sessionError", requiredPermission = false, requiredLogin = false)
|
||||
public String errorPageInfo(Model model) {
|
||||
model.addAttribute("tips", "登陆超时,请您重新登陆!");
|
||||
return "/login.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.file;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 文件管理界面
|
||||
*
|
||||
* @author lgq
|
||||
* @date 2021/1/9
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "文件管理界面")
|
||||
public class FileViewController {
|
||||
|
||||
/**
|
||||
* 文件管理首页
|
||||
*
|
||||
* @author lgq
|
||||
* @date 2021/1/9
|
||||
*/
|
||||
@GetResource(name = "文件管理首页", path = "/view/file")
|
||||
public String fileIndex() {
|
||||
return "/modular/system/fileInfo/file_info.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件详情页面
|
||||
*
|
||||
* @author lgq
|
||||
* @date 2021/1/9
|
||||
*/
|
||||
@GetResource(name = "文件详情页面", path = "/view/fileInfoDetails")
|
||||
public String details() {
|
||||
return "/modular/system/fileInfo/file_info_details.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.i18n;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 多语言界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/24 19:15
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "多语言界面")
|
||||
public class TranslationViewController {
|
||||
|
||||
/**
|
||||
* 多语言主界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/24 19:15
|
||||
*/
|
||||
@GetResource(name = "文件管理首页", path = "/view/i18n")
|
||||
public String index() {
|
||||
return "/modular/system/i18n/translation.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多语言新增界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/24 19:16
|
||||
*/
|
||||
@GetResource(name = "多语言新增界面", path = "/view/i18n/add")
|
||||
public String add() {
|
||||
return "/modular/system/i18n/translation_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多语言编辑界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/24 19:16
|
||||
*/
|
||||
@GetResource(name = "文件管理首页", path = "/view/i18n/edit")
|
||||
public String edit() {
|
||||
return "/modular/system/i18n/translation_edit.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 多语言增加语种界面
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/22 16:09
|
||||
*/
|
||||
@GetResource(name = "多语言增加语种界面", path = "/view/i18n/addTranslationView")
|
||||
public String addTranslationView() {
|
||||
return "/modular/system/i18n/dict_add_translation.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.index.controller;
|
||||
|
||||
import cn.stylefeng.guns.modular.system.index.service.IndexService;
|
||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 首页相关的界面渲染
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 16:23
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "首页相关的界面渲染")
|
||||
public class IndexViewController {
|
||||
|
||||
@Resource
|
||||
private IndexService indexService;
|
||||
|
||||
/**
|
||||
* 首页界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/13 17:19
|
||||
*/
|
||||
@GetResource(name = "首页界面", path = "/", requiredLogin = false, requiredPermission = false, viewFlag = true)
|
||||
public String indexView(Model model) {
|
||||
|
||||
// 当前用户已经登录,跳转到首页
|
||||
if (LoginContext.me().hasLogin()) {
|
||||
model.addAllAttributes(indexService.createIndexRenderAttributes());
|
||||
return "/index.html";
|
||||
}
|
||||
|
||||
// 当前用户没有登录,跳转到登录页面
|
||||
return "/login.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人中心界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/29 21:53
|
||||
*/
|
||||
@GetResource(name = "个人中心界面", path = "/view/personal", requiredPermission = false)
|
||||
public String personal(Model model) {
|
||||
model.addAllAttributes(indexService.createPersonInfoRenderAttributes());
|
||||
return "/modular/system/index/personal_info.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 锁屏界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/29 21:34
|
||||
*/
|
||||
@GetResource(name = "锁屏界面", path = "/view/lock", requiredPermission = false)
|
||||
public String lock() {
|
||||
return "/modular/system/index/lock_screen.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 主题切换界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/29 21:42
|
||||
*/
|
||||
@GetResource(name = "主题切换界面", path = "/view/theme", requiredPermission = false)
|
||||
public String theme() {
|
||||
return "/modular/system/index/theme.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/29 21:42
|
||||
*/
|
||||
@GetResource(name = "修改密码界面", path = "/view/changePassword", requiredPermission = false)
|
||||
public String changePassword() {
|
||||
return "/modular/system/index/change_password.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,145 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.index.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleRoleInfo;
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.basic.SimpleUserInfo;
|
||||
import cn.stylefeng.roses.kernel.message.api.MessageApi;
|
||||
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
|
||||
import cn.stylefeng.roses.kernel.message.api.pojo.request.MessageRequest;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.menu.layui.LayuiAppIndexMenusVO;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.menu.layui.LayuiIndexMenuTreeNode;
|
||||
import cn.stylefeng.roses.kernel.system.modular.menu.service.SysMenuService;
|
||||
import cn.stylefeng.roses.kernel.system.modular.organization.entity.HrOrganization;
|
||||
import cn.stylefeng.roses.kernel.system.modular.organization.service.HrOrganizationService;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 首页相关数据组装服务
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 18:25
|
||||
*/
|
||||
@Service
|
||||
public class IndexService {
|
||||
|
||||
@Resource
|
||||
private SysMenuService sysMenuService;
|
||||
|
||||
@Resource
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@Resource
|
||||
private HrOrganizationService hrOrganizationService;
|
||||
|
||||
@Resource
|
||||
private MessageApi messageApi;
|
||||
|
||||
/**
|
||||
* 获取首页需要渲染的参数
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/1 18:27
|
||||
*/
|
||||
public Map<String, Object> createIndexRenderAttributes() {
|
||||
|
||||
HashMap<String, Object> renderMap = new HashMap<>();
|
||||
|
||||
LoginUser loginUser = LoginContext.me().getLoginUser();
|
||||
SimpleUserInfo simpleUserInfo = loginUser.getSimpleUserInfo();
|
||||
|
||||
// 渲染首页的菜单
|
||||
List<LayuiAppIndexMenusVO> layuiAppIndexMenus = sysMenuService.getLayuiIndexMenus();
|
||||
|
||||
// 将个人信息菜单单独去除掉
|
||||
this.removePersonalMenu(layuiAppIndexMenus);
|
||||
|
||||
renderMap.put("layuiAppIndexMenus", layuiAppIndexMenus);
|
||||
|
||||
// 获取首页的头像
|
||||
renderMap.put("avatar", sysUserService.getUserAvatarUrl(simpleUserInfo.getAvatar()));
|
||||
|
||||
// 获取人员姓名
|
||||
renderMap.put("name", simpleUserInfo.getRealName());
|
||||
|
||||
// 获取登录用户ws-url
|
||||
renderMap.put("wsUrl", loginUser.getWsUrl());
|
||||
|
||||
// 未读消息数量
|
||||
MessageRequest messageRequest = new MessageRequest();
|
||||
messageRequest.setReadFlag(MessageReadFlagEnum.UNREAD.getCode());
|
||||
renderMap.put("msgUnReadCount", messageApi.queryCountCurrentUser(messageRequest));
|
||||
|
||||
return renderMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建个人中心页面需要渲染的值
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/1 18:38
|
||||
*/
|
||||
public Map<String, Object> createPersonInfoRenderAttributes() {
|
||||
|
||||
HashMap<String, Object> renderMap = new HashMap<>();
|
||||
renderMap.put("roleName", "角色空");
|
||||
renderMap.put("orgName", "组织架构空");
|
||||
|
||||
// 添加用户基本信息字段
|
||||
LoginUser loginUser = LoginContext.me().getLoginUser();
|
||||
SimpleUserInfo simpleUserInfo = loginUser.getSimpleUserInfo();
|
||||
renderMap.putAll(BeanUtil.beanToMap(simpleUserInfo));
|
||||
|
||||
// 角色名称
|
||||
List<SimpleRoleInfo> simpleRoleInfoList = loginUser.getSimpleRoleInfoList();
|
||||
if (ObjectUtil.isNotEmpty(simpleRoleInfoList)) {
|
||||
String roleName = simpleRoleInfoList.get(0).getRoleName();
|
||||
renderMap.put("roleName", roleName);
|
||||
}
|
||||
|
||||
// 组织机构名称
|
||||
Long organizationId = loginUser.getOrganizationId();
|
||||
HrOrganization hrOrganization = hrOrganizationService.getById(organizationId);
|
||||
if (hrOrganization != null) {
|
||||
renderMap.put("orgName", hrOrganization.getOrgName());
|
||||
}
|
||||
|
||||
// 渲染头像的url
|
||||
renderMap.put("avatar", sysUserService.getUserAvatarUrl(simpleUserInfo.getAvatar()));
|
||||
|
||||
return renderMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除个人信息菜单显示
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/14 16:30
|
||||
*/
|
||||
private void removePersonalMenu(List<LayuiAppIndexMenusVO> layuiAppIndexMenusVOS) {
|
||||
|
||||
ArrayList<LayuiIndexMenuTreeNode> menus = new ArrayList<>();
|
||||
|
||||
for (LayuiAppIndexMenusVO layuiAppIndexMenusVO : layuiAppIndexMenusVOS) {
|
||||
if (layuiAppIndexMenusVO.getAppCode().equals("system")) {
|
||||
List<LayuiIndexMenuTreeNode> layuiIndexMenuTreeNodes = layuiAppIndexMenusVO.getLayuiIndexMenuTreeNodes();
|
||||
for (LayuiIndexMenuTreeNode layuiIndexMenuTreeNode : layuiIndexMenuTreeNodes) {
|
||||
if (!layuiIndexMenuTreeNode.getMenuName().equals("个人信息")) {
|
||||
menus.add(layuiIndexMenuTreeNode);
|
||||
}
|
||||
}
|
||||
layuiAppIndexMenusVO.setLayuiIndexMenuTreeNodes(menus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.log;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 业务日志视图控制器
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/13 19:45
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "操作日志管理相关的界面渲染")
|
||||
public class LogViewController {
|
||||
|
||||
/**
|
||||
* 操作日志管理列表
|
||||
*
|
||||
* @author TSQ
|
||||
* @date 2021/1/5 15:18
|
||||
*/
|
||||
@GetResource(name = "操作日志管理列表", path = "/view/log")
|
||||
public String indexView() {
|
||||
return "/modular/system/log/log.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务日志详情-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/13 19:45
|
||||
*/
|
||||
@GetResource(name = "业务日志详情-视图", path = "/view/log/detailView")
|
||||
public String detailView() {
|
||||
return "/modular/system/log/log_detail.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.log;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 登陆日志管理控制器界面渲染
|
||||
*
|
||||
* @author TSQ
|
||||
* @date 2021/1/5 14:42
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "登陆日志管理相关的界面渲染")
|
||||
public class LoginLogViewController {
|
||||
|
||||
/**
|
||||
* 登陆日志管理列表
|
||||
*
|
||||
* @author TSQ
|
||||
* @date 2021/1/5 15:17
|
||||
*/
|
||||
@GetResource(name = "登陆日志管理列表", path = "/view/loginLog")
|
||||
public String indexView() {
|
||||
return "/modular/system/log/login_log.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.login;
|
||||
|
||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 登录相关的界面渲染
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 16:23
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "登录相关的接口")
|
||||
public class LoginViewController {
|
||||
|
||||
/**
|
||||
* 登录界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 17:10
|
||||
*/
|
||||
@GetResource(name = "登录界面", path = "/view/login", requiredPermission = false, requiredLogin = false)
|
||||
public String login() {
|
||||
if (LoginContext.me().hasLogin()) {
|
||||
return "redirect:/";
|
||||
} else {
|
||||
return "/login.html";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.menu;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 菜单按钮管理界面
|
||||
*
|
||||
* @author luojie
|
||||
* @date 2021/1/9 16:11
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "菜单按钮管理界面")
|
||||
public class MenuButtonViewController {
|
||||
|
||||
/**
|
||||
* 菜单按钮管理首页
|
||||
*
|
||||
* @author luojie
|
||||
* @date 2021/1/9 16:13
|
||||
*/
|
||||
@GetResource(name = "菜单管理首页", path = "/view/menuButton")
|
||||
public String menuIndex() {
|
||||
return "/modular/system/menu/button.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜单按钮界面
|
||||
*
|
||||
* @author luojie
|
||||
* @date 2021/1/9 13:56
|
||||
*/
|
||||
@GetResource(name = "新增菜单按钮界面", path = "/view/menuButton/add")
|
||||
public String menuAdd() {
|
||||
return "/modular/system/menu/button_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜单按钮界面
|
||||
*
|
||||
* @author luojie
|
||||
* @date 2021/1/9 14:14
|
||||
*/
|
||||
@GetResource(name = "修改菜单按钮界面", path = "/view/menuButton/edit")
|
||||
public String menuEdit() {
|
||||
return "/modular/system/menu/button_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.menu;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 菜单管理界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 16:43
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "菜单管理界面")
|
||||
public class MenuViewController {
|
||||
|
||||
/**
|
||||
* 菜单管理首页
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:32
|
||||
*/
|
||||
@GetResource(name = "菜单管理首页", path = "/view/menu")
|
||||
public String menuIndex() {
|
||||
return "/modular/system/menu/menu.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜单界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:37
|
||||
*/
|
||||
@GetResource(name = "新增菜单界面", path = "/view/menu/add")
|
||||
public String menuAdd() {
|
||||
return "/modular/system/menu/menu_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜单界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 13:37
|
||||
*/
|
||||
@GetResource(name = "修改菜单界面", path = "/view/menu/edit")
|
||||
public String menuEdit() {
|
||||
return "/modular/system/menu/menu_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.message;
|
||||
|
||||
import cn.stylefeng.roses.kernel.message.api.MessageApi;
|
||||
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
|
||||
import cn.stylefeng.roses.kernel.message.api.pojo.request.MessageRequest;
|
||||
import cn.stylefeng.roses.kernel.message.api.pojo.response.MessageResponse;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统消息相关的界面渲染
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/11 19:37
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "系统消息相关的界面渲染")
|
||||
public class MessageViewController {
|
||||
|
||||
@Resource
|
||||
private MessageApi messageApi;
|
||||
|
||||
/**
|
||||
* 系统消息界面
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/10 17:42
|
||||
*/
|
||||
@GetResource(name = "系统消息界面", path = "/view/message", requiredPermission = false)
|
||||
public String message(Model model) {
|
||||
MessageRequest messageRequest = new MessageRequest();
|
||||
messageRequest.setReadFlag(MessageReadFlagEnum.UNREAD.getCode());
|
||||
Integer messageCount = messageApi.queryCountCurrentUser(messageRequest);
|
||||
List<MessageResponse> messageList = messageApi.queryListCurrentUser(messageRequest);
|
||||
model.addAttribute("msgUnReadCount", messageCount);
|
||||
model.addAttribute("msgUnReadList", messageList);
|
||||
return "/modular/system/index/message.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的消息界面
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/12 20:22
|
||||
*/
|
||||
@GetResource(name = "我的消息界面", path = "/view/message_list", requiredPermission = false)
|
||||
public String indexView() {
|
||||
return "/modular/system/message/message_list.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的消息界面
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/12 20:22
|
||||
*/
|
||||
@GetResource(name = "我的消息界面", path = "/view/message_view", requiredPermission = false)
|
||||
public String view(Model model) {
|
||||
model.addAttribute("openType", "view");
|
||||
return "/modular/system/message/message_view.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.monitor;
|
||||
|
||||
import cn.stylefeng.roses.kernel.monitor.system.holder.SystemHardwareInfoHolder;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 项目监控
|
||||
*
|
||||
* @author chenli
|
||||
* @date 2020/12/30 16:40
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "项目监控")
|
||||
public class MonitorController {
|
||||
|
||||
@Resource
|
||||
private SystemHardwareInfoHolder systemHardwareInfoHolder;
|
||||
|
||||
/**
|
||||
* 系统硬件信息页面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2018/12/24 22:43
|
||||
*/
|
||||
@GetResource(name = "服务器监控", path = "/view/monitor/systemInfo")
|
||||
public String systemInfo(Model model) {
|
||||
model.addAttribute("server", systemHardwareInfoHolder.getSystemHardwareInfo());
|
||||
return "/modular/system/monitor/systemInfo.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* druid sql监控页面
|
||||
*
|
||||
* @author chenli
|
||||
* @date 2021/1/4 16:32
|
||||
*/
|
||||
@GetResource(name = "SQL监控", path = "/view/monitor/druid")
|
||||
public String druidInfo() {
|
||||
return "/modular/system/monitor/druid.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.notice;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 通知管理界面
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/8 20:55
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "通知管理界面")
|
||||
public class NoticeViewController {
|
||||
|
||||
/**
|
||||
* 通知管理首页
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/8 20:55
|
||||
*/
|
||||
@GetResource(name = "通知管理列表", path = "/view/notice")
|
||||
public String roleIndex() {
|
||||
return "/modular/system/notice/notice.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通知界面
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/8 20:57
|
||||
*/
|
||||
@GetResource(name = "新增通知界面", path = "/view/notice/add")
|
||||
public String roleAdd() {
|
||||
return "/modular/system/notice/notice_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑通知界面
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/8 20:57
|
||||
*/
|
||||
@GetResource(name = "编辑通知界面", path = "/view/notice/edit")
|
||||
public String roleEdit() {
|
||||
return "/modular/system/notice/notice_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.online;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 在线用户查看界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/11 22:02
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "在线用户查看界面")
|
||||
public class OnlineUserViewController {
|
||||
|
||||
/**
|
||||
* 在线用户查看界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/11 22:03
|
||||
*/
|
||||
@GetResource(name = "在线用户查看界面", path = "/view/onlineUser")
|
||||
public String onlineUser() {
|
||||
return "/modular/system/onlineUser/online_user.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.organization;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 组织机构管理控制器界面
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/12/28 9:28
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "组织机构管理控制器界面")
|
||||
public class OrganizationViewController {
|
||||
|
||||
/**
|
||||
* 机构管理-首页-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/11/04 11:07
|
||||
*/
|
||||
@GetResource(name = "机构管理-首页-视图", path = "/view/organization")
|
||||
public String indexView() {
|
||||
return "/modular/system/organization/organization.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构管理—新增-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/11/04 11:07
|
||||
*/
|
||||
@GetResource(name = "机构管理—新增-视图", path = "/view/organization/addView")
|
||||
public String addView() {
|
||||
return "/modular/system/organization/organization_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 机构管理_修改_视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/11/04 11:07
|
||||
*/
|
||||
@GetResource(name = "机构管理-修改-视图", path = "/view/organization/editView")
|
||||
public String editView() {
|
||||
return "/modular/system/organization/organization_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
/**
|
||||
* 这个包是Guns框架自带业务的代码
|
||||
*/
|
||||
package cn.stylefeng.guns.modular.system;
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.position;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 职位管理控制器
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/12/28 9:28
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "职位管理相关的界面渲染")
|
||||
public class PositionViewController {
|
||||
|
||||
/**
|
||||
* 职位管理-首页-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/11/04 11:07
|
||||
*/
|
||||
@GetResource(name = "职位管理-首页-视图", path = "/view/position")
|
||||
public String indexView() {
|
||||
return "/modular/system/position/position.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 职位管理-首页-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/11/04 11:07
|
||||
*/
|
||||
@GetResource(name = "职位管理-首页-视图", path = "/view/position/addView")
|
||||
public String addView() {
|
||||
return "/modular/system/position/position_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 职位管理-首页-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2020/11/04 11:07
|
||||
*/
|
||||
@GetResource(name = "职位管理-首页-视图", path = "/view/position/editView")
|
||||
public String editView() {
|
||||
return "/modular/system/position/position_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.resource;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 资源管理界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 21:59
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "资源管理界面")
|
||||
public class ResourceViewController {
|
||||
|
||||
/**
|
||||
* 资源管理首页
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 21:59
|
||||
*/
|
||||
@GetResource(name = "资源管理首页", path = "/view/resource")
|
||||
public String resourceIndex() {
|
||||
return "/modular/system/resource/resource.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 资源管理详情
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 22:23
|
||||
*/
|
||||
@GetResource(name = "资源管理详情", path = "/view/resource/detail")
|
||||
public String resourceDetail() {
|
||||
return "/modular/system/resource/resource_detail.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.role;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 角色管理界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 20:55
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "角色管理界面")
|
||||
public class RoleViewController {
|
||||
|
||||
/**
|
||||
* 角色管理首页
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 20:55
|
||||
*/
|
||||
@GetResource(name = "应用管理首页", path = "/view/role")
|
||||
public String roleIndex() {
|
||||
return "/modular/system/role/role.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增角色界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 20:57
|
||||
*/
|
||||
@GetResource(name = "新增角色界面", path = "/view/role/add")
|
||||
public String roleAdd() {
|
||||
return "/modular/system/role/role_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑角色界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 20:57
|
||||
*/
|
||||
@GetResource(name = "编辑角色界面", path = "/view/role/edit")
|
||||
public String roleEdit() {
|
||||
return "/modular/system/role/role_edit.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数据范围界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/8 20:57
|
||||
*/
|
||||
@GetResource(name = "修改数据范围界面", path = "/view/role/editDataScope")
|
||||
public String roleEditDataScope() {
|
||||
return "/modular/system/role/role_edit_data_scope.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配接口界面
|
||||
*
|
||||
* @author majianguo
|
||||
* @date 2021/1/9 11:43
|
||||
*/
|
||||
@GetResource(name = "分配接口界面", path = "/view/role/assignApi")
|
||||
public String roleAssignApi() {
|
||||
return "/modular/system/role/role_assign_api.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配菜单和按钮界面
|
||||
*
|
||||
* @author majianguo
|
||||
* @date 2021/1/9 11:45
|
||||
*/
|
||||
@GetResource(name = "分配菜单界面", path = "/view/role/assignMenuAndButtons")
|
||||
public String roleAssignMenuButton() {
|
||||
return "/modular/system/role/role_assign_menu_button.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.timer;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 定时控制器
|
||||
*
|
||||
* @author youyongkun
|
||||
* @date 2021/1/6 3:56 下午
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "定时管理相关的界面渲染")
|
||||
public class TimersViewController {
|
||||
|
||||
/**
|
||||
* 定时管理-首页-视图
|
||||
*
|
||||
* @author youyongkun
|
||||
* @date 2021/1/6 4:28 下午
|
||||
*/
|
||||
@GetResource(name = "定时管理-首页-视图", path = "/view/sysTimers")
|
||||
public String indexView() {
|
||||
return "/modular/system/timers/timers.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时管理-添加-视图
|
||||
*
|
||||
* @author youyongkun
|
||||
* @date 2021/1/6 4:28 下午
|
||||
*/
|
||||
@GetResource(name = "定时管理-添加-视图", path = "/view/sysTimers/addView")
|
||||
public String addView() {
|
||||
return "/modular/system/timers/timers_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 定时管理-修改-视图
|
||||
*
|
||||
* @author youyongkun
|
||||
* @date 2021/1/6 4:28 下午
|
||||
*/
|
||||
@GetResource(name = "定时管理-修改-视图", path = "/view/sysTimers/editView")
|
||||
public String editView() {
|
||||
return "/modular/system/timers/timers_edit.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
package cn.stylefeng.guns.modular.system.user;
|
||||
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* 用户管理控制器
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/7 19:09
|
||||
*/
|
||||
@Controller
|
||||
@ApiResource(name = "用户管理界面渲染")
|
||||
public class UserViewController {
|
||||
|
||||
/**
|
||||
* 用户管理-首页-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/7 19:09
|
||||
*/
|
||||
@GetResource(name = "用户管理-首页-视图", path = "/view/user")
|
||||
public String indexView() {
|
||||
return "/modular/system/user/user.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户管理—新增-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/7 19:09
|
||||
*/
|
||||
@GetResource(name = "用户管理—新增-视图", path = "/view/user/addView")
|
||||
public String addView() {
|
||||
return "/modular/system/user/user_add.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户管理_修改_视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/7 19:09
|
||||
*/
|
||||
@GetResource(name = "用户管理-修改-视图", path = "/view/user/editView")
|
||||
public String editView() {
|
||||
return "/modular/system/user/user_edit.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户管理-角色-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/7 19:09
|
||||
*/
|
||||
@GetResource(name = "用户管理-角色-视图", path = "/view/user/roleView")
|
||||
public String roleView() {
|
||||
return "/modular/system/user/user_role.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户管理-注册-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/7 19:09
|
||||
*/
|
||||
@GetResource(name = "用户管理-注册-视图", path = "/register", requiredPermission = false, requiredLogin = false)
|
||||
public String registerView() {
|
||||
return "/register.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户管理-找回密码-视图
|
||||
*
|
||||
* @author chenjinlong
|
||||
* @date 2021/1/7 19:09
|
||||
*/
|
||||
@GetResource(name = "用户管理-找回密码-视图", path = "/forget", requiredPermission = false, requiredLogin = false)
|
||||
public String forgetView() {
|
||||
return "/forget.html";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package cn.stylefeng.guns.modular.system.datasource.test;
|
||||
package cn.stylefeng.guns.modular.test;
|
||||
|
||||
import cn.stylefeng.guns.modular.system.datasource.test.service.TranTestService;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.system.integration.modular.system.datasource.test.service.TranTestService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
|
@ -1,9 +1,9 @@
|
|||
package cn.stylefeng.guns.modular.system.datasource.test;
|
||||
package cn.stylefeng.guns.modular.test;
|
||||
|
||||
import cn.stylefeng.guns.modular.system.datasource.test.service.TranTestService;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.system.integration.modular.system.datasource.test.service.TranTestService;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.stylefeng.guns.modular.system.datasource.test.factory;
|
||||
package cn.stylefeng.guns.modular.test.factory;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser;
|
|
@ -1,7 +1,7 @@
|
|||
package cn.stylefeng.guns.modular.system.datasource.test.service;
|
||||
package cn.stylefeng.guns.modular.test.service;
|
||||
|
||||
import cn.stylefeng.guns.modular.system.datasource.test.factory.NormalUserFactory;
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.annotation.DataSource;
|
||||
import cn.stylefeng.roses.kernel.system.integration.modular.system.datasource.test.factory.NormalUserFactory;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.mapper.SysUserMapper;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService;
|
|
@ -1,7 +1,7 @@
|
|||
package cn.stylefeng.guns.modular.system.datasource.test.service;
|
||||
package cn.stylefeng.guns.modular.test.service;
|
||||
|
||||
import cn.stylefeng.guns.modular.system.datasource.test.factory.NormalUserFactory;
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.annotation.DataSource;
|
||||
import cn.stylefeng.roses.kernel.system.integration.modular.system.datasource.test.factory.NormalUserFactory;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.mapper.SysUserMapper;
|
||||
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService;
|
|
@ -1,6 +1,8 @@
|
|||
package cn.stylefeng.guns.modular.system.datasource.test.service;
|
||||
package cn.stylefeng.guns.modular.test.service;
|
||||
|
||||
import cn.stylefeng.guns.modular.system.datasource.test.factory.NormalUserFactory;
|
||||
import cn.stylefeng.roses.kernel.system.integration.modular.system.datasource.test.factory.NormalUserFactory;
|
||||
import cn.stylefeng.roses.kernel.system.integration.modular.system.datasource.test.service.GunsDbService;
|
||||
import cn.stylefeng.roses.kernel.system.integration.modular.system.datasource.test.service.OtherDbService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
Loading…
Reference in New Issue