Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions script/soul.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ DROP TABLE IF EXISTS `plugin`;
CREATE TABLE `plugin` (
`id` varchar(128) NOT NULL COMMENT '主键id',
`name` varchar(62) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '插件名称',
`enable` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否开启(0,未开启,1开启)',
`enabled` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否开启(0,未开启,1开启)',
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
`date_updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
PRIMARY KEY (`id`)
Expand Down Expand Up @@ -121,13 +121,13 @@ CREATE TABLE `selector_condition` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*plugin*/
INSERT INTO `soul`.`plugin` (`id`, `name`, `enable`, `date_created`, `date_updated`) VALUES ('1', 'sign', '0', '2018-06-14 10:17:35', '2018-06-14 10:17:35');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enable`, `date_created`, `date_updated`) VALUES ('2', 'waf', '0', '2018-06-23 10:26:30', '2018-06-13 15:43:10');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enable`, `date_created`, `date_updated`) VALUES ('3', 'rewrite', '0', '2018-06-23 10:26:34', '2018-06-25 13:59:31');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enable`, `date_created`, `date_updated`) VALUES ('4', 'rate_limiter', '0', '2018-06-23 10:26:37', '2018-06-13 15:34:48');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enable`, `date_created`, `date_updated`) VALUES ('5', 'divide', '1', '2018-06-25 10:19:10', '2018-06-13 13:56:04');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enable`, `date_created`, `date_updated`) VALUES ('6', 'dubbo', '0', '2018-06-23 10:26:41', '2018-06-11 10:11:47');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enable`, `date_created`, `date_updated`) VALUES ('7', 'monitor', '0', '2018-06-25 13:47:57', '2018-06-25 13:47:57');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enabled`, `date_created`, `date_updated`) VALUES ('1', 'sign', '0', '2018-06-14 10:17:35', '2018-06-14 10:17:35');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enabled`, `date_created`, `date_updated`) VALUES ('2', 'waf', '0', '2018-06-23 10:26:30', '2018-06-13 15:43:10');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enabled`, `date_created`, `date_updated`) VALUES ('3', 'rewrite', '0', '2018-06-23 10:26:34', '2018-06-25 13:59:31');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enabled`, `date_created`, `date_updated`) VALUES ('4', 'rate_limiter', '0', '2018-06-23 10:26:37', '2018-06-13 15:34:48');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enabled`, `date_created`, `date_updated`) VALUES ('5', 'divide', '1', '2018-06-25 10:19:10', '2018-06-13 13:56:04');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enabled`, `date_created`, `date_updated`) VALUES ('6', 'dubbo', '0', '2018-06-23 10:26:41', '2018-06-11 10:11:47');
INSERT INTO `soul`.`plugin` (`id`, `name`, `enabled`, `date_created`, `date_updated`) VALUES ('7', 'monitor', '0', '2018-06-25 13:47:57', '2018-06-25 13:47:57');

/**user**/
INSERT INTO `soul`.`dashboard_user` (`id`, `user_name`, `password`, `role`, `enabled`, `date_created`, `date_updated`) VALUES ('1', 'admin', '123456', '1', '1', '2018-06-23 15:12:22', '2018-06-23 15:12:23');
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* soul start.
*
* @author xiaoyu
* @author xiaoyu(Myth)
*/
@SpringBootApplication
@ComponentScan("org.dromara.soul")
Expand All @@ -42,4 +42,4 @@ public class SoulAdminApplication {
public static void main(final String[] args) {
SpringApplication.run(SoulAdminApplication.class, args);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* web handler.
*
* @author xiaoyu
* @author xiaoyu(Myth)
*/
@Configuration
public class WebConfig implements WebFluxConfigurer {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.dromara.soul.admin.controller;

import org.dromara.soul.admin.page.CommonPager;
import org.dromara.soul.admin.page.PageParameter;
import org.dromara.soul.admin.query.PluginQuery;
import org.dromara.soul.admin.service.PluginService;
import org.dromara.soul.admin.vo.PluginVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
* this is plugin controller.
*
* @author jiangxiaofeng(Nicholas)
*/
@RestController
@RequestMapping("/plugin")
public class PluginController {

@Autowired
private PluginService pluginService;

/**
* query plugins.
*
* @param currentPage current page
* @param pageSize page szie
* @return {@linkplain Mono}
*/
@GetMapping("")
public Mono<CommonPager<PluginVO>> queryPlugins(final Integer currentPage, final Integer pageSize) {
return Mono.create(commonPager -> commonPager.success(pluginService.listByPage(
new PluginQuery(new PageParameter(currentPage, pageSize)))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@
/**
* this is application authority from by web front.
*
* @author xiaoyu(549477611 @ qq.com)
* @author xiaoyu(Myth)
*/
@Data
public class AppAuthDTO implements Serializable {

/**
* primary key
* primary key.
*/
private String id;

/**
* application key
* application key.
*/
private String appKey;

/**
* encryption secret
* encryption secret.
*/
private String appSecret;

/**
* whether enabled
* whether enabled.
*/
private Boolean enabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@
/**
* this is dashboard user from by web front.
*
* @author jiangxiaofeng(programgeek @ 163.com)
* @author jiangxiaofeng(Nicholas)
*/
@Data
public class DashboardUserDTO implements Serializable {

/**
* primary key
* primary key.
*/
private String id;

/**
* user name
* user name.
*/
private String userName;

/**
* user password
* user password.
*/
private String password;

/**
* dashboard role
* dashboard role.
*/
private Integer role;

/**
* whether enabled
* whether enabled.
*/
private Boolean enabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@
/**
* this is plugin from by web front.
*
* @author jiangxiaofeng(programgeek @ 163.com)
* @author jiangxiaofeng(Nicholas)
*/
@Data
public class PluginDTO implements Serializable {

/**
* primary key
* primary key.
*/
private String id;

/**
* plugin name
* plugin name.
*/
private String name;

/**
* whether enabled
* whether enabled.
*/
private Boolean enabled;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@
/**
* this is rule condition from by web front.
*
* @author jiangxiaofeng(programgeek @ 163.com)
* @author jiangxiaofeng(Nicholas)
*/
@Data
public class RuleConditionDTO implements Serializable {

/**
* primary key
* primary key.
*/
private String id;

/**
* rule id
* rule id.
*/
private String ruleId;

/**
* parameter type
* parameter type.
*/
private String paramType;

/**
* match operator
* match operator.
*/
private String operator;

/**
* parameter name
* parameter name.
*/
private String paramName;

/**
* parameter value
* parameter value.
*/
private String paramValue;
}
}
20 changes: 10 additions & 10 deletions soul-admin/src/main/java/org/dromara/soul/admin/dto/RuleDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,48 +26,48 @@
/**
* this is rule from by web front.
*
* @author jiangxiaofeng(programgeek @ 163.com)
* @author jiangxiaofeng(Nicholas)
*/
@Data
public class RuleDTO implements Serializable {

/**
* primary key
* primary key.
*/
private String id;

/**
* selector id
* selector id.
*/
private String selectorId;

/**
* match mode
* match mode.
*/
private Integer matchMode;

/**
* rule name
* rule name.
*/
private String name;

/**
* whether enabled
* whether enabled.
*/
private Boolean enabled;

/**
* whether loged
* whether loged.
*/
private Boolean loged;

/**
* process logic
* process logic.
*/
private String handle;

/**
* rule conditions
* rule conditions.
*/
private List<RuleConditionDTO> ruleConditions;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,38 @@
/**
* this is selector condition from by web front.
*
* @author jiangxiaofeng(programgeek @ 163.com)
* @author jiangxiaofeng(Nicholas)
*/
@Data
public class SelectorConditionDTO implements Serializable {

/**
* primary key
* primary key.
*/
private String id;

/**
* selector id
* selector id.
*/
private String selectorId;

/**
* parameter type
* parameter type.
*/
private String paramType;

/**
* match operator
* match operator.
*/
private String operator;

/**
* parameter name
* parameter name.
*/
private String paramName;

/**
* parameter value
* parameter value.
*/
private String paramValue;
}
}
Loading