GithubHelp home page GithubHelp logo

gd-configurer's Introduction

狗带配置中心

主要功能

  • 以简单为核心**
  • 主要是使用mysql存储
  • 接口全部采用标准restful 接口
  • 支持配置文件上传解析
  • 使用内嵌undertow servlet容器

实现技术

  • 数据库连接池 druid
  • json解析 jackson
  • web容器 undertow

安装到本地

git https://github.com/goudai/gd-configurer.git
cd gd-configurer
mvn clean install

启动

修改 io.goudai.configurer.gateway.Main 中的Datasource数据库url,账户,密码,安全码等

spring 集成

  <dependency>
    <groupId>io.goudai</groupId>
    <artifactId>gd-configurer-spring</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
  
   <bean class="io.goudai.spring.GoudaiConfigurer">
	  <property name="appName" value="你的项目名称"/>
	  <property name="server" value="http://goudai服务器地址"/>
	  <property name="port" value="服务器端口"/>
   </bean>

restful api 一览

返回对象定义

public class R {
	private int code;
	private String msg; //异常信息描述
	private Object result;

	public static interface C {
		
		int S = 200, 
		BF = 300, //业务异常
		SF = 500; //服务器异常

	}

	public static interface M {
		String S = "SUCCESS";
		String F = "FAILED";
	}
}

登录注册接口

  • 这个接口处理 登录注册(采用header头验证 Authorization:token)
方法 api requestBody 描述
get / no body 返回注册登录提示
post / username,password 登录接口
post /sessions username,password,security_code 注册接口,安全码是为了验证是系统用户

apps 接口

  • 注意 request body 一般使用body的形式 不推荐使用url拼接
方法 api requestBody 描述
get /apps 返回所有的应用列表
post /apps app_name 新增一个应用
delete /apps app_name 删除一个应用,注意这里会级联删除配置
put /apps app_name,new_app_name 修改一个应用的名称,将级联修改配置

configs 接口

方法 api requestBody 描述
get /configs/${app_name} 返回指定应用的配置信息
post /configs app_name,key,value 为应用添加一个配置
delete /configs app_name,key 删除一个应用的配置
put /configs app_name,key,value 修改一个应用的配置

file 接口

  • 这个接口处理 properties
方法 api requestBody 描述
post /files app_name,file 通过文件上传的形式添加配置

##TODO *鉴权 *web 页面控制台

gd-configurer's People

Contributors

qingmu-io avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.