2020-10-22 03:41:14 +00:00
|
|
|
|
> phoenix基础工程脚手架
|
|
|
|
|
|
|
|
|
|
>> package分层
|
|
|
|
|
|
|
|
|
|
>>> UserController OrderController PayController
|
|
|
|
|
|
|
|
|
|
>>>> 该层有统一的RequestBody和ResponseBody的切面操作,主要用于请求报文解密和响应报文加密
|
|
|
|
|
|
|
|
|
|
>>> UserService MemeberService GoodsService StockService
|
|
|
|
|
|
|
|
|
|
>>> GlobalManager(Cache,ExternalSystem Interface)
|
|
|
|
|
|
|
|
|
|
>>> Manager层编写规范
|
|
|
|
|
>>>> 增
|
|
|
|
|
>>>>> saveXXX,返回int,标明该方法影响的行数;传参对象实体或List
|
|
|
|
|
|
|
|
|
|
>>>> 删
|
|
|
|
|
>>>>> deleteXXX,返回int,标明该方法影响的行数;传参具体条件
|
|
|
|
|
|
|
|
|
|
>>>> 改
|
|
|
|
|
>>>>> updateXXX,返回int,标明该方法影响的函数;传参对象实体
|
|
|
|
|
|
|
|
|
|
>>>> 查
|
|
|
|
|
>>>>> findXXX,返回对象实体或List;传参具体条件
|
|
|
|
|
|
|
|
|
|
>>>> 按照上述规范的方法可以加缓存注解进行统一缓存处理,List暂不做缓存处理,不满足上述规范的方法未必可行
|
|
|
|
|
|
|
|
|
|
>>> 缓存统一处理逻辑,参照MyCacheInterceptor
|
|
|
|
|
|
|
|
|
|
>>>> Manager层收口,也是为了后续数据层服务化提前做好准备
|
|
|
|
|
|
|
|
|
|
>>>> 可单独打包出数据层服务源码jar,使用data-install.sh脚本
|
|
|
|
|
|
|
|
|
|
>>> UserDAO GoodsDAO OrderDAO BillDAO
|
|
|
|
|
|
|
|
|
|
>>>> MYSQL DAO层使用了tk.mybatis,常用语句封装完善,只需要自定义复杂SQL即可, 具体参照com.cmcc.hy.phoenix.mapper.UserMappTest
|
|
|
|
|
|
|
|
|
|
>> 接口层参数校验
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.controller.DemoController
|
|
|
|
|
|
|
|
|
|
>> 多个线程池
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.thread.ThreadPoolConfig的多个线程池定义
|
|
|
|
|
|
|
|
|
|
>> 轻量级定时任务
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.task.MyTask
|
|
|
|
|
|
|
|
|
|
>> 异步调用
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.service.impl.AsyncServiceImpl
|
|
|
|
|
|
|
|
|
|
>> AOP自定义切面
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.aop.MyInterceptor
|
|
|
|
|
|
|
|
|
|
>> 前后端交互统一数据格式
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.vo.MyResp,com.cmcc.hy.phoenix.vo.Resp
|
|
|
|
|
|
|
|
|
|
>> 自定义配置加载
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.config.MyConfig
|
|
|
|
|
|
|
|
|
|
>> 基于redis的分布式锁
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.task.MyTask
|
|
|
|
|
|
|
|
|
|
>> MOCK单元测试
|
|
|
|
|
>>> 参照test package
|
|
|
|
|
|
|
|
|
|
>> Swagger API
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.controller.TestController.postTest()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
> 常用工具
|
|
|
|
|
|
|
|
|
|
>> 哈希加解密(AesCBC,AesECB,Des,3Des,Hmac,Md5,RsaECB,Sha1,Sha256,Sha512),具体用法见源码
|
|
|
|
|
|
|
|
|
|
>> 正则表达式,常用正则
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.common.PatternUtil
|
|
|
|
|
|
|
|
|
|
>> 日期操作
|
|
|
|
|
>>> 参照com.cmcc.hy.phoenix.common.DateUtil
|
|
|
|
|
>>> hutool依赖,各种常用工具
|
|
|
|
|
|
|
|
|
|
>日志管理
|
|
|
|
|
>>logback,参照config/logback.xml
|
|
|
|
|
|
|
|
|
|
> 工程打包
|
|
|
|
|
|
|
|
|
|
>> 通过pom+assembly打出tgz,解压后的目录参照开源软件常规目录形式
|
|
|
|
|
|
|
|
|
|
>>> xxx.tgz
|
|
|
|
|
|
|
|
|
|
>>>> bin 工程启停脚本
|
|
|
|
|
|
|
|
|
|
>>>> config 工程应用配置,日志配置
|
|
|
|
|
|
|
|
|
|
>>>> lib 工程依赖
|
|
|
|
|
|
|
|
|
|
>>>> xxx.jar 工程执行jar包
|
|
|
|
|
|
|
|
|
|
>>>> banner.txt 自定义启动字符画
|
|
|
|
|
|
|
|
|
|
> 运维标准目录
|
|
|
|
|
>> 按照公司运维标准,把tgz包放到/apprun根目录下解压后运行即可
|
|
|
|
|
|
|
|
|
|
> clone该工程后,需要修改phoenix-boot名字的文件如下
|
|
|
|
|
|
|
|
|
|
>> pom.xml
|
|
|
|
|
|
|
|
|
|
>> assembly.xml
|
|
|
|
|
|
|
|
|
|
>> bin/log_clean.sh
|
|
|
|
|
|
|
|
|
|
>> bin/processor_check.sh
|
|
|
|
|
|
|
|
|
|
>> bin/start.sh
|
|
|
|
|
|
|
|
|
|
>> bin/stop.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
未完待续...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|