Feat:元信息施工中

This commit is contained in:
wangyu 2021-01-09 11:04:42 +08:00
parent 7ad289e0a5
commit 7ef112775b
10 changed files with 1316 additions and 20 deletions

View File

@ -0,0 +1,32 @@
package com.flyfish.framework.annotations;
import java.lang.annotation.*;
/**
* bean的属性注解提供描述
*
* @author wangyu
*/
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Property {
/**
* 显示标题
* @return 结果
*/
String title() default "";
/**
* 被继承的用于父类自动拼接名称
* @return 结果
*/
boolean inherited() default false;
/**
* 是否只读
* @return 结果
*/
boolean readonly() default false;
}

View File

@ -1,5 +1,6 @@
package com.flyfish.framework.domain.base;
import com.flyfish.framework.annotations.Property;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedBy;
@ -24,18 +25,21 @@ public abstract class AuditDomain extends Domain {
* 创建日期
*/
@CreatedDate
@Property(title = "创建日期")
protected Date createTime;
/**
* 修改日期
*/
@LastModifiedDate
@Property(title = "更新日期")
protected Date modifyTime;
/**
* 创建者
*/
@CreatedBy
@Property(title = "创建人")
protected String creator;
/**
@ -47,6 +51,7 @@ public abstract class AuditDomain extends Domain {
* 修改者
*/
@LastModifiedBy
@Property(title = "更新人")
protected String modifier;
/**

View File

@ -1,5 +1,6 @@
package com.flyfish.framework.domain.base;
import com.flyfish.framework.annotations.Property;
import com.flyfish.framework.domain.po.User;
import lombok.Getter;
import lombok.Setter;
@ -25,11 +26,13 @@ public abstract class Domain implements Po, Serializable {
/**
* 编号
*/
@Property(title = "编码", inherited = true)
protected String code;
/**
* 名称
*/
@Indexed
@Property(title = "名称", inherited = true)
protected String name;
/**
* 上下文冗余利用内存缓存上下文

View File

@ -0,0 +1,620 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19H15</string>
<key>CFBundleExecutable</key>
<string>VoodooPS2Keyboard</string>
<key>CFBundleGetInfoString</key>
<string>2.2.0, Copyright Apple Computer, Inc. 2000-2003, RehabMan 2012-2013</string>
<key>CFBundleIdentifier</key>
<string>as.acidanthera.voodoo.driver.PS2Keyboard</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Voodoo PS/2 Keyboard</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2.2.0</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>12B45b</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>11.0</string>
<key>DTSDKBuild</key>
<string>20A2408</string>
<key>DTSDKName</key>
<string>macosx11.0</string>
<key>DTXcode</key>
<string>1220</string>
<key>DTXcodeBuild</key>
<string>12B45b</string>
<key>IOKitPersonalities</key>
<dict>
<key>ApplePS2Keyboard</key>
<dict>
<key>CFBundleIdentifier</key>
<string>as.acidanthera.voodoo.driver.PS2Keyboard</string>
<key>IOClass</key>
<string>ApplePS2Keyboard</string>
<key>IOProviderClass</key>
<string>ApplePS2KeyboardDevice</string>
<key>Platform Profile</key>
<dict>
<key>DELL</key>
<dict>
<key>Dell-Keys</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e005</string>
<string>e006</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>e020=3b</string>
<string>e02e=3c</string>
<string>e030=3d</string>
<string>e022=3e</string>
<string>;Fn+f5 macro</string>
<string>;Fn+f6 macro</string>
<string>;Fn+f7 macro</string>
<string>;Fn+f8 macro</string>
<string>;Fn+f9 macro</string>
<string>;Fn+f10 no code</string>
<string>e005=57</string>
<string>e006=58</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>3b=e020</string>
<string>3c=e02e</string>
<string>3d=e030</string>
<string>3e=e022</string>
<string>;Fn+f5 macro</string>
<string>;Fn+f6 macro</string>
<string>;Fn+f7 macro</string>
<string>;Fn+f8 macro</string>
<string>;Fn+f9 macro</string>
<string>;Fn+f10 no code</string>
<string>57=e005</string>
<string>58=e006</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>e020=e020</string>
<string>e02e=e02e</string>
<string>e030=e030</string>
<string>e022=e022</string>
<string>;Fn+f5 macro</string>
<string>;Fn+f6 macro</string>
<string>;Fn+f7 macro</string>
<string>;Fn+f8 macro</string>
<string>;Fn+f9 macro</string>
<string>;Fn+f10 no code</string>
<string>e005=e005</string>
<string>e006=e006</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
</dict>
<key>HSW-LPT</key>
<string>Dell-Keys</string>
<key>SNB-CPT</key>
<dict>
<key>ActionSwipeDown</key>
<string>63 d, 63 u</string>
<key>ActionSwipeUp</key>
<string>61 d, 61 u</string>
<key>Breakless PS2</key>
<array>
<string>e01e;Touchpad Fn+f3 is breakless</string>
<string>e06e;REVIEW: temporary for case that macro inversion does not work...</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e009=83;Dell Support to Launchpad</string>
<string>e0f1=71;Call brightens up w RKA1 for special mode (was =90)</string>
<string>e0f2=6b;Call brightens down w RKA2 for special mode (was =91)</string>
<string>e06e=70;Map vidmirror key for special mode default is adb90</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e01e=e037;Map tp disable to Fn+f3</string>
<string>e037=e01e;Prevent PrntScr from triggering tp disable</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>e06e=3b</string>
<string>e008=3c</string>
<string>e01e=3d</string>
<string>e005=3e</string>
<string>e006=3f</string>
<string>e00c=40</string>
<string>;Fn+f7 no dedicated macro</string>
<string>e010=42</string>
<string>e022=43</string>
<string>e019=44</string>
<string>e02e=57</string>
<string>e030=58</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>3b=e06e;Map vidmirror key to f1</string>
<string>3c=e0f0;Map radio toggle action from EC query to f2</string>
<string>3d=e037;Map touchpad toggle button to f3</string>
<string>3e=e0f2;Map acpi RKA2 to f4 brightness down</string>
<string>3f=e0f1;Map acpi RKA1 to f5 brightness up</string>
<string>40=e0f3;Map acpi RKA3 to f6 keyboard backlight</string>
<string>;Fn+f7 no macro</string>
<string>42=e010</string>
<string>43=e022</string>
<string>44=e019</string>
<string>57=e02e</string>
<string>58=e030</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>e06e=e06e;Fn+f1 macro translated</string>
<string>e008=e008;Fn+f2 regular scancode and EC query call q8c</string>
<string>e01e=e037;Fn+f3 regular scancode and EC controls LED</string>
<string>e005=e005;Fn+f4 no ps2scancode and EC query call q81</string>
<string>e006=e006;Fn+f5 no ps2scancode and EC query call q80</string>
<string>e00c=e00c;Fn+f6 no ps2scancode and EC query call q8a</string>
<string>;Fn+f7 no macro just regular f key</string>
<string>e010=e010; Fn+f8 regular scancode</string>
<string>e022=e022; Fn+f9 regular scancode</string>
<string>e019=e019;Fn+f10 regular scancode</string>
<string>e02e=e02e;Fn+f11 regular scancode</string>
<string>e030=e030;Fn+f12 regular scancode</string>
<string>;Fn+f13 is mute dedicated button that always produces e020 regardless of Fn</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
<key>Macro Inversion</key>
<array>
<string>;This section maps ps2 codes (packet format) received quickly (macros) into fake ps2 codes (packet format)</string>
<string>;Fn+F1</string>
<data>
//8CbgAAAAACWwEZ
</data>
<data>
//8C7gAAAAAC2wGZ
</data>
<data>
//8C7gAAAAABmQLb
</data>
</array>
<key>MaximumMacroTime</key>
<integer>35000000</integer>
<key>Note-Author</key>
<string>TimeWalker aka TimeWalker75a</string>
<key>Note-Comment</key>
<string>Keyboard Profile for DELL SandyBridge SecureCore Tiano based laptops (Vostro 3450 &amp; 3750, Inspiron N4110, XPS L502x &amp; L702x &amp; L511z)</string>
</dict>
<key>WN09</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e01b</string>
<string>e008</string>
<string>e01e</string>
<string>e005</string>
<string>e06e</string>
<string>e006</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e01b=70</string>
<string>e06e=83</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>56=2b</string>
<string>29=56</string>
<string>2b=29</string>
<string>e01e=e037</string>
<string>e037=e01e</string>
</array>
</dict>
<key>WN09a</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e01b</string>
<string>e008</string>
<string>e01e</string>
<string>e005</string>
<string>e06e</string>
<string>e006</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e01b=70</string>
<string>e06e=83</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e01e=e037</string>
<string>e037=e01e</string>
</array>
</dict>
</dict>
<key>Default</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>;Items must be strings in the form of breaklessscan (in hex)</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>;Items must be strings in the form of scanfrom=adbto (in hex)</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>;Items must be strings in the form of scanfrom=scanto (in hex)</string>
<string>e027=0;disable discrete fnkeys toggle</string>
<string>e028=0;disable discrete trackpad toggle</string>
</array>
<key>HIDF12EjectDelay</key>
<integer>250</integer>
<key>LogScanCodes</key>
<integer>0</integer>
<key>Make Application key into Apple Fn key</key>
<false/>
<key>Make Application key into right windows</key>
<true/>
<key>Make right modifier keys into Hangul and Hanja</key>
<false/>
<key>SleepPressTime</key>
<integer>0</integer>
<key>Swap capslock and left control</key>
<false/>
<key>Swap command and option</key>
<true/>
<key>Use ISO layout keyboard</key>
<false/>
<key>alt_handler_id</key>
<integer>3</integer>
</dict>
<key>HPQOEM</key>
<dict>
<key>1411</key>
<string>ProBook-102;ProBook 4520s</string>
<key>1619</key>
<string>ProBook-87;ProBook 6560b</string>
<key>161C</key>
<string>ProBook-87;ProBook 8460p</string>
<key>164F</key>
<string>ProBook-87;ProBook 5330m</string>
<key>167C</key>
<string>ProBook-102;ProBook 4530s</string>
<key>167E</key>
<string>ProBook-102;ProBook 4330s</string>
<key>1680</key>
<string>ProBook-102;ProBook 4230s</string>
<key>179B</key>
<string>ProBook-87;ProBook 6470b</string>
<key>179C</key>
<string>ProBook-87;ProBook 6470b</string>
<key>17A9</key>
<string>ProBook-87;ProBook 8570b</string>
<key>17F0</key>
<string>ProBook-102;ProBook 4340s</string>
<key>17F3</key>
<string>ProBook-102;ProBook 4440s</string>
<key>17F6</key>
<string>ProBook-102;ProBook 4540s</string>
<key>1942</key>
<string>ProBook-87;ProBook 450s G1</string>
<key>1949</key>
<string>ProBook-87;ProBook 450s G1</string>
<key>1962</key>
<string>Haswell-Envy;HP Envy 15-j063cl</string>
<key>1963</key>
<string>Haswell-Envy;HP Envy 15-j063cl</string>
<key>1965</key>
<string>Haswell-Envy;HP Envy 17t-j100</string>
<key>1966</key>
<string>Haswell-Envy;HP Envy 17t-j000</string>
<key>198F</key>
<string>ProBook-87;ProBook 450s G0</string>
<key>Haswell-Envy</key>
<dict>
<key>Custom ADB Map</key>
<array>
<string>e019=42;next</string>
<string>e010=4d;previous</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e045=e037</string>
<string>e0ab=0;bogus Fn+F2/F3</string>
</array>
</dict>
<key>ProBook-102</key>
<dict>
<key>Custom PS2 Map</key>
<array>
<string>e005=0</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>e05f=3b</string>
<string>e012=3c</string>
<string>e017=3d</string>
<string>e06e=3e</string>
<string>e00a=3f</string>
<string>e009=40</string>
<string>e020=41</string>
<string>e02e=42</string>
<string>e030=43</string>
<string>e010=44</string>
<string>e022=57</string>
<string>e019=58</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>3b=e05f</string>
<string>3c=e012</string>
<string>3d=e017</string>
<string>3e=e06e</string>
<string>3f=e00a</string>
<string>40=e009</string>
<string>41=e020</string>
<string>42=e02e</string>
<string>43=e030</string>
<string>44=e010</string>
<string>57=e022</string>
<string>58=e019</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>e05f=e05f</string>
<string>e012=e012</string>
<string>e017=e017</string>
<string>e06e=e06e</string>
<string>e00a=e00a</string>
<string>e009=e009</string>
<string>e020=e020</string>
<string>e02e=e02e</string>
<string>e030=e030</string>
<string>e010=e010</string>
<string>e022=e022</string>
<string>e019=e019</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
<key>SleepPressTime</key>
<integer>3000</integer>
</dict>
<key>ProBook-87</key>
<dict>
<key>Custom ADB Map</key>
<array>
<string>46=4d;scroll =&gt; Previous-track</string>
<string>e045=34;pause =&gt; Play-Pause</string>
<string>e052=42;insert =&gt; Next-track</string>
<string>e046=92;break =&gt; Eject</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e005=0</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 8 items map Fn+fkeys to fkeys</string>
<string>e05f=3d</string>
<string>e06e=3e</string>
<string>e02e=40</string>
<string>e030=41</string>
<string>e009=42</string>
<string>e012=43</string>
<string>e017=44</string>
<string>e033=57</string>
<string>;The following 8 items map fkeys to Fn+fkeys</string>
<string>3d=e05f</string>
<string>3e=e06e</string>
<string>40=e02e</string>
<string>41=e030</string>
<string>42=e037</string>
<string>43=e012</string>
<string>44=e017</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 8 items map Fn+fkeys to Fn+fkeys</string>
<string>e05f=e05f</string>
<string>e06e=e06e</string>
<string>e02e=e02e</string>
<string>e030=e030</string>
<string>e009=e009</string>
<string>e012=e012</string>
<string>e017=e017</string>
<string>e033=e033</string>
<string>;The following 8 items map fkeys to fkeys</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
</array>
<key>SleepPressTime</key>
<integer>3000</integer>
</dict>
</dict>
<key>Intel</key>
<dict>
<key>CALPELLA</key>
<string>SamsungKeys</string>
<key>SamsungKeys</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e003</string>
<string>e002</string>
<string>e004</string>
<string>e020</string>
<string>;e031</string>
<string>e033</string>
<string>e006</string>
<string>e077</string>
<string>e079</string>
<string>e008</string>
<string>e009</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e002=70</string>
<string>e006=80</string>
<string>e008=71 (was =90)</string>
<string>e009=6b (was =91)</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>;fn+f1 no code</string>
<string>e003=3c</string>
<string>;fn+f3 weird code</string>
<string>e002=3e</string>
<string>e004=3f</string>
<string>e020=40</string>
<string>e031=41</string>
<string>e033=42</string>
<string>e006=43</string>
<string>;fn+f10 weird code</string>
<string>;fn+f11 no code</string>
<string>;fn+f12 scrolllock</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>;fn+f1 no code</string>
<string>3c=e003</string>
<string>;fn+f3 weird code</string>
<string>3e=e002</string>
<string>3f=e004</string>
<string>40=e020</string>
<string>41=e031</string>
<string>42=e033</string>
<string>43=e006</string>
<string>;fn+f10 weird code</string>
<string>;fn+f11 no code</string>
<string>;fn+f12 scrolllock</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>;fn+f1 no code</string>
<string>e003=e003</string>
<string>;fn+f3 weird code</string>
<string>e002=e002</string>
<string>e004=e004</string>
<string>e020=e020</string>
<string>e031=e031</string>
<string>e033=e033</string>
<string>e006=e006</string>
<string>;fn+f10 weird code</string>
<string>;fn+f11 no code</string>
<string>;fn+f12 scrolllock</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
</dict>
</dict>
<key>SECCSD</key>
<dict>
<key>LH43STAR</key>
<string>SamsungKeys</string>
<key>SamsungKeys</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e020</string>
<string>e02e</string>
<string>e030</string>
</array>
</dict>
</dict>
</dict>
</dict>
</dict>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<key>OSBundleLibraries</key>
<dict>
<key>as.acidanthera.voodoo.driver.PS2Controller</key>
<string>2.2.0</string>
<key>com.apple.iokit.IOHIDFamily</key>
<string>1.0.0b1</string>
<key>com.apple.kpi.bsd</key>
<string>8.0.0</string>
<key>com.apple.kpi.iokit</key>
<string>8.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0.0</string>
<key>com.apple.kpi.mach</key>
<string>8.0.0</string>
<key>com.apple.kpi.unsupported</key>
<string>8.0.0</string>
</dict>
<key>OSBundleRequired</key>
<string>Console</string>
</dict>
</plist>

View File

@ -33,7 +33,7 @@ public class BeanController {
return Result.ok(Collections.emptyList());
}
try {
return Result.ok(BeanProperty.from(BeanUtils.getPropertyDescriptors(ClassUtils.getClass(className))));
return Result.ok(BeanProperty.from(ClassUtils.getClass(className)));
} catch (ClassNotFoundException e) {
log.error(e.getMessage(), e);
return Result.error(e.getMessage());

View File

@ -1,10 +1,11 @@
package com.flyfish.framework.beans.meta;
import com.flyfish.framework.beans.annotations.RestBean;
import lombok.Data;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.springframework.beans.BeanUtils;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@ -37,10 +38,11 @@ public class BeanProperty {
*
* @return 结果
*/
public static List<BeanProperty> from(PropertyDescriptor[] descriptors) {
public static List<BeanProperty> from(Class<?> clazz) {
PropertyDescriptor[] descriptors = BeanUtils.getPropertyDescriptors(clazz);
return Arrays.stream(descriptors)
.filter(descriptor -> !"class".equals(descriptor.getName()))
.map(BeanProperty::form)
.map(descriptor -> BeanProperty.form(descriptor, clazz))
.collect(Collectors.toList());
}
@ -51,16 +53,16 @@ public class BeanProperty {
* @param descriptor 解释器
* @return 结果
*/
public static BeanProperty form(PropertyDescriptor descriptor) {
Class<?> clazz = descriptor.getPropertyType();
public static BeanProperty form(PropertyDescriptor descriptor, Class<?> beanClass) {
BeanProperty property = new BeanProperty();
property.setName(descriptor.getName());
property.setType(BeanPropertyType.of(descriptor));
property.setType(BeanPropertyType.of(descriptor, beanClass));
Class<?> clazz = descriptor.getPropertyType();
if (property.getType() == BeanPropertyType.OBJECT) {
Field field = FieldUtils.getDeclaredField(beanClass, property.getName());
// 有子bean注解才处理
if (clazz.isAnnotationPresent(SubBean.class)) {
List<BeanProperty> children = from(BeanUtils.getPropertyDescriptors(clazz));
property.setChildren(children);
if (null != field && field.isAnnotationPresent(SubBean.class)) {
property.setChildren(from(clazz));
}
} else if (property.getType() == BeanPropertyType.DB_REF) {
// 当存在db-ref时解析为动态数据源

View File

@ -1,15 +1,17 @@
package com.flyfish.framework.beans.meta;
import com.flyfish.framework.beans.annotations.RestBean;
import com.flyfish.framework.domain.base.Domain;
import lombok.Getter;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.springframework.data.mongodb.core.mapping.DBRef;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.function.Predicate;
import java.util.function.BiPredicate;
/**
* bean属性的类型
@ -26,13 +28,15 @@ public enum BeanPropertyType {
DATE("Date", Date.class),
ENUM("Enum", Enum.class),
LIST("Array", Collection.class),
DB_REF("Ref", descriptor -> {
DB_REF("Ref", (descriptor, beanClass) -> {
Class<?> clazz = descriptor.getPropertyType();
return Domain.class.isAssignableFrom(clazz) && clazz.isAnnotationPresent(RestBean.class);
Field field = FieldUtils.getDeclaredField(beanClass, descriptor.getName());
return null != field && field.isAnnotationPresent(DBRef.class) &&
Domain.class.isAssignableFrom(clazz) && clazz.isAnnotationPresent(RestBean.class);
}),
OBJECT("Object", Object.class);
private final Predicate<PropertyDescriptor> acceptor;
private final BiPredicate<PropertyDescriptor, Class<?>> acceptor;
BeanPropertyType(String name, Class<?>... classes) {
this.name = name;
@ -44,16 +48,16 @@ public enum BeanPropertyType {
private final List<Class<?>> classes;
BeanPropertyType(String name, Predicate<PropertyDescriptor> predicate) {
BeanPropertyType(String name, BiPredicate<PropertyDescriptor, Class<?>> predicate) {
this.name = name;
this.classes = null;
this.acceptor = predicate;
}
public static BeanPropertyType of(PropertyDescriptor descriptor) {
public static BeanPropertyType of(PropertyDescriptor descriptor, Class<?> clazz) {
for (BeanPropertyType type : values()) {
if (null != type.classes && type.classes.stream().anyMatch(item -> item.isAssignableFrom(descriptor.getPropertyType())) ||
null != type.acceptor && type.acceptor.test(descriptor)) {
null != type.acceptor && type.acceptor.test(descriptor, clazz)) {
return type;
}
}

View File

@ -0,0 +1,616 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>19G2021</string>
<key>CFBundleExecutable</key>
<string>VoodooPS2Keyboard</string>
<key>CFBundleGetInfoString</key>
<string>2.1.7, Copyright Apple Computer, Inc. 2000-2003, RehabMan 2012-2013</string>
<key>CFBundleIdentifier</key>
<string>as.acidanthera.voodoo.driver.PS2Keyboard</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Voodoo PS/2 Keyboard</string>
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>2.1.7</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2.1.7</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>10G8</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>18G74</string>
<key>DTSDKName</key>
<string>macosx10.14</string>
<key>DTXcode</key>
<string>1030</string>
<key>DTXcodeBuild</key>
<string>10G8</string>
<key>IOKitPersonalities</key>
<dict>
<key>ApplePS2Keyboard</key>
<dict>
<key>CFBundleIdentifier</key>
<string>as.acidanthera.voodoo.driver.PS2Keyboard</string>
<key>IOClass</key>
<string>ApplePS2Keyboard</string>
<key>IOProviderClass</key>
<string>ApplePS2KeyboardDevice</string>
<key>Platform Profile</key>
<dict>
<key>DELL</key>
<dict>
<key>Dell-Keys</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e005</string>
<string>e006</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>e020=3b</string>
<string>e02e=3c</string>
<string>e030=3d</string>
<string>e022=3e</string>
<string>;Fn+f5 macro</string>
<string>;Fn+f6 macro</string>
<string>;Fn+f7 macro</string>
<string>;Fn+f8 macro</string>
<string>;Fn+f9 macro</string>
<string>;Fn+f10 no code</string>
<string>e005=57</string>
<string>e006=58</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>3b=e020</string>
<string>3c=e02e</string>
<string>3d=e030</string>
<string>3e=e022</string>
<string>;Fn+f5 macro</string>
<string>;Fn+f6 macro</string>
<string>;Fn+f7 macro</string>
<string>;Fn+f8 macro</string>
<string>;Fn+f9 macro</string>
<string>;Fn+f10 no code</string>
<string>57=e005</string>
<string>58=e006</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>e020=e020</string>
<string>e02e=e02e</string>
<string>e030=e030</string>
<string>e022=e022</string>
<string>;Fn+f5 macro</string>
<string>;Fn+f6 macro</string>
<string>;Fn+f7 macro</string>
<string>;Fn+f8 macro</string>
<string>;Fn+f9 macro</string>
<string>;Fn+f10 no code</string>
<string>e005=e005</string>
<string>e006=e006</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
</dict>
<key>HSW-LPT</key>
<string>Dell-Keys</string>
<key>SNB-CPT</key>
<dict>
<key>ActionSwipeDown</key>
<string>63 d, 63 u</string>
<key>ActionSwipeUp</key>
<string>61 d, 61 u</string>
<key>Breakless PS2</key>
<array>
<string>e01e;Touchpad Fn+f3 is breakless</string>
<string>e06e;REVIEW: temporary for case that macro inversion does not work...</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e009=83;Dell Support to Launchpad</string>
<string>e0f1=71;Call brightens up w RKA1 for special mode (was =90)</string>
<string>e0f2=6b;Call brightens down w RKA2 for special mode (was =91)</string>
<string>e06e=70;Map vidmirror key for special mode default is adb90</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e01e=e037;Map tp disable to Fn+f3</string>
<string>e037=e01e;Prevent PrntScr from triggering tp disable</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>e06e=3b</string>
<string>e008=3c</string>
<string>e01e=3d</string>
<string>e005=3e</string>
<string>e006=3f</string>
<string>e00c=40</string>
<string>;Fn+f7 no dedicated macro</string>
<string>e010=42</string>
<string>e022=43</string>
<string>e019=44</string>
<string>e02e=57</string>
<string>e030=58</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>3b=e06e;Map vidmirror key to f1</string>
<string>3c=e0f0;Map radio toggle action from EC query to f2</string>
<string>3d=e037;Map touchpad toggle button to f3</string>
<string>3e=e0f2;Map acpi RKA2 to f4 brightness down</string>
<string>3f=e0f1;Map acpi RKA1 to f5 brightness up</string>
<string>40=e0f3;Map acpi RKA3 to f6 keyboard backlight</string>
<string>;Fn+f7 no macro</string>
<string>42=e010</string>
<string>43=e022</string>
<string>44=e019</string>
<string>57=e02e</string>
<string>58=e030</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>e06e=e06e;Fn+f1 macro translated</string>
<string>e008=e008;Fn+f2 regular scancode and EC query call q8c</string>
<string>e01e=e037;Fn+f3 regular scancode and EC controls LED</string>
<string>e005=e005;Fn+f4 no ps2scancode and EC query call q81</string>
<string>e006=e006;Fn+f5 no ps2scancode and EC query call q80</string>
<string>e00c=e00c;Fn+f6 no ps2scancode and EC query call q8a</string>
<string>;Fn+f7 no macro just regular f key</string>
<string>e010=e010; Fn+f8 regular scancode</string>
<string>e022=e022; Fn+f9 regular scancode</string>
<string>e019=e019;Fn+f10 regular scancode</string>
<string>e02e=e02e;Fn+f11 regular scancode</string>
<string>e030=e030;Fn+f12 regular scancode</string>
<string>;Fn+f13 is mute dedicated button that always produces e020 regardless of Fn</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
<key>Macro Inversion</key>
<array>
<string>;This section maps ps2 codes (packet format) received quickly (macros) into fake ps2 codes (packet format)</string>
<string>;Fn+F1</string>
<data>
//8CbgAAAAACWwEZ
</data>
<data>
//8C7gAAAAAC2wGZ
</data>
<data>
//8C7gAAAAABmQLb
</data>
</array>
<key>MaximumMacroTime</key>
<integer>35000000</integer>
<key>Note-Author</key>
<string>TimeWalker aka TimeWalker75a</string>
<key>Note-Comment</key>
<string>Keyboard Profile for DELL SandyBridge SecureCore Tiano based laptops (Vostro 3450 &amp; 3750, Inspiron N4110, XPS L502x &amp; L702x &amp; L511z)</string>
</dict>
<key>WN09</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e01b</string>
<string>e008</string>
<string>e01e</string>
<string>e005</string>
<string>e06e</string>
<string>e006</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e01b=70</string>
<string>e06e=83</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>56=2b</string>
<string>29=56</string>
<string>2b=29</string>
<string>e01e=e037</string>
<string>e037=e01e</string>
</array>
</dict>
<key>WN09a</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e01b</string>
<string>e008</string>
<string>e01e</string>
<string>e005</string>
<string>e06e</string>
<string>e006</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e01b=70</string>
<string>e06e=83</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e01e=e037</string>
<string>e037=e01e</string>
</array>
</dict>
</dict>
<key>Default</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>;Items must be strings in the form of breaklessscan (in hex)</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>;Items must be strings in the form of scanfrom=adbto (in hex)</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>;Items must be strings in the form of scanfrom=scanto (in hex)</string>
<string>e027=0;disable discrete fnkeys toggle</string>
<string>e028=0;disable discrete trackpad toggle</string>
</array>
<key>HIDF12EjectDelay</key>
<integer>250</integer>
<key>LogScanCodes</key>
<integer>0</integer>
<key>Make Application key into Apple Fn key</key>
<false/>
<key>Make Application key into right windows</key>
<true/>
<key>Make right modifier keys into Hangul and Hanja</key>
<false/>
<key>SleepPressTime</key>
<integer>0</integer>
<key>Swap capslock and left control</key>
<false/>
<key>Swap command and option</key>
<true/>
<key>Use ISO layout keyboard</key>
<false/>
<key>alt_handler_id</key>
<integer>3</integer>
</dict>
<key>HPQOEM</key>
<dict>
<key>1411</key>
<string>ProBook-102;ProBook 4520s</string>
<key>1619</key>
<string>ProBook-87;ProBook 6560b</string>
<key>161C</key>
<string>ProBook-87;ProBook 8460p</string>
<key>164F</key>
<string>ProBook-87;ProBook 5330m</string>
<key>167C</key>
<string>ProBook-102;ProBook 4530s</string>
<key>167E</key>
<string>ProBook-102;ProBook 4330s</string>
<key>1680</key>
<string>ProBook-102;ProBook 4230s</string>
<key>179B</key>
<string>ProBook-87;ProBook 6470b</string>
<key>179C</key>
<string>ProBook-87;ProBook 6470b</string>
<key>17A9</key>
<string>ProBook-87;ProBook 8570b</string>
<key>17F0</key>
<string>ProBook-102;ProBook 4340s</string>
<key>17F3</key>
<string>ProBook-102;ProBook 4440s</string>
<key>17F6</key>
<string>ProBook-102;ProBook 4540s</string>
<key>1942</key>
<string>ProBook-87;ProBook 450s G1</string>
<key>1949</key>
<string>ProBook-87;ProBook 450s G1</string>
<key>1962</key>
<string>Haswell-Envy;HP Envy 15-j063cl</string>
<key>1963</key>
<string>Haswell-Envy;HP Envy 15-j063cl</string>
<key>1965</key>
<string>Haswell-Envy;HP Envy 17t-j100</string>
<key>1966</key>
<string>Haswell-Envy;HP Envy 17t-j000</string>
<key>198F</key>
<string>ProBook-87;ProBook 450s G0</string>
<key>Haswell-Envy</key>
<dict>
<key>Custom ADB Map</key>
<array>
<string>e019=42;next</string>
<string>e010=4d;previous</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e045=e037</string>
<string>e0ab=0;bogus Fn+F2/F3</string>
</array>
</dict>
<key>ProBook-102</key>
<dict>
<key>Custom PS2 Map</key>
<array>
<string>e005=0</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>e05f=3b</string>
<string>e012=3c</string>
<string>e017=3d</string>
<string>e06e=3e</string>
<string>e00a=3f</string>
<string>e009=40</string>
<string>e020=41</string>
<string>e02e=42</string>
<string>e030=43</string>
<string>e010=44</string>
<string>e022=57</string>
<string>e019=58</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>3b=e05f</string>
<string>3c=e012</string>
<string>3d=e017</string>
<string>3e=e06e</string>
<string>3f=e00a</string>
<string>40=e009</string>
<string>41=e020</string>
<string>42=e02e</string>
<string>43=e030</string>
<string>44=e010</string>
<string>57=e022</string>
<string>58=e019</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>e05f=e05f</string>
<string>e012=e012</string>
<string>e017=e017</string>
<string>e06e=e06e</string>
<string>e00a=e00a</string>
<string>e009=e009</string>
<string>e020=e020</string>
<string>e02e=e02e</string>
<string>e030=e030</string>
<string>e010=e010</string>
<string>e022=e022</string>
<string>e019=e019</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
<key>SleepPressTime</key>
<integer>3000</integer>
</dict>
<key>ProBook-87</key>
<dict>
<key>Custom ADB Map</key>
<array>
<string>46=4d;scroll =&gt; Previous-track</string>
<string>e045=34;pause =&gt; Play-Pause</string>
<string>e052=42;insert =&gt; Next-track</string>
<string>e046=92;break =&gt; Eject</string>
</array>
<key>Custom PS2 Map</key>
<array>
<string>e005=0</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 8 items map Fn+fkeys to fkeys</string>
<string>e05f=3d</string>
<string>e06e=3e</string>
<string>e02e=40</string>
<string>e030=41</string>
<string>e009=42</string>
<string>e012=43</string>
<string>e017=44</string>
<string>e033=57</string>
<string>;The following 8 items map fkeys to Fn+fkeys</string>
<string>3d=e05f</string>
<string>3e=e06e</string>
<string>40=e02e</string>
<string>41=e030</string>
<string>42=e037</string>
<string>43=e012</string>
<string>44=e017</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 8 items map Fn+fkeys to Fn+fkeys</string>
<string>e05f=e05f</string>
<string>e06e=e06e</string>
<string>e02e=e02e</string>
<string>e030=e030</string>
<string>e009=e009</string>
<string>e012=e012</string>
<string>e017=e017</string>
<string>e033=e033</string>
<string>;The following 8 items map fkeys to fkeys</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
</array>
<key>SleepPressTime</key>
<integer>3000</integer>
</dict>
</dict>
<key>Intel</key>
<dict>
<key>CALPELLA</key>
<string>SamsungKeys</string>
<key>SamsungKeys</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e003</string>
<string>e002</string>
<string>e004</string>
<string>e020</string>
<string>;e031</string>
<string>e033</string>
<string>e006</string>
<string>e077</string>
<string>e079</string>
<string>e008</string>
<string>e009</string>
</array>
<key>Custom ADB Map</key>
<array>
<string>e002=70</string>
<string>e006=80</string>
<string>e008=71 (was =90)</string>
<string>e009=6b (was =91)</string>
</array>
<key>Function Keys Special</key>
<array>
<string>;The following 12 items map Fn+fkeys to fkeys</string>
<string>;fn+f1 no code</string>
<string>e003=3c</string>
<string>;fn+f3 weird code</string>
<string>e002=3e</string>
<string>e004=3f</string>
<string>e020=40</string>
<string>e031=41</string>
<string>e033=42</string>
<string>e006=43</string>
<string>;fn+f10 weird code</string>
<string>;fn+f11 no code</string>
<string>;fn+f12 scrolllock</string>
<string>;The following 12 items map fkeys to Fn+fkeys</string>
<string>;fn+f1 no code</string>
<string>3c=e003</string>
<string>;fn+f3 weird code</string>
<string>3e=e002</string>
<string>3f=e004</string>
<string>40=e020</string>
<string>41=e031</string>
<string>42=e033</string>
<string>43=e006</string>
<string>;fn+f10 weird code</string>
<string>;fn+f11 no code</string>
<string>;fn+f12 scrolllock</string>
</array>
<key>Function Keys Standard</key>
<array>
<string>;The following 12 items map Fn+fkeys to Fn+fkeys</string>
<string>;fn+f1 no code</string>
<string>e003=e003</string>
<string>;fn+f3 weird code</string>
<string>e002=e002</string>
<string>e004=e004</string>
<string>e020=e020</string>
<string>e031=e031</string>
<string>e033=e033</string>
<string>e006=e006</string>
<string>;fn+f10 weird code</string>
<string>;fn+f11 no code</string>
<string>;fn+f12 scrolllock</string>
<string>;The following 12 items map fkeys to fkeys</string>
<string>3b=3b</string>
<string>3c=3c</string>
<string>3d=3d</string>
<string>3e=3e</string>
<string>3f=3f</string>
<string>40=40</string>
<string>41=41</string>
<string>42=42</string>
<string>43=43</string>
<string>44=44</string>
<string>57=57</string>
<string>58=58</string>
</array>
</dict>
</dict>
<key>SECCSD</key>
<dict>
<key>LH43STAR</key>
<string>SamsungKeys</string>
<key>SamsungKeys</key>
<dict>
<key>Breakless PS2</key>
<array>
<string>e020</string>
<string>e02e</string>
<string>e030</string>
</array>
</dict>
</dict>
</dict>
</dict>
</dict>
<key>OSBundleLibraries</key>
<dict>
<key>as.acidanthera.voodoo.driver.PS2Controller</key>
<string>2.1.7</string>
<key>com.apple.iokit.IOHIDFamily</key>
<string>1.0.0b1</string>
<key>com.apple.kpi.bsd</key>
<string>8.0.0</string>
<key>com.apple.kpi.iokit</key>
<string>8.0.0</string>
<key>com.apple.kpi.libkern</key>
<string>8.0.0</string>
<key>com.apple.kpi.mach</key>
<string>8.0.0</string>
<key>com.apple.kpi.unsupported</key>
<string>8.0.0</string>
</dict>
<key>OSBundleRequired</key>
<string>Console</string>
</dict>
</plist>

View File

@ -1,4 +1,4 @@
package com.flyfish.framework.beans.annotations;
package com.flyfish.framework.beans.meta;
import com.flyfish.framework.controller.BaseController;
import com.flyfish.framework.controller.SafeController;
@ -31,8 +31,22 @@ public @interface RestBean {
@AliasFor(value = "collection", annotation = Document.class)
String value() default "";
/**
* 名称可用于占位
*
* @return 结果
*/
String name() default "";
/**
* 排除的属性
* @return 结果
*/
String[] exclude() default "";
/**
* 必须指定qo
*
* @return 结果
*/
Class<? extends Qo> queryClass() default NameLikeQo.class;

View File

@ -1,7 +1,7 @@
package com.flyfish.framework.config;
import com.flyfish.framework.beans.annotations.EnableRestBeanDetect;
import com.flyfish.framework.beans.annotations.RestBean;
import com.flyfish.framework.beans.meta.RestBean;
import com.flyfish.framework.beans.repository.CustomRepositoryRegistrar;
import com.flyfish.framework.beans.resolver.DynamicRestBeanResolver;
import com.flyfish.framework.compiler.DynamicJavaCompiler;