答案组件 @author Gao
| 25 | * |
| 26 | */ |
| 27 | @Component("answerComponent") |
| 28 | public class AnswerComponent { |
| 29 | @Resource |
| 30 | SettingComponent settingComponent; |
| 31 | @Resource |
| 32 | AnswerRepository answerRepository; |
| 33 | @Resource |
| 34 | UserComponent userComponent; |
| 35 | @Resource |
| 36 | UserRepository userRepository; |
| 37 | @Autowired |
| 38 | private AnswerCacheManager answerCacheManager; |
| 39 | @Autowired |
| 40 | private UserCacheManager userCacheManager; |
| 41 | @Resource |
| 42 | JsonComponent jsonComponent; |
| 43 | |
| 44 | /** |
| 45 | * 答案编辑器允许使用标签 |
| 46 | * @return List<String> 类型json格式 |
| 47 | */ |
| 48 | public String availableTag(){ |
| 49 | List<String> tag = new ArrayList<String>(); |
| 50 | EditorTag editor = settingComponent.readAnswerEditorTag(); |
| 51 | if(editor != null){ |
| 52 | //标签区域1 |
| 53 | boolean area_1 = false; |
| 54 | //标签区域2 |
| 55 | boolean area_2 = false; |
| 56 | //标签区域3 |
| 57 | boolean area_3 = false; |
| 58 | |
| 59 | tag.add("source"); |
| 60 | // tag.add("|"); |
| 61 | if(editor.isCode()){//代码 |
| 62 | tag.add("code"); |
| 63 | area_1 = true; |
| 64 | } |
| 65 | if(editor.isFontname()){//字体 |
| 66 | tag.add("fontname"); |
| 67 | area_1 = true; |
| 68 | } |
| 69 | if(editor.isFontsize()){//文字大小 |
| 70 | tag.add("fontsize"); |
| 71 | area_1 = true; |
| 72 | } |
| 73 | if(area_1){ |
| 74 | // tag.add("|"); |
| 75 | } |
| 76 | |
| 77 | if(editor.isForecolor()){//文字颜色 |
| 78 | tag.add("forecolor"); |
| 79 | area_2 = true; |
| 80 | } |
| 81 | if(editor.isHilitecolor()){//文字背景 |
| 82 | tag.add("hilitecolor"); |
| 83 | area_2 = true; |
| 84 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…