2. 数据
appId:
JingXuanXcx // 联华鲸选微信小程序 JingXuanAlipay // 联华鲸选支付宝小程序 JingXuanSyDt // 市医钉钉 JingXuanLcH5 // 绿城H5 NewJingXuanAPp // 鲸选app LhGroupBuyApp // 团购app zhcsWeiXinXcx // 振华微信小程序
4. 开发规约
-
controller implement open-api
-
禁止使用BeanUtils.copyProperties()进行属性转换操作,现在的此类操作在后续版本迭代中会逐步剔除。
-
使用redis缓存时,禁止直接操作redisTemplate,所有的操作通过IRedisCacheMgr进行
-
接口实现遵循 controller→ service → adapter 的操作逻辑,复杂的adapter,使用多helper类的方式进行方法拆分
-
adapter 需实现IAdapter接口以便于AppAdminController进行监控,adapter需要读取yml的配置同一个通过@Autowired AdapterProperties 进行注入,禁止使用@Value进行取值
-
关于@AppAdapterComponent注解的使用,该注解集成了@Component以及@Conditional,功能描述为,指定某个adapter的供应商,以及默认供应商,jar启动时,根据供应商配置选择性地初始化bean。
@AppAdapterComponent(adapter = AppAdapter.account, vendor = {
AppAdapterVendor.defaults })
public class DefaultsAccountAdapter implements IAccountAdapter{
@Autowired
private AdapterProperties properties;
}
public interface IAccountAdapter extends IAdapter {}
4.1. adapter与AdapterProperties的关于yml配置。
-
AdapterProperties的属性为adapter的名字,要求继承AdapterBaseProps,包含vendor属性,值默认为defaults,当默认时,yml中可省略配置
yml 配置
app-adapter:
account:
wxAgent:
appId: xxx
secret: xxx
username: xxx
password: xxx