GithubHelp home page GithubHelp logo

pc-dong / app-provision Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 950 KB

A Provision System for APP

Java 70.61% Dockerfile 0.17% Shell 1.17% JavaScript 0.25% HTML 0.13% Vue 14.09% TypeScript 13.10% CSS 0.48%

app-provision's Introduction

简介

该项目是一个提供了APP端动态配置,配置端和C端动态圈人能力的简化系统。

基于Smart Domain方法设计和开发。

技术栈

  • Java 17
  • Spring Web Flux
  • RSocket
  • Spring Data
  • Couchbase
  • caffeine

分层

  • API层(api): 提供对外API接口
  • 领域模型层(domain): 领域模型对象及抽象接口
    • 持久化层(persistence):提供domain层抽象接口实现

模型

主要模型概念解释

  • Configuration - 配置,支持不同业务场景(通过type区分场景),不同场景中的配置数据(data)结构可变
  • CustomerCriteriaCondition - 圈人条件
    • WhiteListCondition - 白名单圈人条件(可改成远程接口调用从而支持动态白名单圈人)
    • LocationCondition - 地理位置圈人条件(基于省市区地理位置编码,例如西安-610100)
    • ABTestingCondition - AB测试分组圈人条件
  • Configurations - 配置集合
  • Customer - 客户端用户
  • CustomerConfigurations - 用户可见配置集合
  • CustomerCriteriaResults - 用户圈人圈人结果集合
  • Matcher - 圈人条件解析器
    • WhiteListConditionMatcher - 白名单圈人条件解析器
    • LocationConditionMatcher - 地理位置圈人条件解析器
    • ABTestingConditionMatcher - AB测试圈人条件解析器
  • ConfigurationDiffer - 结合app缓存能力提供按照数据版本返回有更新部分数据,基于CustomerConfigurations和数据版本计算更新结果
    • FullDiffer - 返回更新后的全量数据(有更新时APP端全量替换本地配置)
    • IncrementalDiffer - 返回更新的增量量数据(有更新时APP端增量替换本地配置)

运行命令

启动数据库

docker-compose up -d

编译

./gradlew build

可执行jar目录 ./main/build/libs/main.jar

Run

./gradlew bootRun

RSocket命令行请求样例

> rsc --route=customer-configurations.diff --channel -m '{"customerId": "111","adCode":"610101","customerLevel":"VIP"}' --mmt application/json  --dmt application/json --data=- tcp://localhost:7001

> {"type":"FULL_TEST"}
{"type":"FULL_TEST","differResult":{"hasUpdate":false,"useDefault":false,"content":null,"version":null}}
> {"type":"INCR_TEST"}
{"type":"INCR_TEST","differResult":{"hasUpdate":false,"useDefault":false,"content":null,"version":null}}

app-provision's People

Contributors

pc-dong avatar

Watchers

 avatar  avatar

Forkers

aqiusen

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.