├── certificate ├── certificate.p12 ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── src ├── main │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ ├── V18__Add_star_to_user_table.sql │ │ │ │ ├── V2__Add_bio_col_to_user_table.sql │ │ │ │ ├── V17__Modify_avatarurl_long_user_table.sql │ │ │ │ ├── V16__Add_password_to_user_table.sql │ │ │ │ ├── V4__Add_avatar_url_to_user_table.sql │ │ │ │ ├── V6__Add_content_to_comment_table.sql │ │ │ │ ├── V9__Add_comment_count_to_comment_table.sql │ │ │ │ ├── V10__Modify_content_count_to_comment_count_table.sql │ │ │ │ ├── V13__Modify_notification_name_to_notifier_name_table.sql │ │ │ │ ├── V8__Change_creator_column_type.sql │ │ │ │ ├── V7__Change_id_column_type.sql │ │ │ │ ├── V12__Add_name_and_title_to_notification_table.sql │ │ │ │ ├── V14__Create_thumb_table.sql │ │ │ │ ├── V1__Create_user_table.sql │ │ │ │ ├── V15__Add_email_code_status_to_user_table.sql │ │ │ │ ├── V5__Create_comment_table.sql │ │ │ │ ├── V11__Create_notification_table.sql │ │ │ │ └── V3__Create__question__table.sql │ │ ├── certificate.p12 │ │ ├── static │ │ │ ├── images │ │ │ │ ├── QQ.jpg │ │ │ │ ├── QQ.png │ │ │ │ ├── xia.jpg │ │ │ │ ├── iceman.png │ │ │ │ ├── loading.gif │ │ │ │ ├── logos │ │ │ │ │ ├── vi.png │ │ │ │ │ ├── editormd-logo-16x16.png │ │ │ │ │ ├── editormd-logo-24x24.png │ │ │ │ │ ├── editormd-logo-32x32.png │ │ │ │ │ ├── editormd-logo-48x48.png │ │ │ │ │ ├── editormd-logo-57x57.png │ │ │ │ │ ├── editormd-logo-64x64.png │ │ │ │ │ ├── editormd-logo-72x72.png │ │ │ │ │ ├── editormd-logo-96x96.png │ │ │ │ │ ├── editormd-favicon-16x16.ico │ │ │ │ │ ├── editormd-favicon-24x24.ico │ │ │ │ │ ├── editormd-favicon-32x32.ico │ │ │ │ │ ├── editormd-favicon-48x48.ico │ │ │ │ │ ├── editormd-favicon-64x64.ico │ │ │ │ │ ├── editormd-logo-114x114.png │ │ │ │ │ ├── editormd-logo-120x120.png │ │ │ │ │ ├── editormd-logo-144x144.png │ │ │ │ │ ├── editormd-logo-180x180.png │ │ │ │ │ ├── editormd-logo-240x240.png │ │ │ │ │ └── editormd-logo-320x320.png │ │ │ │ ├── loading@2x.gif │ │ │ │ ├── loading@3x.gif │ │ │ │ ├── default-avatar.png │ │ │ │ └── gitee.svg │ │ │ ├── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── editormd-logo.eot │ │ │ │ ├── editormd-logo.ttf │ │ │ │ ├── editormd-logo.woff │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ ├── fontawesome-webfont.woff2 │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ ├── glyphicons-halflings-regular.woff2 │ │ │ │ └── editormd-logo.svg │ │ │ ├── js │ │ │ │ ├── lib │ │ │ │ │ ├── codemirror │ │ │ │ │ │ ├── theme │ │ │ │ │ │ │ ├── ambiance-mobile.css │ │ │ │ │ │ │ ├── neat.css │ │ │ │ │ │ │ ├── elegant.css │ │ │ │ │ │ │ ├── neo.css │ │ │ │ │ │ │ ├── eclipse.css │ │ │ │ │ │ │ ├── cobalt.css │ │ │ │ │ │ │ ├── monokai.css │ │ │ │ │ │ │ ├── rubyblue.css │ │ │ │ │ │ │ ├── night.css │ │ │ │ │ │ │ ├── the-matrix.css │ │ │ │ │ │ │ ├── colorforth.css │ │ │ │ │ │ │ ├── blackboard.css │ │ │ │ │ │ │ ├── 3024-day.css │ │ │ │ │ │ │ ├── tomorrow-night-bright.css │ │ │ │ │ │ │ ├── paraiso-light.css │ │ │ │ │ │ │ ├── paraiso-dark.css │ │ │ │ │ │ │ ├── 3024-night.css │ │ │ │ │ │ │ ├── base16-dark.css │ │ │ │ │ │ │ ├── base16-light.css │ │ │ │ │ │ │ ├── mbo.css │ │ │ │ │ │ │ ├── vibrant-ink.css │ │ │ │ │ │ │ ├── twilight.css │ │ │ │ │ │ │ ├── midnight.css │ │ │ │ │ │ │ └── zenburn.css │ │ │ │ │ │ ├── addon │ │ │ │ │ │ │ ├── display │ │ │ │ │ │ │ │ ├── fullscreen.css │ │ │ │ │ │ │ │ └── fullscreen.js │ │ │ │ │ │ │ ├── search │ │ │ │ │ │ │ │ └── matchesonscrollbar.css │ │ │ │ │ │ │ ├── fold │ │ │ │ │ │ │ │ ├── foldgutter.css │ │ │ │ │ │ │ │ ├── indent-fold.js │ │ │ │ │ │ │ │ └── markdown-fold.js │ │ │ │ │ │ │ ├── dialog │ │ │ │ │ │ │ │ └── dialog.css │ │ │ │ │ │ │ ├── hint │ │ │ │ │ │ │ │ ├── show-hint.css │ │ │ │ │ │ │ │ └── anyword-hint.js │ │ │ │ │ │ │ ├── mode │ │ │ │ │ │ │ │ └── multiplex_test.js │ │ │ │ │ │ │ ├── lint │ │ │ │ │ │ │ │ ├── yaml-lint.js │ │ │ │ │ │ │ │ ├── json-lint.js │ │ │ │ │ │ │ │ ├── css-lint.js │ │ │ │ │ │ │ │ └── coffeescript-lint.js │ │ │ │ │ │ │ ├── edit │ │ │ │ │ │ │ │ ├── trailingspace.js │ │ │ │ │ │ │ │ └── continuelist.js │ │ │ │ │ │ │ ├── tern │ │ │ │ │ │ │ │ └── worker.js │ │ │ │ │ │ │ ├── runmode │ │ │ │ │ │ │ │ └── colorize.js │ │ │ │ │ │ │ └── scroll │ │ │ │ │ │ │ │ ├── simplescrollbars.css │ │ │ │ │ │ │ │ └── scrollpastend.js │ │ │ │ │ │ ├── mode │ │ │ │ │ │ │ ├── tiddlywiki │ │ │ │ │ │ │ │ └── tiddlywiki.css │ │ │ │ │ │ │ ├── ruby │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ │ ├── tiki │ │ │ │ │ │ │ │ └── tiki.css │ │ │ │ │ │ │ ├── diff │ │ │ │ │ │ │ │ └── diff.js │ │ │ │ │ │ │ ├── ntriples │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── spreadsheet │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── http │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── solr │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── z80 │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── ecl │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── rust │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── turtle │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── pascal │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── pig │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── vbscript │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── gherkin │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── properties │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── javascript │ │ │ │ │ │ │ │ └── typescript.html │ │ │ │ │ │ │ ├── sass │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── perl │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── idl │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── dart │ │ │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ │ │ └── dart.js │ │ │ │ │ │ │ ├── xml │ │ │ │ │ │ │ │ └── test.js │ │ │ │ │ │ │ ├── jinja2 │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── css │ │ │ │ │ │ │ │ └── less_test.js │ │ │ │ │ │ │ ├── shell │ │ │ │ │ │ │ │ ├── test.js │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── sparql │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── django │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ ├── tornado │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ │ └── forth │ │ │ │ │ │ │ │ └── index.html │ │ │ │ │ │ ├── bower.json │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── LICENSE │ │ │ │ │ └── jquery.flowchart.min.js │ │ │ │ ├── npm.js │ │ │ │ └── plugins │ │ │ │ │ └── test-plugin │ │ │ │ │ └── test-plugin.js │ │ │ └── icons │ │ │ │ ├── info.svg │ │ │ │ ├── lock.svg │ │ │ │ └── envelope-open.svg │ │ ├── templates │ │ │ ├── footer.html │ │ │ └── error.html │ │ ├── mapper │ │ │ ├── NftOrderMapper.xml │ │ │ ├── TbOrderMapper.xml │ │ │ └── CommentExtMapper.xml │ │ ├── qqconnectconfig.properties │ │ ├── script │ │ │ └── limit.lua │ │ └── generatorConfig.xml │ └── java │ │ └── com │ │ └── wenmrong │ │ └── community1 │ │ └── community │ │ ├── enums │ │ ├── SortEnum.java │ │ ├── NotificationStatusEnum.java │ │ ├── CommentTypeEnum.java │ │ └── NotificationTypeEnum.java │ │ ├── exception │ │ ├── ICustomizeErrorCode.java │ │ ├── CustomizeException.java │ │ └── CustomizeErrorCode.java │ │ ├── limiter │ │ └── RateLimiterEngine.java │ │ ├── dto │ │ ├── FileDTO.java │ │ ├── TagDTO.java │ │ ├── CommentCreateDTO.java │ │ ├── GithubUser.java │ │ ├── AccessTokenDTO.java │ │ ├── QuestionQueryDTO.java │ │ ├── HotTagDTO.java │ │ ├── StatisticData.java │ │ ├── NotificationDTO.java │ │ ├── CommentDTO.java │ │ ├── QuestionDTO.java │ │ ├── ResultDTO.java │ │ └── PaginationDTO.java │ │ ├── mapper │ │ ├── CommentExtMapper.java │ │ ├── TbOrderMapper.java │ │ ├── NftOrderMapper.java │ │ └── QuestionExtMapper.java │ │ ├── interceptor │ │ ├── authInterceptor.java │ │ ├── WebConfig.java │ │ └── LoginInterceptor.java │ │ ├── service │ │ ├── NftOrderService.java │ │ ├── TbOrderService.java │ │ ├── RandomCodeService.java │ │ ├── StatisticService.java │ │ └── impl │ │ │ └── TbOrderServiceImpl.java │ │ ├── controller │ │ ├── NftOrderController.java │ │ ├── TbOrderController.java │ │ ├── UserController.java │ │ ├── FileController.java │ │ ├── NotificationController.java │ │ ├── WallPaperController.java │ │ ├── CustomizeErrorController.java │ │ └── ModifyProfileController.java │ │ ├── config │ │ ├── JasyptProfile.java │ │ └── MyBatisPlusFillHandler.java │ │ ├── sysenum │ │ └── SysEnum.java │ │ ├── CommunityApplication.java │ │ ├── mq │ │ └── consumer │ │ │ ├── QuestionConsumer.java │ │ │ └── TransactionConsumer.java │ │ ├── utils │ │ └── SecretUtil.java │ │ ├── model │ │ └── NftOrder.java │ │ ├── cache │ │ └── HotTagCache.java │ │ └── provider │ │ └── GithubProvider.java └── test │ └── java │ └── com │ └── wenmrong │ └── community1 │ └── community │ ├── CommunityApplicationTests.java │ ├── LoginTest.java │ ├── TestLog.java │ └── TestMyBatisPlus.java └── .gitignore /certificate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/certificate -------------------------------------------------------------------------------- /certificate.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/certificate.p12 -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/db/migration/V18__Add_star_to_user_table.sql: -------------------------------------------------------------------------------- 1 | alter table user 2 | add star varchar(256) default null; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V2__Add_bio_col_to_user_table.sql: -------------------------------------------------------------------------------- 1 | alter table user add bio varchar(256) null; 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V17__Modify_avatarurl_long_user_table.sql: -------------------------------------------------------------------------------- 1 | alter table user modify column avatar_url varchar(300); -------------------------------------------------------------------------------- /src/main/resources/certificate.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/certificate.p12 -------------------------------------------------------------------------------- /src/main/resources/db/migration/V16__Add_password_to_user_table.sql: -------------------------------------------------------------------------------- 1 | alter table user 2 | add password varchar(100) default null; -------------------------------------------------------------------------------- /src/main/resources/db/migration/V4__Add_avatar_url_to_user_table.sql: -------------------------------------------------------------------------------- 1 | alter table user add avatar_url varchar(100) null; 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V6__Add_content_to_comment_table.sql: -------------------------------------------------------------------------------- 1 | alter table comment add content varchar(1024) null; 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/images/QQ.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/QQ.jpg -------------------------------------------------------------------------------- /src/main/resources/static/images/QQ.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/QQ.png -------------------------------------------------------------------------------- /src/main/resources/static/images/xia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/xia.jpg -------------------------------------------------------------------------------- /src/main/resources/db/migration/V9__Add_comment_count_to_comment_table.sql: -------------------------------------------------------------------------------- 1 | alter table comment add content_count int default 0; 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/images/iceman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/iceman.png -------------------------------------------------------------------------------- /src/main/resources/static/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/loading.gif -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/vi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/vi.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/main/resources/static/images/loading@2x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/loading@2x.gif -------------------------------------------------------------------------------- /src/main/resources/static/images/loading@3x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/loading@3x.gif -------------------------------------------------------------------------------- /src/main/resources/db/migration/V10__Modify_content_count_to_comment_count_table.sql: -------------------------------------------------------------------------------- 1 | alter table comment change content_count comment_count int default 0; 2 | -------------------------------------------------------------------------------- /src/main/resources/static/fonts/editormd-logo.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/editormd-logo.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/editormd-logo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/editormd-logo.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/editormd-logo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/editormd-logo.woff -------------------------------------------------------------------------------- /src/main/resources/static/images/default-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/default-avatar.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/main/resources/db/migration/V13__Modify_notification_name_to_notifier_name_table.sql: -------------------------------------------------------------------------------- 1 | alter table notification change notification_name notifier_name varchar(100) null; 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V8__Change_creator_column_type.sql: -------------------------------------------------------------------------------- 1 | alter table question modify creator bigint not null; 2 | alter table comment modify commentator bigint not null; -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-16x16.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-24x24.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-32x32.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-48x48.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-57x57.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-64x64.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-72x72.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-96x96.png -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-favicon-16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-favicon-16x16.ico -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-favicon-24x24.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-favicon-24x24.ico -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-favicon-32x32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-favicon-32x32.ico -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-favicon-48x48.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-favicon-48x48.ico -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-favicon-64x64.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-favicon-64x64.ico -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-114x114.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-120x120.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-144x144.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-180x180.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-240x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-240x240.png -------------------------------------------------------------------------------- /src/main/resources/static/images/logos/editormd-logo-320x320.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1autodidact/communitycode/HEAD/src/main/resources/static/images/logos/editormd-logo-320x320.png -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/ambiance-mobile.css: -------------------------------------------------------------------------------- 1 | .cm-s-ambiance.CodeMirror { 2 | -webkit-box-shadow: none; 3 | -moz-box-shadow: none; 4 | box-shadow: none; 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V7__Change_id_column_type.sql: -------------------------------------------------------------------------------- 1 | alter table question modify id bigint auto_increment not null; 2 | alter table `user` modify id bigint auto_increment not null; 3 | 4 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V12__Add_name_and_title_to_notification_table.sql: -------------------------------------------------------------------------------- 1 | alter table notification add notification_name varchar(100) null; 2 | alter table notification add outer_title varchar(256) null; 3 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/enums/SortEnum.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.enums; 2 | 3 | public enum SortEnum { 4 | HOT, 5 | HOT30, 6 | HOT7, 7 | NO, 8 | NEW; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/exception/ICustomizeErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.exception; 2 | 3 | public interface ICustomizeErrorCode { 4 | String getMessage(); 5 | Integer getCode(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V14__Create_thumb_table.sql: -------------------------------------------------------------------------------- 1 | create table thumb 2 | ( 3 | id bigint auto_increment, 4 | thumb_id bigint not null, 5 | thumb_id_parent bigint not null, 6 | constraint thumb_pk 7 | primary key (id) 8 | ); 9 | 10 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/limiter/RateLimiterEngine.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.limiter; 2 | 3 | /** 4 | * 限流引擎 5 | * 6 | * @author wenmingrong@kungeek.com 7 | * @since 8 | */ 9 | public class RateLimiterEngine { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V1__Create_user_table.sql: -------------------------------------------------------------------------------- 1 | create table user 2 | ( 3 | id int auto_increment primary key not null, 4 | account_id varchar(100), 5 | name varchar(50), 6 | token varchar(36), 7 | gmt_create bigint, 8 | gmt_modified bigint 9 | ); -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/FileDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class FileDTO { 7 | private int success; 8 | private String message; 9 | private String url; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/mapper/CommentExtMapper.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.mapper; 2 | 3 | import com.wenmrong.community1.community.model.Comment; 4 | 5 | public interface CommentExtMapper { 6 | int incCommentCount(Comment comment); 7 | 8 | } -------------------------------------------------------------------------------- /src/main/resources/db/migration/V15__Add_email_code_status_to_user_table.sql: -------------------------------------------------------------------------------- 1 | alter table user 2 | add email varchar(100) default null; 3 | 4 | alter table user 5 | add code varchar(100) default null; 6 | 7 | alter table user 8 | add status int(11) default null; 9 | 10 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/TagDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | @Data 7 | public class TagDTO { 8 | private String categoryName; 9 | private List tags; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/search/matchesonscrollbar.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-search-match { 2 | background: gold; 3 | border-top: 1px solid orange; 4 | border-bottom: 1px solid orange; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | opacity: .5; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/CommentCreateDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CommentCreateDTO { 7 | private Long parentId; 8 | private String content; 9 | private Integer type; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/interceptor/authInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.interceptor; 2 | 3 | /** 4 | *

community

5 | *

权限拦截器

6 | * 7 | * @author : Autodidact 8 | * @date : 2022-08-11 20:46 9 | **/ 10 | public class authInterceptor { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/GithubUser.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class GithubUser { 7 | private String name; 8 | private String id; 9 | private String bio; 10 | private String avatar_url; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V5__Create_comment_table.sql: -------------------------------------------------------------------------------- 1 | create table comment 2 | ( 3 | id bigint auto_increment primary key, 4 | parent_id bigint not null, 5 | type int not null, 6 | commentator int not null, 7 | gmt_create bigint not null, 8 | gmt_modified bigint not null, 9 | like_count bigint default 0 10 | ); 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V11__Create_notification_table.sql: -------------------------------------------------------------------------------- 1 | create table notification 2 | ( 3 | id bigint auto_increment primary key, 4 | notifier bigint not null, 5 | receiver bigint not null, 6 | outerid bigint not null, 7 | type int not null, 8 | gmt_create bigint not null, 9 | status int default 0 not null 10 | ); 11 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /src/test/java/com/wenmrong/community1/community/CommunityApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommunityApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codemirror", 3 | "version":"5.0.0", 4 | "main": ["lib/codemirror.js", "lib/codemirror.css"], 5 | "ignore": [ 6 | "**/.*", 7 | "node_modules", 8 | "components", 9 | "bin", 10 | "demo", 11 | "doc", 12 | "test", 13 | "index.html", 14 | "package.json" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/AccessTokenDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccessTokenDTO { 7 | private String client_id; 8 | private String client_secret; 9 | private String code; 10 | private String redirect_uri; 11 | private String state; 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/db/migration/V3__Create__question__table.sql: -------------------------------------------------------------------------------- 1 | create table question 2 | ( 3 | id int auto_increment primary key, 4 | title varchar(50), 5 | description text, 6 | gmt_create bigint, 7 | gmt_modified bigint, 8 | creator int, 9 | comment_count int default 0, 10 | view_count int default 0, 11 | like_count int default 0, 12 | tag varchar(256) 13 | ); 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/enums/NotificationStatusEnum.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.enums; 2 | 3 | public enum NotificationStatusEnum { 4 | UNREAD(0), READ(1); 5 | private int status; 6 | 7 | NotificationStatusEnum(int status) { 8 | this.status = status; 9 | } 10 | 11 | public int getStatus() { 12 | return status; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/QuestionQueryDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class QuestionQueryDTO { 7 | private String search; 8 | private String tag; 9 | private TagDTO tagDTO; 10 | private String sort; 11 | private Integer page; 12 | private Integer size; 13 | private Long time; 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/HotTagDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class HotTagDTO implements Comparable { 7 | private String name; 8 | private Integer priority; 9 | 10 | @Override 11 | public int compareTo( Object o) { 12 | return this.getPriority() - ((HotTagDTO) o).getPriority(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/StatisticData.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | *

community

7 | *

8 | * 9 | * @author : Autodidact 10 | * @date : 2022-08-20 10:03 11 | **/ 12 | @Data 13 | public class StatisticData { 14 | public Integer commentCount; 15 | public Integer questionCount; 16 | public Integer userCount; 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/wenmrong/community1/community/LoginTest.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | /** 7 | * LoginTest 8 | * 9 | * @author wenmingrong@kungeek.com 10 | * @since 11 | */ 12 | @SpringBootTest 13 | public class LoginTest{ 14 | 15 | @Test 16 | public void login() { 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/mapper/TbOrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.mapper; 2 | 3 | import com.wenmrong.community1.community.model.TbOrder; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author autodidact 12 | * @since 2022-08-17 13 | */ 14 | public interface TbOrderMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/mapper/NftOrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.mapper; 2 | 3 | import com.wenmrong.community1.community.model.NftOrder; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | 6 | /** 7 | *

8 | * Mapper 接口 9 | *

10 | * 11 | * @author autodidact 12 | * @since 2022-08-14 13 | */ 14 | public interface NftOrderMapper extends BaseMapper { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/service/NftOrderService.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.service; 2 | 3 | import com.wenmrong.community1.community.model.NftOrder; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author autodidact 12 | * @since 2022-08-14 13 | */ 14 | public interface NftOrderService extends IService { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/service/TbOrderService.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.service; 2 | 3 | import com.wenmrong.community1.community.model.TbOrder; 4 | import com.baomidou.mybatisplus.extension.service.IService; 5 | 6 | /** 7 | *

8 | * 服务类 9 | *

10 | * 11 | * @author autodidact 12 | * @since 2022-08-17 13 | */ 14 | public interface TbOrderService extends IService { 15 | public void placeOrder(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/NftOrderController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | import org.springframework.stereotype.Controller; 7 | 8 | /** 9 | *

10 | * 前端控制器 11 | *

12 | * 13 | * @author autodidact 14 | * @since 2022-08-14 15 | */ 16 | @Controller 17 | @RequestMapping("//nft-order") 18 | public class NftOrderController { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/NotificationDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class NotificationDTO { 7 | private Long id; 8 | private Long gmtCreate; 9 | private Integer status; 10 | private Long notifier; 11 | private Long outerid; 12 | private String notifierName; 13 | private String outerTitle; 14 | private String typeName; 15 | private Integer type; 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | qqconnect.log 4 | !.mvn/wrapper/maven-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | logs/ 8 | earch function 9 | ### STS ### 10 | .apt_generated 11 | .classpath 12 | .factorypath 13 | .project 14 | .settings 15 | .springBeans 16 | .sts4-cache 17 | 18 | ### IntelliJ IDEA ### 19 | .idea 20 | *.iws 21 | *.iml 22 | *.ipr 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | 32 | 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | -------------------------------------------------------------------------------- /src/main/resources/static/icons/info.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/static/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/CommentDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import com.wenmrong.community1.community.model.User; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class CommentDTO { 8 | private Long id; 9 | private Long parentId; 10 | private Integer type; 11 | private Long commentator; 12 | private Long gmtCreate; 13 | private Long gmtModified; 14 | private Long likeCount; 15 | private Integer commentCount; 16 | private String content; 17 | private User user; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/ruby/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("divide_equal_operator", 9 | "[variable bar] [operator /=] [variable foo]"); 10 | 11 | MT("divide_equal_operator_no_spacing", 12 | "[variable foo][operator /=][number 42]"); 13 | 14 | })(); 15 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/fold/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | cursor: pointer; 14 | } 15 | .CodeMirror-foldgutter-open:after { 16 | content: "\25BE"; 17 | } 18 | .CodeMirror-foldgutter-folded:after { 19 | content: "\25B8"; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFF; 3 | background-color: #900; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px ! important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/exception/CustomizeException.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.exception; 2 | 3 | public class CustomizeException extends RuntimeException { 4 | private String message; 5 | private Integer code; 6 | 7 | public CustomizeException(ICustomizeErrorCode errorCode) { 8 | this.code = errorCode.getCode(); 9 | 10 | this.message = errorCode.getMessage(); 11 | } 12 | 13 | @Override 14 | public String getMessage() { 15 | return message; 16 | } 17 | 18 | public Integer getCode() { 19 | return code; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/config/JasyptProfile.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.config; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | /** 7 | * @author wenmingrong@kungeek.com 8 | * @since 9 | */ 10 | @Component 11 | public class JasyptProfile { 12 | public static String secret; 13 | 14 | public static String getSecret() { 15 | return JasyptProfile.secret; 16 | } 17 | @Value("${jasypt.encryptor.password}") 18 | public void setSecret(String secret) { 19 | this.secret = secret; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/QuestionDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import com.wenmrong.community1.community.model.User; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class QuestionDTO { 8 | private Long id; 9 | private Long creator; 10 | private Integer viewCount; 11 | private Integer commentCount; 12 | private Integer likeCount; 13 | private String title; 14 | private String description; 15 | private String tag; 16 | private Long gmtCreate; 17 | private Long gmtModified; 18 | private User user; 19 | private TagDTO tagDTO; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/enums/CommentTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.enums; 2 | 3 | public enum CommentTypeEnum { 4 | QUESTION(1), 5 | COMMENT(2); 6 | private Integer type; 7 | 8 | public static boolean isExist(Integer type) { 9 | for (CommentTypeEnum commentTypeEnum : CommentTypeEnum.values()) { 10 | if (commentTypeEnum.getType() == type) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | 17 | public Integer getType() { 18 | return type; 19 | } 20 | 21 | CommentTypeEnum(Integer type) { 22 | this.type = type; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/static/icons/lock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: white; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: #333; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/sysenum/SysEnum.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.sysenum; 2 | 3 | /** 4 | * 5 | * @since 6 | */ 7 | public class SysEnum { 8 | 9 | public enum Status { 10 | // 状态:1、未付款,2、已付款,3、未发货,4、已发货,5、交易成功,6、交易关闭 11 | UNPAID(1), PAID(2),NOTSHIPPED(3),shipped(4),TRANSACTIONSUCCEEDED(5), TRANSACTIONCLOSED(6); 12 | private Integer status; 13 | 14 | Status(Integer status) { 15 | this.status = status; 16 | } 17 | 18 | public Integer getStatus() { 19 | return status; 20 | } 21 | 22 | public void setStatus(Integer status) { 23 | this.status = status; 24 | } 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/static/icons/envelope-open.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/service/RandomCodeService.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | import java.util.Random; 6 | 7 | @Service 8 | public class RandomCodeService { 9 | public String createActiveCode() { 10 | Random random = new Random(); 11 | int num = random.nextInt(999999); 12 | String numString = String.valueOf(num); 13 | StringBuilder stringBuffer = new StringBuilder(); 14 | stringBuffer.append(numString); 15 | for (int i = 0; i < 6 - numString.length(); i++) { 16 | stringBuffer.append("0"); 17 | } 18 | return stringBuffer.toString(); 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta {color: #555;} 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | 11 | .cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;} 12 | .cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 13 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/CommunityApplication.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community; 2 | 3 | import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.scheduling.annotation.EnableScheduling; 8 | 9 | @SpringBootApplication 10 | @EnableScheduling 11 | @MapperScan("com.wenmrong.community1.community.mapper") 12 | //@EnableEncryptableProperties //开启加密注解 13 | public class CommunityApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(CommunityApplication.class, args); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/mapper/QuestionExtMapper.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.mapper; 2 | 3 | import com.wenmrong.community1.community.dto.QuestionQueryDTO; 4 | import com.wenmrong.community1.community.model.Question; 5 | import com.wenmrong.community1.community.model.QuestionExample; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.session.RowBounds; 8 | 9 | import java.util.List; 10 | 11 | public interface QuestionExtMapper { 12 | int incView(Question record); 13 | int incCommentCount(Question record); 14 | List selectRelated(Question question); 15 | 16 | Integer countBySearch(QuestionQueryDTO questionQueryDTO); 17 | 18 | List selectBySearch(QuestionQueryDTO questionQueryDTO); 19 | 20 | } -------------------------------------------------------------------------------- /src/main/resources/static/images/gitee.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/test/java/com/wenmrong/community1/community/TestLog.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.wenmrong.community1.community.mq.consumer.QuestionConsumer; 5 | import org.junit.jupiter.api.Test; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | 10 | /** 11 | *

community

12 | *

13 | * 14 | * @author : Autodidact 15 | * @date : 2022-08-15 20:43 16 | **/ 17 | @SpringBootTest 18 | public class TestLog { 19 | private static final Logger log = LoggerFactory.getLogger(TestLog.class); 20 | 21 | @Test 22 | public void log() { 23 | log.error("topic:question_topic{}", "aaa"); 24 | System.out.println("aa"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/README.md: -------------------------------------------------------------------------------- 1 | # CodeMirror 2 | [![Build Status](https://travis-ci.org/codemirror/CodeMirror.svg)](https://travis-ci.org/codemirror/CodeMirror) 3 | [![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror) 4 | [Funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png)](https://marijnhaverbeke.nl/fund/) 5 | 6 | CodeMirror is a JavaScript component that provides a code editor in 7 | the browser. When a mode is available for the language you are coding 8 | in, it will color your code, and optionally help with indentation. 9 | 10 | The project page is http://codemirror.net 11 | The manual is at http://codemirror.net/doc/manual.html 12 | The contributing guidelines are in [CONTRIBUTING.md](https://github.com/codemirror/CodeMirror/blob/master/CONTRIBUTING.md) 13 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} 2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} 3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} 4 | .cm-s-elegant span.cm-variable {color: black;} 5 | .cm-s-elegant span.cm-variable-2 {color: #b11;} 6 | .cm-s-elegant span.cm-qualifier {color: #555;} 7 | .cm-s-elegant span.cm-keyword {color: #730;} 8 | .cm-s-elegant span.cm-builtin {color: #30a;} 9 | .cm-s-elegant span.cm-link {color: #762;} 10 | .cm-s-elegant span.cm-error {background-color: #fdd;} 11 | 12 | .cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;} 13 | .cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 14 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | li.CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/enums/NotificationTypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.enums; 2 | 3 | public enum NotificationTypeEnum { 4 | REPLY_QUESTION(1, "reply question"), 5 | REPLY_COMMENT(2, "reply comment"), 6 | THUMB_COMMENT(3, "thumb comment"); 7 | private int type; 8 | private String name; 9 | 10 | public int getType() { 11 | return type; 12 | } 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | NotificationTypeEnum(int type, String name) { 19 | this.type = type; 20 | this.name = name; 21 | } 22 | 23 | public static String nameOfType(int type) { 24 | for (NotificationTypeEnum notificationTypeEnum : NotificationTypeEnum.values()) { 25 | if (notificationTypeEnum.getType() == type) { 26 | return notificationTypeEnum.getName(); 27 | } 28 | } 29 | return ""; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/config/MyBatisPlusFillHandler.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.config; 2 | 3 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; 4 | import lombok.extern.slf4j.Slf4j; 5 | import org.apache.ibatis.reflection.MetaObject; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.time.LocalDate; 9 | 10 | @Component 11 | @Slf4j 12 | public class MyBatisPlusFillHandler implements MetaObjectHandler { 13 | 14 | @Override 15 | public void insertFill(MetaObject metaObject) { 16 | log.info("start insert .. "); 17 | this.setFieldValByName("createTime", LocalDate.now(), metaObject); 18 | this.setFieldValByName("updateTime", LocalDate.now(), metaObject); 19 | } 20 | 21 | @Override 22 | public void updateFill(MetaObject metaObject) { 23 | log.info("start update .. "); 24 | this.setFieldValByName("updateTime", LocalDate.now(),metaObject); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/mode/multiplex_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | CodeMirror.defineMode("markdown_with_stex", function(){ 6 | var inner = CodeMirror.getMode({}, "stex"); 7 | var outer = CodeMirror.getMode({}, "markdown"); 8 | 9 | var innerOptions = { 10 | open: '$', 11 | close: '$', 12 | mode: inner, 13 | delimStyle: 'delim', 14 | innerStyle: 'inner' 15 | }; 16 | 17 | return CodeMirror.multiplexingMode(outer, innerOptions); 18 | }); 19 | 20 | var mode = CodeMirror.getMode({}, "markdown_with_stex"); 21 | 22 | function MT(name) { 23 | test.mode( 24 | name, 25 | mode, 26 | Array.prototype.slice.call(arguments, 1), 27 | 'multiplexing'); 28 | } 29 | 30 | MT( 31 | "stexInsideMarkdown", 32 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]"); 33 | })(); 34 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codemirror", 3 | "version":"5.0.0", 4 | "main": "lib/codemirror.js", 5 | "description": "In-browser code editing made bearable", 6 | "licenses": [{"type": "MIT", 7 | "url": "http://codemirror.net/LICENSE"}], 8 | "directories": {"lib": "./lib"}, 9 | "scripts": {"test": "node ./test/run.js"}, 10 | "devDependencies": {"node-static": "0.6.0", 11 | "phantomjs": "1.9.2-5", 12 | "blint": ">=0.1.1"}, 13 | "bugs": "http://github.com/codemirror/CodeMirror/issues", 14 | "keywords": ["JavaScript", "CodeMirror", "Editor"], 15 | "homepage": "http://codemirror.net", 16 | "maintainers":[{"name": "Marijn Haverbeke", 17 | "email": "marijnh@gmail.com", 18 | "web": "http://marijnhaverbeke.nl"}], 19 | "repository": {"type": "git", 20 | "url": "https://github.com/codemirror/CodeMirror.git"} 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/lint/yaml-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml 15 | 16 | // declare global: jsyaml 17 | 18 | CodeMirror.registerHelper("lint", "yaml", function(text) { 19 | var found = []; 20 | try { jsyaml.load(text); } 21 | catch(e) { 22 | var loc = e.mark; 23 | found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message }); 24 | } 25 | return found; 26 | }); 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /src/main/resources/mapper/NftOrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/static/fonts/editormd-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Community 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |
18 |

Error

19 |

Server is overload,please waiting

20 |

Go Home

21 |
22 |
23 |
24 |
25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/TbOrderController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | 4 | import com.wenmrong.community1.community.dto.ResultDTO; 5 | import com.wenmrong.community1.community.service.TbOrderService; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | 14 | /** 15 | *

16 | * 前端控制器 17 | *

18 | * 19 | * @author autodidact 20 | * @since 2022-08-17 21 | */ 22 | @Controller 23 | @RequestMapping("/tb-order") 24 | public class TbOrderController { 25 | private static final Logger log = LoggerFactory.getLogger(TbOrderController.class); 26 | 27 | @Autowired 28 | TbOrderService tbOrderService; 29 | 30 | @RequestMapping("/placeOrder") 31 | public ResultDTO placeOrder() { 32 | tbOrderService.placeOrder(); 33 | return ResultDTO.okOf(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/lint/json-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint 5 | 6 | // declare global: jsonlint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "json", function(text) { 19 | var found = []; 20 | jsonlint.parseError = function(str, hash) { 21 | var loc = hash.loc; 22 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), 23 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), 24 | message: str}); 25 | }; 26 | try { jsonlint.parse(text); } 27 | catch(e) {} 28 | return found; 29 | }); 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/neo.css: -------------------------------------------------------------------------------- 1 | /* neo theme for codemirror */ 2 | 3 | /* Color scheme */ 4 | 5 | .cm-s-neo.CodeMirror { 6 | background-color:#ffffff; 7 | color:#2e383c; 8 | line-height:1.4375; 9 | } 10 | .cm-s-neo .cm-comment {color:#75787b} 11 | .cm-s-neo .cm-keyword, .cm-s-neo .cm-property {color:#1d75b3} 12 | .cm-s-neo .cm-atom,.cm-s-neo .cm-number {color:#75438a} 13 | .cm-s-neo .cm-node,.cm-s-neo .cm-tag {color:#9c3328} 14 | .cm-s-neo .cm-string {color:#b35e14} 15 | .cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier {color:#047d65} 16 | 17 | 18 | /* Editor styling */ 19 | 20 | .cm-s-neo pre { 21 | padding:0; 22 | } 23 | 24 | .cm-s-neo .CodeMirror-gutters { 25 | border:none; 26 | border-right:10px solid transparent; 27 | background-color:transparent; 28 | } 29 | 30 | .cm-s-neo .CodeMirror-linenumber { 31 | padding:0; 32 | color:#e0e2e5; 33 | } 34 | 35 | .cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } 36 | .cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } 37 | 38 | .cm-s-neo div.CodeMirror-cursor { 39 | width: auto; 40 | border: 0; 41 | background: rgba(155,157,162,0.37); 42 | z-index: 1; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 13 | if (prev == CodeMirror.Init) prev = false; 14 | if (prev && !val) 15 | cm.removeOverlay("trailingspace"); 16 | else if (!prev && val) 17 | cm.addOverlay({ 18 | token: function(stream) { 19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 20 | if (i > stream.pos) { stream.pos = i; return null; } 21 | stream.pos = l; 22 | return "trailingspace"; 23 | }, 24 | name: "trailingspace" 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/interceptor/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.interceptor; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | @Configuration 10 | //@EnableWebMvc 11 | public class WebConfig implements WebMvcConfigurer { 12 | @Autowired 13 | private SessionInterceptor sessionInterceptor; 14 | 15 | @Autowired 16 | private LoginInterceptor loginInterceptor; 17 | 18 | @Override 19 | public void addInterceptors(InterceptorRegistry registry) { 20 | registry.addInterceptor(sessionInterceptor).addPathPatterns("/**"); 21 | registry.addInterceptor(loginInterceptor).addPathPatterns("/unstar/**","/profile/star","/profile/replies","/profile/questions","/publish","/wallpaper","/download/**","/profile/questions/delete/**","/thumb/**"); 22 | 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/mq/consumer/QuestionConsumer.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.mq.consumer; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.wenmrong.community1.community.model.Question; 5 | import com.wenmrong.community1.community.service.QuestionService; 6 | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; 7 | import org.apache.rocketmq.spring.core.RocketMQListener; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Component; 12 | 13 | @Component 14 | @RocketMQMessageListener(topic = "question_topic",consumerGroup = "question_consumer") 15 | public class QuestionConsumer implements RocketMQListener { 16 | private static final Logger log = LoggerFactory.getLogger(QuestionConsumer.class); 17 | 18 | @Autowired 19 | QuestionService questionService; 20 | @Override 21 | public void onMessage(Question message) { 22 | questionService.createOrUpdate(message); 23 | log.error("topic:question_topic {}", JSONObject.toJSONString(message)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 by Marijn Haverbeke and others 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/test/java/com/wenmrong/community1/community/TestMyBatisPlus.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community; 2 | 3 | import com.wenmrong.community1.community.utils.SnowFlake; 4 | import com.wenmrong.community1.community.mapper.NftOrderMapper; 5 | import com.wenmrong.community1.community.model.NftOrder; 6 | import org.junit.jupiter.api.Test; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | 9 | import javax.annotation.Resource; 10 | 11 | /** 12 | *

community

13 | *

14 | * 15 | * @author : Autodidact 16 | * @date : 2022-08-14 14:37 17 | **/ 18 | @SpringBootTest 19 | public class TestMyBatisPlus { 20 | static SnowFlake snowFlake = new SnowFlake(2,3); 21 | @Resource 22 | NftOrderMapper nftOrderMapper; 23 | @Test 24 | public void testInsert() { 25 | long id = snowFlake.nextId(); 26 | NftOrder nftOrder = new NftOrder(); 27 | nftOrder.setAddressId("北京"); 28 | nftOrder.setGmtCreate(System.currentTimeMillis()); 29 | nftOrder.setGmtModified(System.currentTimeMillis()); 30 | nftOrder.setId(String.valueOf(id)); 31 | nftOrderMapper.insert(nftOrder); 32 | System.out.println("aa"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/mq/consumer/TransactionConsumer.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.mq.consumer; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.wenmrong.community1.community.model.NftOrder; 5 | import com.wenmrong.community1.community.service.QuestionService; 6 | import org.apache.rocketmq.common.message.Message; 7 | import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; 8 | import org.apache.rocketmq.spring.core.RocketMQListener; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Component; 13 | 14 | @Component 15 | @RocketMQMessageListener(topic = "ts_order_topic",consumerGroup = "ts_order_consumer") 16 | public class TransactionConsumer implements RocketMQListener { 17 | private static final Logger log = LoggerFactory.getLogger(TransactionConsumer.class); 18 | 19 | @Autowired 20 | QuestionService questionService; 21 | 22 | @Override 23 | public void onMessage(NftOrder message) { 24 | //TODO 付款,定时查看订单是否付款 25 | log.error("事务消息:{}", JSONObject.toJSONString(message)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/exception/CustomizeErrorCode.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.exception; 2 | 3 | public enum CustomizeErrorCode implements ICustomizeErrorCode { 4 | //构造方法可以拿到对应的参数 5 | QUESTION_NOT_FOUND(2001, "Your question is null"), 6 | TARGET_PARAM_NOT_FOUND(2002, "Please select questions or answers answer "), 7 | NO_LOGIN(2003, "Not log in"), 8 | SYS_ERROR(2004, "Server overload,please try again"), 9 | TYPE_PARAM_WRONG(2005, "Comment type error"), 10 | COMMENT_NOT_FOUND(2006, "Comment not found"), 11 | COMMENT_IS_EMPTY(2007, "Comment is empty"), 12 | READ_NOTIFICATION_FAIL(2008, "Notification is not for you"), 13 | NOTIFICATION_NOT_FOUND(2009, "Notification is not found"), 14 | FILE_UPLOAD_FAILURE(2010,"File upload failure"); 15 | private String message; 16 | private Integer code; 17 | 18 | @Override 19 | public String getMessage() { 20 | return message; 21 | } 22 | 23 | @Override 24 | public Integer getCode() { 25 | return code; 26 | } 27 | 28 | CustomizeErrorCode(Integer code, String message) { 29 | this.message = message; 30 | this.code = code; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/eclipse.css: -------------------------------------------------------------------------------- 1 | .cm-s-eclipse span.cm-meta {color: #FF1717;} 2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } 3 | .cm-s-eclipse span.cm-atom {color: #219;} 4 | .cm-s-eclipse span.cm-number {color: #164;} 5 | .cm-s-eclipse span.cm-def {color: #00f;} 6 | .cm-s-eclipse span.cm-variable {color: black;} 7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;} 8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;} 9 | .cm-s-eclipse span.cm-property {color: black;} 10 | .cm-s-eclipse span.cm-operator {color: black;} 11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;} 12 | .cm-s-eclipse span.cm-string {color: #2A00FF;} 13 | .cm-s-eclipse span.cm-string-2 {color: #f50;} 14 | .cm-s-eclipse span.cm-qualifier {color: #555;} 15 | .cm-s-eclipse span.cm-builtin {color: #30a;} 16 | .cm-s-eclipse span.cm-bracket {color: #cc7;} 17 | .cm-s-eclipse span.cm-tag {color: #170;} 18 | .cm-s-eclipse span.cm-attribute {color: #00c;} 19 | .cm-s-eclipse span.cm-link {color: #219;} 20 | .cm-s-eclipse span.cm-error {color: #f00;} 21 | 22 | .cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;} 23 | .cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 24 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/lint/css-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on csslint.js from https://github.com/stubbornella/csslint 5 | 6 | // declare global: CSSLint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "css", function(text) { 19 | var found = []; 20 | if (!window.CSSLint) return found; 21 | var results = CSSLint.verify(text), messages = results.messages, message = null; 22 | for ( var i = 0; i < messages.length; i++) { 23 | message = messages[i]; 24 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; 25 | found.push({ 26 | from: CodeMirror.Pos(startLine, startCol), 27 | to: CodeMirror.Pos(endLine, endCol), 28 | message: message.message, 29 | severity : message.type 30 | }); 31 | } 32 | return found; 33 | }); 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/service/StatisticService.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.service; 2 | 3 | import com.wenmrong.community1.community.dto.StatisticData; 4 | import com.wenmrong.community1.community.mapper.CommentMapper; 5 | import com.wenmrong.community1.community.mapper.QuestionMapper; 6 | import com.wenmrong.community1.community.mapper.UserMapper; 7 | import org.springframework.stereotype.Service; 8 | 9 | import javax.annotation.Resource; 10 | 11 | /** 12 | *

community

13 | *

14 | * 15 | * @author : Autodidact 16 | * @date : 2022-08-20 10:04 17 | **/ 18 | @Service 19 | public class StatisticService { 20 | @Resource 21 | UserMapper userMapper; 22 | @Resource 23 | QuestionMapper questionMapper; 24 | @Resource 25 | CommentMapper commentMapper; 26 | public StatisticData statistic() { 27 | Integer usrCount = userMapper.selectCount(null); 28 | Integer questionCount = questionMapper.selectCount(null); 29 | Integer commentCount = commentMapper.selectCount(null); 30 | StatisticData statisticData = new StatisticData(); 31 | statisticData.setUserCount(usrCount); 32 | statisticData.setCommentCount(commentCount); 33 | statisticData.setQuestionCount(questionCount); 34 | return statisticData; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineMode("diff", function() { 15 | 16 | var TOKEN_NAMES = { 17 | '+': 'positive', 18 | '-': 'negative', 19 | '@': 'meta' 20 | }; 21 | 22 | return { 23 | token: function(stream) { 24 | var tw_pos = stream.string.search(/[\t ]+?$/); 25 | 26 | if (!stream.sol() || tw_pos === 0) { 27 | stream.skipToEnd(); 28 | return ("error " + ( 29 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 30 | } 31 | 32 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 33 | 34 | if (tw_pos === -1) { 35 | stream.skipToEnd(); 36 | } else { 37 | stream.pos = tw_pos; 38 | } 39 | 40 | return token_name; 41 | } 42 | }; 43 | }); 44 | 45 | CodeMirror.defineMIME("text/x-diff", "diff"); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/jquery.flowchart.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery.flowchart.js v1.1.0 | jquery.flowchart.min.js | jQuery plugin for flowchart.js. | MIT License | By: Pandao | https://github.com/pandao/jquery.flowchart.js | 2015-03-09 */ 2 | (function(factory){if(typeof require==="function"&&typeof exports==="object"&&typeof module==="object"){module.exports=factory}else{if(typeof define==="function"){factory(jQuery,flowchart)}else{factory($,flowchart)}}}(function(jQuery,flowchart){(function($){$.fn.flowChart=function(options){options=options||{};var defaults={"x":0,"y":0,"line-width":2,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black","fill":"white","yes-text":"yes","no-text":"no","arrow-end":"block","symbols":{"start":{"font-color":"black","element-color":"black","fill":"white"},"end":{"class":"end-element"}},"flowstate":{"past":{"fill":"#CCCCCC","font-size":12},"current":{"fill":"black","font-color":"white","font-weight":"bold"},"future":{"fill":"white"},"request":{"fill":"blue"},"invalid":{"fill":"#444444"},"approved":{"fill":"#58C4A3","font-size":12,"yes-text":"APPROVED","no-text":"n/a"},"rejected":{"fill":"#C45879","font-size":12,"yes-text":"n/a","no-text":"REJECTED"}}};return this.each(function(){var $this=$(this);var diagram=flowchart.parse($this.text());var settings=$.extend(true,defaults,options);$this.html("");diagram.drawSVG(this,settings)})}})(jQuery)})); -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/utils/SecretUtil.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.utils; 2 | 3 | import com.wenmrong.community1.community.config.JasyptProfile; 4 | import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; 5 | import org.jasypt.encryption.pbe.config.EnvironmentPBEConfig; 6 | 7 | /** 8 | * Jasypt 加密工具 9 | * 10 | * @author likai 11 | * @Date 2022/2/14 17:59 12 | */ 13 | public class SecretUtil { 14 | public static final String ALGORITHM = "PBEWithMD5AndDES"; 15 | 16 | 17 | public static String encrypt(String plainText){ 18 | StandardPBEStringEncryptor standardPBEStringEncryptor = secret(); 19 | return standardPBEStringEncryptor.encrypt(plainText); 20 | 21 | } 22 | 23 | public static String decrypt(String encryptedText){ 24 | StandardPBEStringEncryptor standardPBEStringEncryptor = secret(); 25 | return standardPBEStringEncryptor.decrypt(encryptedText); 26 | } 27 | 28 | 29 | private static StandardPBEStringEncryptor secret() { 30 | StandardPBEStringEncryptor standardPBEStringEncryptor = new StandardPBEStringEncryptor(); 31 | EnvironmentPBEConfig config = new EnvironmentPBEConfig(); 32 | config.setAlgorithm(ALGORITHM); 33 | // 加解密的密钥 34 | config.setPassword(JasyptProfile.getSecret()); 35 | standardPBEStringEncryptor.setConfig(config); 36 | return standardPBEStringEncryptor; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/tern/worker.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // declare global: tern, server 5 | 6 | var server; 7 | 8 | this.onmessage = function(e) { 9 | var data = e.data; 10 | switch (data.type) { 11 | case "init": return startServer(data.defs, data.plugins, data.scripts); 12 | case "add": return server.addFile(data.name, data.text); 13 | case "del": return server.delFile(data.name); 14 | case "req": return server.request(data.body, function(err, reqData) { 15 | postMessage({id: data.id, body: reqData, err: err && String(err)}); 16 | }); 17 | case "getFile": 18 | var c = pending[data.id]; 19 | delete pending[data.id]; 20 | return c(data.err, data.text); 21 | default: throw new Error("Unknown message type: " + data.type); 22 | } 23 | }; 24 | 25 | var nextId = 0, pending = {}; 26 | function getFile(file, c) { 27 | postMessage({type: "getFile", name: file, id: ++nextId}); 28 | pending[nextId] = c; 29 | } 30 | 31 | function startServer(defs, plugins, scripts) { 32 | if (scripts) importScripts.apply(null, scripts); 33 | 34 | server = new tern.Server({ 35 | getFile: getFile, 36 | async: true, 37 | defs: defs, 38 | plugins: plugins 39 | }); 40 | } 41 | 42 | var console = { 43 | log: function(v) { postMessage({type: "debug", message: v}); } 44 | }; 45 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/model/NftOrder.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.model; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.baomidou.mybatisplus.extension.activerecord.Model; 6 | import lombok.Data; 7 | import lombok.EqualsAndHashCode; 8 | 9 | /** 10 | *

11 | * 12 | *

13 | * 14 | * @author autodidact 15 | * @since 2022-08-14 16 | */ 17 | @Data 18 | @EqualsAndHashCode(callSuper = false) 19 | @TableName("nft_order") 20 | public class NftOrder extends Model { 21 | 22 | 23 | @TableField("id") 24 | private String id; 25 | 26 | 27 | @TableField("order_num") 28 | private String orderNum; 29 | 30 | 31 | @TableField("pay_order_num") 32 | private String payOrderNum; 33 | 34 | 35 | @TableField("order_amount") 36 | private Double orderAmount; 37 | 38 | 39 | @TableField("invoice") 40 | private Integer invoice; 41 | 42 | 43 | @TableField("invoice_title") 44 | private String invoiceTitle; 45 | 46 | 47 | @TableField("order_remark") 48 | private String orderRemark; 49 | 50 | 51 | @TableField("address_id") 52 | private String addressId; 53 | 54 | @TableField("gmt_create") 55 | private Long gmtCreate; 56 | 57 | @TableField("gmt_modified") 58 | private Long gmtModified; 59 | 60 | 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/ResultDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import com.wenmrong.community1.community.exception.CustomizeErrorCode; 4 | import com.wenmrong.community1.community.exception.CustomizeException; 5 | import lombok.Data; 6 | 7 | @Data 8 | public class ResultDTO { 9 | private Integer code; 10 | private String message; 11 | private T data; 12 | 13 | public static ResultDTO errorOf(Integer code, String message) { 14 | ResultDTO resultDTO = new ResultDTO(); 15 | resultDTO.setCode(code); 16 | resultDTO.setMessage(message); 17 | return resultDTO; 18 | 19 | } 20 | 21 | public static ResultDTO errorOf(CustomizeErrorCode errorCode) { 22 | return errorOf(errorCode.getCode(), errorCode.getMessage()); 23 | } 24 | 25 | public static ResultDTO errorOf(CustomizeException e) { 26 | 27 | return errorOf(e.getCode(), e.getMessage()); 28 | } 29 | 30 | public static ResultDTO okOf() { 31 | ResultDTO resultDTO = new ResultDTO(); 32 | resultDTO.setCode(200); 33 | resultDTO.setMessage("Request success"); 34 | return resultDTO; 35 | } 36 | 37 | public static ResultDTO okOf(T t) { 38 | ResultDTO resultDTO = new ResultDTO(); 39 | resultDTO.setCode(200); 40 | resultDTO.setMessage("Request success"); 41 | resultDTO.setData(t); 42 | return resultDTO; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/lint/coffeescript-lint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js 5 | 6 | // declare global: coffeelint 7 | 8 | (function(mod) { 9 | if (typeof exports == "object" && typeof module == "object") // CommonJS 10 | mod(require("../../lib/codemirror")); 11 | else if (typeof define == "function" && define.amd) // AMD 12 | define(["../../lib/codemirror"], mod); 13 | else // Plain browser env 14 | mod(CodeMirror); 15 | })(function(CodeMirror) { 16 | "use strict"; 17 | 18 | CodeMirror.registerHelper("lint", "coffeescript", function(text) { 19 | var found = []; 20 | var parseError = function(err) { 21 | var loc = err.lineNumber; 22 | found.push({from: CodeMirror.Pos(loc-1, 0), 23 | to: CodeMirror.Pos(loc, 0), 24 | severity: err.level, 25 | message: err.message}); 26 | }; 27 | try { 28 | var res = coffeelint.lint(text); 29 | for(var i = 0; i < res.length; i++) { 30 | parseError(res[i]); 31 | } 32 | } catch(e) { 33 | found.push({from: CodeMirror.Pos(e.location.first_line, 0), 34 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column), 35 | severity: 'error', 36 | message: e.message}); 37 | } 38 | return found; 39 | }); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/interceptor/LoginInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.interceptor; 2 | 3 | import com.wenmrong.community1.community.exception.CustomizeErrorCode; 4 | import com.wenmrong.community1.community.exception.CustomizeException; 5 | import com.wenmrong.community1.community.model.User; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.web.servlet.HandlerInterceptor; 8 | import org.springframework.web.servlet.ModelAndView; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | @Service 13 | public class LoginInterceptor implements HandlerInterceptor { 14 | @Override 15 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 16 | //未登录进行拦截,防止回退历史操作 17 | User user = (User) request.getSession().getAttribute("user"); 18 | if (user == null) { 19 | throw new CustomizeException(CustomizeErrorCode.NO_LOGIN); 20 | } 21 | return true; 22 | } 23 | 24 | @Override 25 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 26 | 27 | } 28 | 29 | @Override 30 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TbOrderMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.wenmrong.community1.community.dto.ResultDTO; 5 | import com.wenmrong.community1.community.mapper.QuestionMapper; 6 | import com.wenmrong.community1.community.model.Question; 7 | import com.wenmrong.community1.community.service.UserService; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.annotation.Resource; 14 | import java.math.BigDecimal; 15 | import java.util.List; 16 | import java.util.Map; 17 | import java.util.stream.Collectors; 18 | 19 | /** 20 | *

community

21 | *

22 | * 23 | * @author : Autodidact 24 | * @date : 2022-08-20 08:52 25 | **/ 26 | @RestController 27 | public class UserController { 28 | @Resource 29 | private UserService userService; 30 | @GetMapping("/getHotAuthorsList") 31 | @ResponseBody 32 | public ResultDTO getHotAuthorsList(@RequestParam(name = "currentPage", defaultValue = "1") Integer currentPage, 33 | @RequestParam(name = "pageSize", defaultValue = "7") Integer pageSize) { 34 | 35 | return ResultDTO.okOf(userService.getHotAuthorsList()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/cache/HotTagCache.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.cache; 2 | 3 | import com.wenmrong.community1.community.dto.HotTagDTO; 4 | import lombok.Data; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.*; 8 | 9 | @Component 10 | @Data 11 | public class HotTagCache { 12 | private List hots = new ArrayList<>(); 13 | 14 | public void sortTags(Map hotTags) { 15 | int max = 5; 16 | PriorityQueue priorityQueue = new PriorityQueue<>(max); 17 | 18 | hotTags.forEach((name , priority) -> { 19 | HotTagDTO hotTagDTO = new HotTagDTO(); 20 | hotTagDTO.setName(name); 21 | hotTagDTO.setPriority(priority); 22 | if (priorityQueue.size() < max) { 23 | priorityQueue.add(hotTagDTO); 24 | }else { 25 | HotTagDTO minHot = priorityQueue.peek(); 26 | if (hotTagDTO.compareTo(minHot) > 0) { 27 | priorityQueue.poll(); 28 | priorityQueue.add(hotTagDTO); 29 | } 30 | } 31 | }); 32 | List sortedTags = new ArrayList<>(); 33 | HotTagDTO poll = priorityQueue.poll(); 34 | while (poll != null) { 35 | sortedTags.add(0, poll.getName()); 36 | poll = priorityQueue.poll(); 37 | } 38 | hots = sortedTags; 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CommentExtMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | update comment 22 | set 23 | COMMENT_COUNT = COMMENT_COUNT + #{commentCount,jdbcType=INTEGER} 24 | where id = #{id} 25 | 26 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/runmode/colorize.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("./runmode")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "./runmode"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; 15 | 16 | function textContent(node, out) { 17 | if (node.nodeType == 3) return out.push(node.nodeValue); 18 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) { 19 | textContent(ch, out); 20 | if (isBlock.test(node.nodeType)) out.push("\n"); 21 | } 22 | } 23 | 24 | CodeMirror.colorize = function(collection, defaultMode) { 25 | if (!collection) collection = document.body.getElementsByTagName("pre"); 26 | 27 | for (var i = 0; i < collection.length; ++i) { 28 | var node = collection[i]; 29 | var mode = node.getAttribute("data-lang") || defaultMode; 30 | if (!mode) continue; 31 | 32 | var text = []; 33 | textContent(node, text); 34 | node.innerHTML = ""; 35 | CodeMirror.runMode(text.join(""), mode, node); 36 | 37 | node.className += " cm-s-default"; 38 | } 39 | }; 40 | }); 41 | -------------------------------------------------------------------------------- /src/main/resources/qqconnectconfig.properties: -------------------------------------------------------------------------------- 1 | app_ID = 101866533 2 | app_KEY = c26cd613606c509efb5ef3a1670d4294 3 | redirect_URI = http://forum.wenmrong.com/qqlogin 4 | scope = get_user_info 5 | baseURL = https://graph.qq.com/ 6 | getUserInfoURL = https://graph.qq.com/user/get_user_info 7 | accessTokenURL = https://graph.qq.com/oauth2.0/token 8 | authorizeURL = https://graph.qq.com/oauth2.0/authorize 9 | getOpenIDURL = https://graph.qq.com/oauth2.0/me 10 | addTopicURL = https://graph.qq.com/shuoshuo/add_topic 11 | addBlogURL = https://graph.qq.com/blog/add_one_blog 12 | addAlbumURL = https://graph.qq.com/photo/add_album 13 | uploadPicURL = https://graph.qq.com/photo/upload_pic 14 | listAlbumURL = https://graph.qq.com/photo/list_album 15 | addShareURL = https://graph.qq.com/share/add_share 16 | checkPageFansURL = https://graph.qq.com/user/check_page_fans 17 | addTURL = https://graph.qq.com/t/add_t 18 | addPicTURL = https://graph.qq.com/t/add_pic_t 19 | delTURL = https://graph.qq.com/t/del_t 20 | getWeiboUserInfoURL = https://graph.qq.com/user/get_info 21 | getWeiboOtherUserInfoURL = https://graph.qq.com/user/get_other_info 22 | getFansListURL = https://graph.qq.com/relation/get_fanslist 23 | getIdolsListURL = https://graph.qq.com/relation/get_idollist 24 | addIdolURL = https://graph.qq.com/relation/add_idol 25 | delIdolURL = https://graph.qq.com/relation/del_idol 26 | getTenpayAddrURL = https://graph.qq.com/cft_info/get_tenpay_addr 27 | getRepostListURL = https://graph.qq.com/t/get_repost_list 28 | version = 2.0.0.0 -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/ntriples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: NTriples mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 28 | 29 |
30 |

NTriples mode

31 |
32 | 39 |
40 | 41 | 44 |

MIME types defined: text/n-triples.

45 |
46 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/spreadsheet/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Spreadsheet mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Spreadsheet mode

28 |
29 | 30 | 37 | 38 |

MIME types defined: text/x-spreadsheet.

39 | 40 |

The Spreadsheet Mode

41 |

Created by Robert Plummer

42 |
43 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/http/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: HTTP mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

HTTP mode

27 | 28 | 29 |
39 | 40 | 43 | 44 |

MIME types defined: message/http.

45 |
46 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/cobalt.css: -------------------------------------------------------------------------------- 1 | .cm-s-cobalt.CodeMirror { background: #002240; color: white; } 2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } 3 | .cm-s-cobalt.CodeMirror ::selection { background: rgba(179, 101, 57, .99); } 4 | .cm-s-cobalt.CodeMirror ::-moz-selection { background: rgba(179, 101, 57, .99); } 5 | .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 6 | .cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; } 7 | .cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 8 | .cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } 9 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } 10 | 11 | .cm-s-cobalt span.cm-comment { color: #08f; } 12 | .cm-s-cobalt span.cm-atom { color: #845dc4; } 13 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } 14 | .cm-s-cobalt span.cm-keyword { color: #ffee80; } 15 | .cm-s-cobalt span.cm-string { color: #3ad900; } 16 | .cm-s-cobalt span.cm-meta { color: #ff9d00; } 17 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } 18 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } 19 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; } 20 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } 21 | .cm-s-cobalt span.cm-link { color: #845dc4; } 22 | .cm-s-cobalt span.cm-error { color: #9d1e15; } 23 | 24 | .cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;} 25 | .cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} 26 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/solr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Solr mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 33 | 34 |
35 |

Solr mode

36 | 37 |
38 | 47 |
48 | 49 | 55 | 56 |

MIME types defined: text/x-solr.

57 |
58 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/z80/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Z80 assembly mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Z80 assembly mode

27 | 28 | 29 |
44 | 45 | 50 | 51 |

MIME type defined: text/x-z80.

52 |
53 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: ECL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

ECL mode

27 |
45 | 48 | 49 |

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

50 |

MIME types defined: text/x-ecl.

51 | 52 |
53 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Rust mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Rust mode

27 | 28 | 29 |
52 | 53 | 58 | 59 |

MIME types defined: text/x-rustsrc.

60 |
61 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/monokai.css: -------------------------------------------------------------------------------- 1 | /* Based on Sublime Text's Monokai theme */ 2 | 3 | .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} 4 | .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} 5 | .cm-s-monokai.CodeMirror ::selection { background: rgba(73, 72, 62, .99); } 6 | .cm-s-monokai.CodeMirror ::-moz-selection { background: rgba(73, 72, 62, .99); } 7 | .cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} 8 | .cm-s-monokai .CodeMirror-guttermarker { color: white; } 9 | .cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 10 | .cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;} 11 | .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} 12 | 13 | .cm-s-monokai span.cm-comment {color: #75715e;} 14 | .cm-s-monokai span.cm-atom {color: #ae81ff;} 15 | .cm-s-monokai span.cm-number {color: #ae81ff;} 16 | 17 | .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} 18 | .cm-s-monokai span.cm-keyword {color: #f92672;} 19 | .cm-s-monokai span.cm-string {color: #e6db74;} 20 | 21 | .cm-s-monokai span.cm-variable {color: #a6e22e;} 22 | .cm-s-monokai span.cm-variable-2 {color: #9effff;} 23 | .cm-s-monokai span.cm-def {color: #fd971f;} 24 | .cm-s-monokai span.cm-bracket {color: #f8f8f2;} 25 | .cm-s-monokai span.cm-tag {color: #f92672;} 26 | .cm-s-monokai span.cm-link {color: #ae81ff;} 27 | .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} 28 | 29 | .cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;} 30 | .cm-s-monokai .CodeMirror-matchingbracket { 31 | text-decoration: underline; 32 | color: white !important; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/rubyblue.css: -------------------------------------------------------------------------------- 1 | .cm-s-rubyblue.CodeMirror { background: #112435; color: white; } 2 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } 3 | .cm-s-rubyblue.CodeMirror ::selection { background: rgba(56, 86, 111, 0.99); } 4 | .cm-s-rubyblue.CodeMirror ::-moz-selection { background: rgba(56, 86, 111, 0.99); } 5 | .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } 6 | .cm-s-rubyblue .CodeMirror-guttermarker { color: white; } 7 | .cm-s-rubyblue .CodeMirror-guttermarker-subtle { color: #3E7087; } 8 | .cm-s-rubyblue .CodeMirror-linenumber { color: white; } 9 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } 10 | 11 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } 12 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; } 13 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } 14 | .cm-s-rubyblue span.cm-keyword { color: #F0F; } 15 | .cm-s-rubyblue span.cm-string { color: #F08047; } 16 | .cm-s-rubyblue span.cm-meta { color: #F0F; } 17 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } 18 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } 19 | .cm-s-rubyblue span.cm-bracket { color: #F0F; } 20 | .cm-s-rubyblue span.cm-link { color: #F4C20B; } 21 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } 22 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } 23 | .cm-s-rubyblue span.cm-error { color: #AF2018; } 24 | 25 | .cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;} 26 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/scroll/simplescrollbars.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div { 2 | position: absolute; 3 | background: #ccc; 4 | -moz-box-sizing: border-box; 5 | box-sizing: border-box; 6 | border: 1px solid #bbb; 7 | border-radius: 2px; 8 | } 9 | 10 | .CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical { 11 | position: absolute; 12 | z-index: 6; 13 | background: #eee; 14 | } 15 | 16 | .CodeMirror-simplescroll-horizontal { 17 | bottom: 0; left: 0; 18 | height: 8px; 19 | } 20 | .CodeMirror-simplescroll-horizontal div { 21 | bottom: 0; 22 | height: 100%; 23 | } 24 | 25 | .CodeMirror-simplescroll-vertical { 26 | right: 0; top: 0; 27 | width: 8px; 28 | } 29 | .CodeMirror-simplescroll-vertical div { 30 | right: 0; 31 | width: 100%; 32 | } 33 | 34 | 35 | .CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler { 36 | display: none; 37 | } 38 | 39 | .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { 40 | position: absolute; 41 | background: #bcd; 42 | border-radius: 3px; 43 | } 44 | 45 | .CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical { 46 | position: absolute; 47 | z-index: 6; 48 | } 49 | 50 | .CodeMirror-overlayscroll-horizontal { 51 | bottom: 0; left: 0; 52 | height: 6px; 53 | } 54 | .CodeMirror-overlayscroll-horizontal div { 55 | bottom: 0; 56 | height: 100%; 57 | } 58 | 59 | .CodeMirror-overlayscroll-vertical { 60 | right: 0; top: 0; 61 | width: 6px; 62 | } 63 | .CodeMirror-overlayscroll-vertical div { 64 | right: 0; 65 | width: 100%; 66 | } 67 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/display/fullscreen.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { 15 | if (old == CodeMirror.Init) old = false; 16 | if (!old == !val) return; 17 | if (val) setFullscreen(cm); 18 | else setNormal(cm); 19 | }); 20 | 21 | function setFullscreen(cm) { 22 | var wrap = cm.getWrapperElement(); 23 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, 24 | width: wrap.style.width, height: wrap.style.height}; 25 | wrap.style.width = ""; 26 | wrap.style.height = "auto"; 27 | wrap.className += " CodeMirror-fullscreen"; 28 | document.documentElement.style.overflow = "hidden"; 29 | cm.refresh(); 30 | } 31 | 32 | function setNormal(cm) { 33 | var wrap = cm.getWrapperElement(); 34 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); 35 | document.documentElement.style.overflow = ""; 36 | var info = cm.state.fullScreenRestore; 37 | wrap.style.width = info.width; wrap.style.height = info.height; 38 | window.scrollTo(info.scrollLeft, info.scrollTop); 39 | cm.refresh(); 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/night.css: -------------------------------------------------------------------------------- 1 | /* Loosely based on the Midnight Textmate theme */ 2 | 3 | .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } 4 | .cm-s-night div.CodeMirror-selected { background: #447 !important; } 5 | .cm-s-night.CodeMirror ::selection { background: rgba(68, 68, 119, .99); } 6 | .cm-s-night.CodeMirror ::-moz-selection { background: rgba(68, 68, 119, .99); } 7 | .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 8 | .cm-s-night .CodeMirror-guttermarker { color: white; } 9 | .cm-s-night .CodeMirror-guttermarker-subtle { color: #bbb; } 10 | .cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } 11 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } 12 | 13 | .cm-s-night span.cm-comment { color: #6900a1; } 14 | .cm-s-night span.cm-atom { color: #845dc4; } 15 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } 16 | .cm-s-night span.cm-keyword { color: #599eff; } 17 | .cm-s-night span.cm-string { color: #37f14a; } 18 | .cm-s-night span.cm-meta { color: #7678e2; } 19 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } 20 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } 21 | .cm-s-night span.cm-bracket { color: #8da6ce; } 22 | .cm-s-night span.cm-comment { color: #6900a1; } 23 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } 24 | .cm-s-night span.cm-link { color: #845dc4; } 25 | .cm-s-night span.cm-error { color: #9d1e15; } 26 | 27 | .cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;} 28 | .cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 29 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/turtle/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Turtle mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Turtle mode

27 |
41 | 47 | 48 |

MIME types defined: text/turtle.

49 | 50 |
51 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/FileController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | import com.wenmrong.community1.community.dto.FileDTO; 4 | import com.wenmrong.community1.community.provider.OssClientAuthorization; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.ResponseBody; 9 | import org.springframework.web.multipart.MultipartFile; 10 | import org.springframework.web.multipart.MultipartHttpServletRequest; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.io.IOException; 14 | 15 | @Controller 16 | public class FileController { 17 | @Autowired 18 | private OssClientAuthorization ossClientAuthorization; 19 | @RequestMapping("/file/upload") 20 | @ResponseBody 21 | public FileDTO upload(HttpServletRequest request){ 22 | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; 23 | MultipartFile file = multipartRequest.getFile("editormd-image-file"); 24 | try { 25 | String urlFileName = ossClientAuthorization.upload(file.getInputStream(),file.getOriginalFilename()); 26 | FileDTO fileDTO = new FileDTO(); 27 | fileDTO.setSuccess(1); 28 | fileDTO.setUrl(urlFileName); 29 | return fileDTO; 30 | } catch (IOException e) { 31 | e.printStackTrace(); 32 | } 33 | FileDTO fileDTO = new FileDTO(); 34 | fileDTO.setSuccess(1); 35 | fileDTO.setUrl("/images/iceman.png"); 36 | return fileDTO; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/scroll/scrollpastend.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { 15 | if (old && old != CodeMirror.Init) { 16 | cm.off("change", onChange); 17 | cm.off("refresh", updateBottomMargin); 18 | cm.display.lineSpace.parentNode.style.paddingBottom = ""; 19 | cm.state.scrollPastEndPadding = null; 20 | } 21 | if (val) { 22 | cm.on("change", onChange); 23 | cm.on("refresh", updateBottomMargin); 24 | updateBottomMargin(cm); 25 | } 26 | }); 27 | 28 | function onChange(cm, change) { 29 | if (CodeMirror.changeEnd(change).line == cm.lastLine()) 30 | updateBottomMargin(cm); 31 | } 32 | 33 | function updateBottomMargin(cm) { 34 | var padding = ""; 35 | if (cm.lineCount() > 1) { 36 | var totalH = cm.display.scroller.clientHeight - 30, 37 | lastLineH = cm.getLineHandle(cm.lastLine()).height; 38 | padding = (totalH - lastLineH) + "px"; 39 | } 40 | if (cm.state.scrollPastEndPadding != padding) { 41 | cm.state.scrollPastEndPadding = padding; 42 | cm.display.lineSpace.parentNode.style.paddingBottom = padding; 43 | cm.setSize(); 44 | } 45 | } 46 | }); 47 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/dto/PaginationDTO.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.dto; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | @Data 9 | public class PaginationDTO { 10 | private List data; 11 | private boolean showFirstPage; 12 | private boolean showEndPage; 13 | private boolean showNext; 14 | private boolean showPrevious; 15 | private Integer page; 16 | private List pages = new ArrayList<>(); 17 | private Integer totalPage; 18 | 19 | public void setPagination(Integer totalPage, Integer page) { 20 | this.totalPage = totalPage; 21 | this.page = page; 22 | pages.add(page); 23 | // 判断page当前页之前是否能显示3页,page之后是否能显示3页,最多可以显示7页 24 | for (int i = 1; i <= 3; i++) { 25 | if (page - i > 0) { 26 | pages.add(0, page - i); 27 | } 28 | if (page + i <= totalPage) { 29 | pages.add(page + i); 30 | } 31 | 32 | 33 | } 34 | 35 | 36 | if (page == 1) { 37 | showPrevious = false; 38 | } else { 39 | showPrevious = true; 40 | } 41 | if (page == totalPage) { 42 | showNext = false; 43 | } else { 44 | showNext = true; 45 | } 46 | if (pages.contains(1)) { 47 | showFirstPage = false; 48 | } else { 49 | showFirstPage = true; 50 | } 51 | if (pages.contains(totalPage)) { 52 | showEndPage = false; 53 | } else { 54 | showEndPage = true; 55 | } 56 | 57 | 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/pascal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pascal mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pascal mode

27 | 28 | 29 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-pascal.

61 |
62 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/NotificationController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | import com.wenmrong.community1.community.dto.NotificationDTO; 4 | import com.wenmrong.community1.community.enums.NotificationTypeEnum; 5 | import com.wenmrong.community1.community.model.User; 6 | import com.wenmrong.community1.community.service.NotificationService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | @Controller 15 | public class NotificationController { 16 | @Autowired 17 | private NotificationService notificationService; 18 | 19 | @GetMapping("/notification/{id}") 20 | public String profile(HttpServletRequest request, 21 | @PathVariable(name = "id") Long id) { 22 | 23 | User user = (User) request.getSession().getAttribute("user"); 24 | if (user == null) { 25 | return "redirect:/"; 26 | } 27 | NotificationDTO notificationDTO = notificationService.read(id, user); 28 | if (NotificationTypeEnum.REPLY_COMMENT.getType() == notificationDTO.getType() 29 | || NotificationTypeEnum.REPLY_QUESTION.getType() == notificationDTO.getType() 30 | || NotificationTypeEnum.THUMB_COMMENT.getType() == notificationDTO.getType()) { 31 | return "redirect:/question/" + notificationDTO.getOuterid(); 32 | 33 | } else { 34 | return "redirect:/"; 35 | } 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/pig/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Pig Latin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Pig Latin mode

27 |
39 | 40 | 47 | 48 |

49 | Simple mode that handles Pig Latin language. 50 |

51 | 52 |

MIME type defined: text/x-pig 53 | (PIG code) 54 | 55 |

56 | -------------------------------------------------------------------------------- /src/main/resources/script/limit.lua: -------------------------------------------------------------------------------- 1 | local function close_redis(red) 2 | if not red then 3 | return 4 | end 5 | --释放连接(连接池实现) 6 | local pool_max_idle_time = 10000 --毫秒 7 | local pool_size = 100 --连接池大小 8 | local ok, err = red:set_keepalive(pool_max_idle_time, pool_size) 9 | if not ok then 10 | ngx.say("set keepalive error : ", err) 11 | end 12 | end 13 | 14 | local function errlog(...) 15 | ngx.log(ngx.ERR, "redis: ", ...) 16 | end 17 | 18 | local redis = require "resty.redis" --引入redis模块 19 | local red = redis:new() --创建一个对象,注意是用冒号调用的 20 | 21 | --设置超时(毫秒) 22 | red:set_timeout(1000) 23 | --建立连接 24 | local ip = "127.0.0.1" 25 | local port = 6379 26 | local ok, err = red:connect(ip, port) 27 | if not ok then 28 | close_redis(red) 29 | errlog("Cannot connect"); 30 | return ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) 31 | end 32 | local auth,err = red:auth("redis123456") 33 | if not auth then 34 | ngx.say("failed to authenticate: ", err) 35 | end 36 | local key = "limit:frequency:login:"..ngx.var.uri 37 | 38 | --得到此客户端IP的频次 39 | local resp, err = red:get(key) 40 | if not resp then 41 | close_redis(red) 42 | return ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) --redis 获取值失败 43 | end 44 | 45 | if resp == ngx.null then 46 | red:set(key, 1) -- 单位时间 第一次访问 47 | red:expire(key, 10) --10秒时间 过期 48 | end 49 | 50 | if type(resp) == "string" then 51 | if tonumber(resp) > 10 then -- 超过10次 52 | close_redis(red) 53 | return ngx.exit(ngx.HTTP_FORBIDDEN) --直接返回403 54 | end 55 | end 56 | 57 | --调用API设置key 58 | ok, err = red:incr(key) 59 | if not ok then 60 | close_redis(red) 61 | return ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) --redis 报错 62 | end 63 | 64 | close_redis(red) 65 | 66 | -------------------------------------------------------------------------------- /src/main/resources/static/js/plugins/test-plugin/test-plugin.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Test plugin for Editor.md 3 | * 4 | * @file test-plugin.js 5 | * @author pandao 6 | * @version 1.2.0 7 | * @updateTime 2015-03-07 8 | * {@link https://github.com/pandao/editor.md} 9 | * @license MIT 10 | */ 11 | 12 | (function() { 13 | 14 | var factory = function (exports) { 15 | 16 | var $ = jQuery; // if using module loader(Require.js/Sea.js). 17 | 18 | exports.testPlugin = function(){ 19 | alert("testPlugin"); 20 | }; 21 | 22 | exports.fn.testPluginMethodA = function() { 23 | /* 24 | var _this = this; // this == the current instance object of Editor.md 25 | var lang = _this.lang; 26 | var settings = _this.settings; 27 | var editor = this.editor; 28 | var cursor = cm.getCursor(); 29 | var selection = cm.getSelection(); 30 | var classPrefix = this.classPrefix; 31 | 32 | cm.focus(); 33 | */ 34 | //.... 35 | 36 | alert("testPluginMethodA"); 37 | }; 38 | 39 | }; 40 | 41 | // CommonJS/Node.js 42 | if (typeof require === "function" && typeof exports === "object" && typeof module === "object") 43 | { 44 | module.exports = factory; 45 | } 46 | else if (typeof define === "function") // AMD/CMD/Sea.js 47 | { 48 | if (define.amd) { // for Require.js 49 | 50 | define(["editormd"], function(editormd) { 51 | factory(editormd); 52 | }); 53 | 54 | } else { // for Sea.js 55 | define(function(require) { 56 | var editormd = require("./../../editormd"); 57 | factory(editormd); 58 | }); 59 | } 60 | } 61 | else 62 | { 63 | factory(window.editormd); 64 | } 65 | 66 | })(); 67 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/WallPaperController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | 7 | import javax.servlet.ServletOutputStream; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.io.*; 11 | import java.net.URL; 12 | import java.net.URLEncoder; 13 | 14 | @Controller 15 | public class WallPaperController { 16 | @GetMapping("/wallpaper") 17 | public String showImages() { 18 | 19 | return "download"; 20 | } 21 | 22 | @GetMapping("/download/{filename}") 23 | public void download(@PathVariable("filename") String filename, 24 | HttpServletRequest request, 25 | HttpServletResponse response) throws IOException { 26 | response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "utf-8")); 27 | String realpath = "http://cdn.wenmrong.com/" + filename; 28 | URL url = new URL(realpath); 29 | DataInputStream dataInputStream = new DataInputStream(url.openStream()); 30 | // FileInputStream fileInputStream = new FileInputStream(realpath); 31 | int len = 0; 32 | byte[] buffer = new byte[1024]; 33 | ServletOutputStream outputStream = response.getOutputStream(); 34 | while ((len = dataInputStream.read(buffer)) > 0) { 35 | 36 | outputStream.write(buffer, 0, len); 37 | } 38 | dataInputStream.close(); 39 | outputStream.close(); 40 | 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/vbscript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: VBScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

VBScript mode

27 | 28 | 29 |
46 | 47 | 53 | 54 |

MIME types defined: text/vbscript.

55 |
56 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/the-matrix.css: -------------------------------------------------------------------------------- 1 | .cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } 2 | .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } 3 | .cm-s-the-matrix.CodeMirror ::selection { background: rgba(45, 45, 45, 0.99); } 4 | .cm-s-the-matrix.CodeMirror ::-moz-selection { background: rgba(45, 45, 45, 0.99); } 5 | .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } 6 | .cm-s-the-matrix .CodeMirror-guttermarker { color: #0f0; } 7 | .cm-s-the-matrix .CodeMirror-guttermarker-subtle { color: white; } 8 | .cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } 9 | .cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; } 10 | 11 | .cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;} 12 | .cm-s-the-matrix span.cm-atom {color: #3FF;} 13 | .cm-s-the-matrix span.cm-number {color: #FFB94F;} 14 | .cm-s-the-matrix span.cm-def {color: #99C;} 15 | .cm-s-the-matrix span.cm-variable {color: #F6C;} 16 | .cm-s-the-matrix span.cm-variable-2 {color: #C6F;} 17 | .cm-s-the-matrix span.cm-variable-3 {color: #96F;} 18 | .cm-s-the-matrix span.cm-property {color: #62FFA0;} 19 | .cm-s-the-matrix span.cm-operator {color: #999} 20 | .cm-s-the-matrix span.cm-comment {color: #CCCCCC;} 21 | .cm-s-the-matrix span.cm-string {color: #39C;} 22 | .cm-s-the-matrix span.cm-meta {color: #C9F;} 23 | .cm-s-the-matrix span.cm-qualifier {color: #FFF700;} 24 | .cm-s-the-matrix span.cm-builtin {color: #30a;} 25 | .cm-s-the-matrix span.cm-bracket {color: #cc7;} 26 | .cm-s-the-matrix span.cm-tag {color: #FFBD40;} 27 | .cm-s-the-matrix span.cm-attribute {color: #FFF700;} 28 | .cm-s-the-matrix span.cm-error {color: #FF0000;} 29 | 30 | .cm-s-the-matrix .CodeMirror-activeline-background {background: #040;} 31 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/gherkin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Gherkin mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Gherkin mode

27 |
42 | 45 | 46 |

MIME types defined: text/x-feature.

47 | 48 |
49 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/properties/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Properties files mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Properties files mode

27 |
46 | 49 | 50 |

MIME types defined: text/x-properties, 51 | text/x-ini.

52 | 53 |
54 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/service/impl/TbOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.service.impl; 2 | 3 | import com.wenmrong.community1.community.model.TbOrder; 4 | import com.wenmrong.community1.community.mapper.TbOrderMapper; 5 | import com.wenmrong.community1.community.service.TbOrderService; 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 7 | import com.wenmrong.community1.community.utils.SnowFlake; 8 | import org.apache.rocketmq.spring.core.RocketMQTemplate; 9 | import org.apache.rocketmq.spring.support.RocketMQHeaders; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.messaging.Message; 14 | import org.springframework.messaging.support.MessageBuilder; 15 | import org.springframework.stereotype.Service; 16 | 17 | /** 18 | *

19 | * 服务实现类 20 | *

21 | * 22 | * @author autodidact 23 | * @since 2022-08-17 24 | */ 25 | @Service 26 | public class TbOrderServiceImpl extends ServiceImpl implements TbOrderService { 27 | private static final Logger log = LoggerFactory.getLogger(TbOrderServiceImpl.class); 28 | 29 | static SnowFlake snowFlake = new SnowFlake(2, 3); 30 | 31 | @Autowired 32 | private RocketMQTemplate rocketMQTemplate; 33 | 34 | 35 | 36 | public void placeOrder() { 37 | final long id = snowFlake.nextId(); 38 | TbOrder order = new TbOrder(); 39 | order.setOrderId(String.valueOf(id)); 40 | Message message = MessageBuilder.withPayload(order) 41 | .setHeader(RocketMQHeaders.TRANSACTION_ID, String.valueOf(id)) 42 | .build(); 43 | rocketMQTemplate.sendMessageInTransaction("ts_order_topic",message,null); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/colorforth.css: -------------------------------------------------------------------------------- 1 | .cm-s-colorforth.CodeMirror { background: #000000; color: #f8f8f8; } 2 | .cm-s-colorforth .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 3 | .cm-s-colorforth .CodeMirror-guttermarker { color: #FFBD40; } 4 | .cm-s-colorforth .CodeMirror-guttermarker-subtle { color: #78846f; } 5 | .cm-s-colorforth .CodeMirror-linenumber { color: #bababa; } 6 | .cm-s-colorforth .CodeMirror-cursor { border-left: 1px solid white !important; } 7 | 8 | .cm-s-colorforth span.cm-comment { color: #ededed; } 9 | .cm-s-colorforth span.cm-def { color: #ff1c1c; font-weight:bold; } 10 | .cm-s-colorforth span.cm-keyword { color: #ffd900; } 11 | .cm-s-colorforth span.cm-builtin { color: #00d95a; } 12 | .cm-s-colorforth span.cm-variable { color: #73ff00; } 13 | .cm-s-colorforth span.cm-string { color: #007bff; } 14 | .cm-s-colorforth span.cm-number { color: #00c4ff; } 15 | .cm-s-colorforth span.cm-atom { color: #606060; } 16 | 17 | .cm-s-colorforth span.cm-variable-2 { color: #EEE; } 18 | .cm-s-colorforth span.cm-variable-3 { color: #DDD; } 19 | .cm-s-colorforth span.cm-property {} 20 | .cm-s-colorforth span.cm-operator {} 21 | 22 | .cm-s-colorforth span.cm-meta { color: yellow; } 23 | .cm-s-colorforth span.cm-qualifier { color: #FFF700; } 24 | .cm-s-colorforth span.cm-bracket { color: #cc7; } 25 | .cm-s-colorforth span.cm-tag { color: #FFBD40; } 26 | .cm-s-colorforth span.cm-attribute { color: #FFF700; } 27 | .cm-s-colorforth span.cm-error { color: #f00; } 28 | 29 | .cm-s-colorforth .CodeMirror-selected { background: #333d53 !important; } 30 | 31 | .cm-s-colorforth span.cm-compilation { background: rgba(255, 255, 255, 0.12); } 32 | 33 | .cm-s-colorforth .CodeMirror-activeline-background {background: #253540 !important;} 34 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/CustomizeErrorController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | import org.springframework.boot.web.servlet.error.ErrorController; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.http.MediaType; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.servlet.ModelAndView; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | @Controller 14 | @RequestMapping("${server.error.path:${error.path:/error}}") 15 | public class CustomizeErrorController implements ErrorController { 16 | 17 | @Override 18 | public String getErrorPath() { 19 | return "error"; 20 | } 21 | 22 | @RequestMapping(produces = MediaType.TEXT_HTML_VALUE) 23 | public ModelAndView errorHtml(HttpServletRequest request, Model model) { 24 | HttpStatus status = getStatus(request); 25 | if (status.is4xxClientError()) { 26 | model.addAttribute("message", "Your request failed"); 27 | } 28 | if (status.is5xxServerError()) { 29 | model.addAttribute("message", "Server overload"); 30 | } 31 | return new ModelAndView("error"); 32 | } 33 | 34 | private HttpStatus getStatus(HttpServletRequest request) { 35 | Integer statusCode = (Integer) request 36 | .getAttribute("javax.servlet.error.status_code"); 37 | if (statusCode == null) { 38 | return HttpStatus.INTERNAL_SERVER_ERROR; 39 | } 40 | try { 41 | return HttpStatus.valueOf(statusCode); 42 | } catch (Exception ex) { 43 | return HttpStatus.INTERNAL_SERVER_ERROR; 44 | } 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/fold/indent-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.registerHelper("fold", "indent", function(cm, start) { 15 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); 16 | if (!/\S/.test(firstLine)) return; 17 | var getIndent = function(line) { 18 | return CodeMirror.countColumn(line, null, tabSize); 19 | }; 20 | var myIndent = getIndent(firstLine); 21 | var lastLineInFold = null; 22 | // Go through lines until we find a line that definitely doesn't belong in 23 | // the block we're folding, or to the end. 24 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { 25 | var curLine = cm.getLine(i); 26 | var curIndent = getIndent(curLine); 27 | if (curIndent > myIndent) { 28 | // Lines with a greater indent are considered part of the block. 29 | lastLineInFold = i; 30 | } else if (!/\S/.test(curLine)) { 31 | // Empty lines might be breaks within the block we're trying to fold. 32 | } else { 33 | // A non-empty line at an indent equal to or less than ours marks the 34 | // start of another block. 35 | break; 36 | } 37 | } 38 | if (lastLineInFold) return { 39 | from: CodeMirror.Pos(start.line, firstLine.length), 40 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) 41 | }; 42 | }); 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/fold/markdown-fold.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | CodeMirror.registerHelper("fold", "markdown", function(cm, start) { 15 | var maxDepth = 100; 16 | 17 | function isHeader(lineNo) { 18 | var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); 19 | return tokentype && /\bheader\b/.test(tokentype); 20 | } 21 | 22 | function headerLevel(lineNo, line, nextLine) { 23 | var match = line && line.match(/^#+/); 24 | if (match && isHeader(lineNo)) return match[0].length; 25 | match = nextLine && nextLine.match(/^[=\-]+\s*$/); 26 | if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; 27 | return maxDepth; 28 | } 29 | 30 | var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); 31 | var level = headerLevel(start.line, firstLine, nextLine); 32 | if (level === maxDepth) return undefined; 33 | 34 | var lastLineNo = cm.lastLine(); 35 | var end = start.line, nextNextLine = cm.getLine(end + 2); 36 | while (end < lastLineNo) { 37 | if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; 38 | ++end; 39 | nextLine = nextNextLine; 40 | nextNextLine = cm.getLine(end + 2); 41 | } 42 | 43 | return { 44 | from: CodeMirror.Pos(start.line, firstLine.length), 45 | to: CodeMirror.Pos(end, cm.getLine(end).length) 46 | }; 47 | }); 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/javascript/typescript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: TypeScript mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

TypeScript mode

27 | 28 | 29 |
51 | 52 | 59 | 60 |

This is a specialization of the JavaScript mode.

61 |
62 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/blackboard.css: -------------------------------------------------------------------------------- 1 | /* Port of TextMate's Blackboard theme */ 2 | 3 | .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } 4 | .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } 5 | .cm-s-blackboard.CodeMirror ::selection { background: rgba(37, 59, 118, .99); } 6 | .cm-s-blackboard.CodeMirror ::-moz-selection { background: rgba(37, 59, 118, .99); } 7 | .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } 8 | .cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } 9 | .cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } 10 | .cm-s-blackboard .CodeMirror-linenumber { color: #888; } 11 | .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } 12 | 13 | .cm-s-blackboard .cm-keyword { color: #FBDE2D; } 14 | .cm-s-blackboard .cm-atom { color: #D8FA3C; } 15 | .cm-s-blackboard .cm-number { color: #D8FA3C; } 16 | .cm-s-blackboard .cm-def { color: #8DA6CE; } 17 | .cm-s-blackboard .cm-variable { color: #FF6400; } 18 | .cm-s-blackboard .cm-operator { color: #FBDE2D;} 19 | .cm-s-blackboard .cm-comment { color: #AEAEAE; } 20 | .cm-s-blackboard .cm-string { color: #61CE3C; } 21 | .cm-s-blackboard .cm-string-2 { color: #61CE3C; } 22 | .cm-s-blackboard .cm-meta { color: #D8FA3C; } 23 | .cm-s-blackboard .cm-builtin { color: #8DA6CE; } 24 | .cm-s-blackboard .cm-tag { color: #8DA6CE; } 25 | .cm-s-blackboard .cm-attribute { color: #8DA6CE; } 26 | .cm-s-blackboard .cm-header { color: #FF6400; } 27 | .cm-s-blackboard .cm-hr { color: #AEAEAE; } 28 | .cm-s-blackboard .cm-link { color: #8DA6CE; } 29 | .cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } 30 | 31 | .cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;} 32 | .cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/hint/anyword-hint.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var WORD = /[\w$]+/, RANGE = 500; 15 | 16 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) { 17 | var word = options && options.word || WORD; 18 | var range = options && options.range || RANGE; 19 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line); 20 | var end = cur.ch, start = end; 21 | while (start && word.test(curLine.charAt(start - 1))) --start; 22 | var curWord = start != end && curLine.slice(start, end); 23 | 24 | var list = [], seen = {}; 25 | var re = new RegExp(word.source, "g"); 26 | for (var dir = -1; dir <= 1; dir += 2) { 27 | var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; 28 | for (; line != endLine; line += dir) { 29 | var text = editor.getLine(line), m; 30 | while (m = re.exec(text)) { 31 | if (line == cur.line && m[0] === curWord) continue; 32 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { 33 | seen[m[0]] = true; 34 | list.push(m[0]); 35 | } 36 | } 37 | } 38 | } 39 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/sass/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Sass mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

Sass mode

28 |
58 | 64 | 65 |

MIME types defined: text/x-sass.

66 |
67 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/perl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Perl mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Perl mode

27 | 28 | 29 |
67 | 68 | 73 | 74 |

MIME types defined: text/x-perl.

75 |
76 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/3024-day.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: 3024 day 4 | Author: Jan T. Sott (http://github.com/idleberg) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;} 12 | .cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;} 13 | .cm-s-3024-day.CodeMirror ::selection { background: #d6d5d4; } 14 | .cm-s-3024-day.CodeMirror ::-moz-selection { background: #d9d9d9; } 15 | 16 | .cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;} 17 | .cm-s-3024-day .CodeMirror-guttermarker { color: #db2d20; } 18 | .cm-s-3024-day .CodeMirror-guttermarker-subtle { color: #807d7c; } 19 | .cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;} 20 | 21 | .cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;} 22 | 23 | .cm-s-3024-day span.cm-comment {color: #cdab53;} 24 | .cm-s-3024-day span.cm-atom {color: #a16a94;} 25 | .cm-s-3024-day span.cm-number {color: #a16a94;} 26 | 27 | .cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;} 28 | .cm-s-3024-day span.cm-keyword {color: #db2d20;} 29 | .cm-s-3024-day span.cm-string {color: #fded02;} 30 | 31 | .cm-s-3024-day span.cm-variable {color: #01a252;} 32 | .cm-s-3024-day span.cm-variable-2 {color: #01a0e4;} 33 | .cm-s-3024-day span.cm-def {color: #e8bbd0;} 34 | .cm-s-3024-day span.cm-bracket {color: #3a3432;} 35 | .cm-s-3024-day span.cm-tag {color: #db2d20;} 36 | .cm-s-3024-day span.cm-link {color: #a16a94;} 37 | .cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;} 38 | 39 | .cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;} 40 | .cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: #a16a94 !important;} 41 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/idl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: IDL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

IDL mode

27 | 28 |
52 | 62 | 63 |

MIME types defined: text/x-idl.

64 |
65 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/tomorrow-night-bright.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Tomorrow Night - Bright 4 | Author: Chris Kempson 5 | 6 | Port done by Gerard Braad 7 | 8 | */ 9 | 10 | .cm-s-tomorrow-night-bright.CodeMirror {background: #000000; color: #eaeaea;} 11 | .cm-s-tomorrow-night-bright div.CodeMirror-selected {background: #424242 !important;} 12 | .cm-s-tomorrow-night-bright .CodeMirror-gutters {background: #000000; border-right: 0px;} 13 | .cm-s-tomorrow-night-bright .CodeMirror-guttermarker { color: #e78c45; } 14 | .cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle { color: #777; } 15 | .cm-s-tomorrow-night-bright .CodeMirror-linenumber {color: #424242;} 16 | .cm-s-tomorrow-night-bright .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} 17 | 18 | .cm-s-tomorrow-night-bright span.cm-comment {color: #d27b53;} 19 | .cm-s-tomorrow-night-bright span.cm-atom {color: #a16a94;} 20 | .cm-s-tomorrow-night-bright span.cm-number {color: #a16a94;} 21 | 22 | .cm-s-tomorrow-night-bright span.cm-property, .cm-s-tomorrow-night-bright span.cm-attribute {color: #99cc99;} 23 | .cm-s-tomorrow-night-bright span.cm-keyword {color: #d54e53;} 24 | .cm-s-tomorrow-night-bright span.cm-string {color: #e7c547;} 25 | 26 | .cm-s-tomorrow-night-bright span.cm-variable {color: #b9ca4a;} 27 | .cm-s-tomorrow-night-bright span.cm-variable-2 {color: #7aa6da;} 28 | .cm-s-tomorrow-night-bright span.cm-def {color: #e78c45;} 29 | .cm-s-tomorrow-night-bright span.cm-bracket {color: #eaeaea;} 30 | .cm-s-tomorrow-night-bright span.cm-tag {color: #d54e53;} 31 | .cm-s-tomorrow-night-bright span.cm-link {color: #a16a94;} 32 | .cm-s-tomorrow-night-bright span.cm-error {background: #d54e53; color: #6A6A6A;} 33 | 34 | .cm-s-tomorrow-night-bright .CodeMirror-activeline-background {background: #2a2a2a !important;} 35 | .cm-s-tomorrow-night-bright .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 36 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/dart/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Dart mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Dart mode

27 |
28 | 62 |
63 | 64 | 70 | 71 |
72 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/paraiso-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Paraíso (Light) 4 | Author: Jan T. Sott 5 | 6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) 7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br) 8 | 9 | */ 10 | 11 | .cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} 12 | .cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} 13 | .cm-s-paraiso-light.CodeMirror ::selection { background: #b9b6b0; } 14 | .cm-s-paraiso-light.CodeMirror ::-moz-selection { background: #b9b6b0; } 15 | .cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} 16 | .cm-s-paraiso-light .CodeMirror-guttermarker { color: black; } 17 | .cm-s-paraiso-light .CodeMirror-guttermarker-subtle { color: #8d8687; } 18 | .cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;} 19 | .cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;} 20 | 21 | .cm-s-paraiso-light span.cm-comment {color: #e96ba8;} 22 | .cm-s-paraiso-light span.cm-atom {color: #815ba4;} 23 | .cm-s-paraiso-light span.cm-number {color: #815ba4;} 24 | 25 | .cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;} 26 | .cm-s-paraiso-light span.cm-keyword {color: #ef6155;} 27 | .cm-s-paraiso-light span.cm-string {color: #fec418;} 28 | 29 | .cm-s-paraiso-light span.cm-variable {color: #48b685;} 30 | .cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;} 31 | .cm-s-paraiso-light span.cm-def {color: #f99b15;} 32 | .cm-s-paraiso-light span.cm-bracket {color: #41323f;} 33 | .cm-s-paraiso-light span.cm-tag {color: #ef6155;} 34 | .cm-s-paraiso-light span.cm-link {color: #815ba4;} 35 | .cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;} 36 | 37 | .cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;} 38 | .cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 39 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/addon/edit/continuelist.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)\.)(\s*)/, 15 | emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)\.)(\s*)$/, 16 | unorderedListRE = /[*+-]\s/; 17 | 18 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { 19 | if (cm.getOption("disableInput")) return CodeMirror.Pass; 20 | var ranges = cm.listSelections(), replacements = []; 21 | for (var i = 0; i < ranges.length; i++) { 22 | var pos = ranges[i].head, match; 23 | var eolState = cm.getStateAfter(pos.line); 24 | var inList = eolState.list !== false; 25 | var inQuote = eolState.quote !== false; 26 | 27 | if (!ranges[i].empty() || (!inList && !inQuote) || !(match = cm.getLine(pos.line).match(listRE))) { 28 | cm.execCommand("newlineAndIndent"); 29 | return; 30 | } 31 | if (cm.getLine(pos.line).match(emptyListRE)) { 32 | cm.replaceRange("", { 33 | line: pos.line, ch: 0 34 | }, { 35 | line: pos.line, ch: pos.ch + 1 36 | }); 37 | replacements[i] = "\n"; 38 | 39 | } else { 40 | var indent = match[1], after = match[4]; 41 | var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 42 | ? match[2] 43 | : (parseInt(match[3], 10) + 1) + "."; 44 | 45 | replacements[i] = "\n" + indent + bullet + after; 46 | } 47 | } 48 | 49 | cm.replaceSelections(replacements); 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/xml/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml"; 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); } 7 | 8 | MT("matching", 9 | "[tag&bracket <][tag top][tag&bracket >]", 10 | " text", 11 | " [tag&bracket <][tag inner][tag&bracket />]", 12 | "[tag&bracket ]"); 13 | 14 | MT("nonmatching", 15 | "[tag&bracket <][tag top][tag&bracket >]", 16 | " [tag&bracket <][tag inner][tag&bracket />]", 17 | " [tag&bracket ]"); 18 | 19 | MT("doctype", 20 | "[meta ]", 21 | "[tag&bracket <][tag top][tag&bracket />]"); 22 | 23 | MT("cdata", 24 | "[tag&bracket <][tag top][tag&bracket >]", 25 | " [atom ]", 27 | "[tag&bracket ]"); 28 | 29 | // HTML tests 30 | mode = CodeMirror.getMode({indentUnit: 2}, "text/html"); 31 | 32 | MT("selfclose", 33 | "[tag&bracket <][tag html][tag&bracket >]", 34 | " [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]", 35 | "[tag&bracket ]"); 36 | 37 | MT("list", 38 | "[tag&bracket <][tag ol][tag&bracket >]", 39 | " [tag&bracket <][tag li][tag&bracket >]one", 40 | " [tag&bracket <][tag li][tag&bracket >]two", 41 | "[tag&bracket ]"); 42 | 43 | MT("valueless", 44 | "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]"); 45 | 46 | MT("pThenArticle", 47 | "[tag&bracket <][tag p][tag&bracket >]", 48 | " foo", 49 | "[tag&bracket <][tag article][tag&bracket >]bar"); 50 | 51 | })(); 52 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/paraiso-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Paraíso (Dark) 4 | Author: Jan T. Sott 5 | 6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) 7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br) 8 | 9 | */ 10 | 11 | .cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} 12 | .cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} 13 | .cm-s-paraiso-dark.CodeMirror ::selection { background: rgba(65, 50, 63, .99); } 14 | .cm-s-paraiso-dark.CodeMirror ::-moz-selection { background: rgba(65, 50, 63, .99); } 15 | .cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} 16 | .cm-s-paraiso-dark .CodeMirror-guttermarker { color: #ef6155; } 17 | .cm-s-paraiso-dark .CodeMirror-guttermarker-subtle { color: #776e71; } 18 | .cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;} 19 | .cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;} 20 | 21 | .cm-s-paraiso-dark span.cm-comment {color: #e96ba8;} 22 | .cm-s-paraiso-dark span.cm-atom {color: #815ba4;} 23 | .cm-s-paraiso-dark span.cm-number {color: #815ba4;} 24 | 25 | .cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;} 26 | .cm-s-paraiso-dark span.cm-keyword {color: #ef6155;} 27 | .cm-s-paraiso-dark span.cm-string {color: #fec418;} 28 | 29 | .cm-s-paraiso-dark span.cm-variable {color: #48b685;} 30 | .cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;} 31 | .cm-s-paraiso-dark span.cm-def {color: #f99b15;} 32 | .cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;} 33 | .cm-s-paraiso-dark span.cm-tag {color: #ef6155;} 34 | .cm-s-paraiso-dark span.cm-link {color: #815ba4;} 35 | .cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;} 36 | 37 | .cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;} 38 | .cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 39 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/3024-night.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: 3024 night 4 | Author: Jan T. Sott (http://github.com/idleberg) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;} 12 | .cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;} 13 | .cm-s-3024-night.CodeMirror ::selection { background: rgba(58, 52, 50, .99); } 14 | .cm-s-3024-night.CodeMirror ::-moz-selection { background: rgba(58, 52, 50, .99); } 15 | .cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;} 16 | .cm-s-3024-night .CodeMirror-guttermarker { color: #db2d20; } 17 | .cm-s-3024-night .CodeMirror-guttermarker-subtle { color: #5c5855; } 18 | .cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;} 19 | 20 | .cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;} 21 | 22 | .cm-s-3024-night span.cm-comment {color: #cdab53;} 23 | .cm-s-3024-night span.cm-atom {color: #a16a94;} 24 | .cm-s-3024-night span.cm-number {color: #a16a94;} 25 | 26 | .cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;} 27 | .cm-s-3024-night span.cm-keyword {color: #db2d20;} 28 | .cm-s-3024-night span.cm-string {color: #fded02;} 29 | 30 | .cm-s-3024-night span.cm-variable {color: #01a252;} 31 | .cm-s-3024-night span.cm-variable-2 {color: #01a0e4;} 32 | .cm-s-3024-night span.cm-def {color: #e8bbd0;} 33 | .cm-s-3024-night span.cm-bracket {color: #d6d5d4;} 34 | .cm-s-3024-night span.cm-tag {color: #db2d20;} 35 | .cm-s-3024-night span.cm-link {color: #a16a94;} 36 | .cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;} 37 | 38 | .cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;} 39 | .cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 40 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/jinja2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Jinja2 mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 |
26 |

Jinja2 mode

27 |
49 | 54 |
55 | -------------------------------------------------------------------------------- /src/main/resources/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 |
35 |
36 |
37 | 38 |
39 |
-------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/css/less_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); 8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } 9 | 10 | MT("variable", 11 | "[variable-2 @base]: [atom #f04615];", 12 | "[qualifier .class] {", 13 | " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", 14 | " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", 15 | "}"); 16 | 17 | MT("amp", 18 | "[qualifier .child], [qualifier .sibling] {", 19 | " [qualifier .parent] [atom &] {", 20 | " [property color]: [keyword black];", 21 | " }", 22 | " [atom &] + [atom &] {", 23 | " [property color]: [keyword red];", 24 | " }", 25 | "}"); 26 | 27 | MT("mixin", 28 | "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", 29 | " [property color]: [variable darken]([variable-2 @color], [number 10%]);", 30 | "}", 31 | "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", 32 | " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", 33 | "}", 34 | "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", 35 | " [property display]: [atom block];", 36 | "}", 37 | "[variable-2 @switch]: [variable light];", 38 | "[qualifier .class] {", 39 | " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", 40 | "}"); 41 | 42 | MT("nest", 43 | "[qualifier .one] {", 44 | " [def @media] ([property width]: [number 400px]) {", 45 | " [property font-size]: [number 1.2em];", 46 | " [def @media] [attribute print] [keyword and] [property color] {", 47 | " [property color]: [keyword blue];", 48 | " }", 49 | " }", 50 | "}"); 51 | })(); 52 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/base16-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Base16 Default Dark 4 | Author: Chris Kempson (http://chriskempson.com) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;} 12 | .cm-s-base16-dark div.CodeMirror-selected {background: #303030 !important;} 13 | .cm-s-base16-dark.CodeMirror ::selection { background: rgba(48, 48, 48, .99); } 14 | .cm-s-base16-dark.CodeMirror ::-moz-selection { background: rgba(48, 48, 48, .99); } 15 | .cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;} 16 | .cm-s-base16-dark .CodeMirror-guttermarker { color: #ac4142; } 17 | .cm-s-base16-dark .CodeMirror-guttermarker-subtle { color: #505050; } 18 | .cm-s-base16-dark .CodeMirror-linenumber {color: #505050;} 19 | .cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;} 20 | 21 | .cm-s-base16-dark span.cm-comment {color: #8f5536;} 22 | .cm-s-base16-dark span.cm-atom {color: #aa759f;} 23 | .cm-s-base16-dark span.cm-number {color: #aa759f;} 24 | 25 | .cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;} 26 | .cm-s-base16-dark span.cm-keyword {color: #ac4142;} 27 | .cm-s-base16-dark span.cm-string {color: #f4bf75;} 28 | 29 | .cm-s-base16-dark span.cm-variable {color: #90a959;} 30 | .cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;} 31 | .cm-s-base16-dark span.cm-def {color: #d28445;} 32 | .cm-s-base16-dark span.cm-bracket {color: #e0e0e0;} 33 | .cm-s-base16-dark span.cm-tag {color: #ac4142;} 34 | .cm-s-base16-dark span.cm-link {color: #aa759f;} 35 | .cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;} 36 | 37 | .cm-s-base16-dark .CodeMirror-activeline-background {background: #202020 !important;} 38 | .cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 39 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/base16-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Base16 Default Light 4 | Author: Chris Kempson (http://chriskempson.com) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;} 12 | .cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;} 13 | .cm-s-base16-light.CodeMirror ::selection { background: #e0e0e0; } 14 | .cm-s-base16-light.CodeMirror ::-moz-selection { background: #e0e0e0; } 15 | .cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;} 16 | .cm-s-base16-light .CodeMirror-guttermarker { color: #ac4142; } 17 | .cm-s-base16-light .CodeMirror-guttermarker-subtle { color: #b0b0b0; } 18 | .cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;} 19 | .cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;} 20 | 21 | .cm-s-base16-light span.cm-comment {color: #8f5536;} 22 | .cm-s-base16-light span.cm-atom {color: #aa759f;} 23 | .cm-s-base16-light span.cm-number {color: #aa759f;} 24 | 25 | .cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;} 26 | .cm-s-base16-light span.cm-keyword {color: #ac4142;} 27 | .cm-s-base16-light span.cm-string {color: #f4bf75;} 28 | 29 | .cm-s-base16-light span.cm-variable {color: #90a959;} 30 | .cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;} 31 | .cm-s-base16-light span.cm-def {color: #d28445;} 32 | .cm-s-base16-light span.cm-bracket {color: #202020;} 33 | .cm-s-base16-light span.cm-tag {color: #ac4142;} 34 | .cm-s-base16-light span.cm-link {color: #aa759f;} 35 | .cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;} 36 | 37 | .cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;} 38 | .cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 39 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/mbo.css: -------------------------------------------------------------------------------- 1 | /****************************************************************/ 2 | /* Based on mbonaci's Brackets mbo theme */ 3 | /* https://github.com/mbonaci/global/blob/master/Mbo.tmTheme */ 4 | /* Create your own: http://tmtheme-editor.herokuapp.com */ 5 | /****************************************************************/ 6 | 7 | .cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffec;} 8 | .cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;} 9 | .cm-s-mbo.CodeMirror ::selection { background: rgba(113, 108, 98, .99); } 10 | .cm-s-mbo.CodeMirror ::-moz-selection { background: rgba(113, 108, 98, .99); } 11 | .cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;} 12 | .cm-s-mbo .CodeMirror-guttermarker { color: white; } 13 | .cm-s-mbo .CodeMirror-guttermarker-subtle { color: grey; } 14 | .cm-s-mbo .CodeMirror-linenumber {color: #dadada;} 15 | .cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;} 16 | 17 | .cm-s-mbo span.cm-comment {color: #95958a;} 18 | .cm-s-mbo span.cm-atom {color: #00a8c6;} 19 | .cm-s-mbo span.cm-number {color: #00a8c6;} 20 | 21 | .cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;} 22 | .cm-s-mbo span.cm-keyword {color: #ffb928;} 23 | .cm-s-mbo span.cm-string {color: #ffcf6c;} 24 | .cm-s-mbo span.cm-string.cm-property {color: #ffffec;} 25 | 26 | .cm-s-mbo span.cm-variable {color: #ffffec;} 27 | .cm-s-mbo span.cm-variable-2 {color: #00a8c6;} 28 | .cm-s-mbo span.cm-def {color: #ffffec;} 29 | .cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;} 30 | .cm-s-mbo span.cm-tag {color: #9ddfe9;} 31 | .cm-s-mbo span.cm-link {color: #f54b07;} 32 | .cm-s-mbo span.cm-error {border-bottom: #636363; color: #ffffec;} 33 | .cm-s-mbo span.cm-qualifier {color: #ffffec;} 34 | 35 | .cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;} 36 | .cm-s-mbo .CodeMirror-matchingbracket {color: #222 !important;} 37 | .cm-s-mbo .CodeMirror-matchingtag {background: rgba(255, 255, 255, .37);} 38 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/vibrant-ink.css: -------------------------------------------------------------------------------- 1 | /* Taken from the popular Visual Studio Vibrant Ink Schema */ 2 | 3 | .cm-s-vibrant-ink.CodeMirror { background: black; color: white; } 4 | .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } 5 | .cm-s-vibrant-ink.CodeMirror ::selection { background: rgba(53, 73, 60, 0.99); } 6 | .cm-s-vibrant-ink.CodeMirror ::-moz-selection { background: rgba(53, 73, 60, 0.99); } 7 | 8 | .cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 9 | .cm-s-vibrant-ink .CodeMirror-guttermarker { color: white; } 10 | .cm-s-vibrant-ink .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 11 | .cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; } 12 | .cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } 13 | 14 | .cm-s-vibrant-ink .cm-keyword { color: #CC7832; } 15 | .cm-s-vibrant-ink .cm-atom { color: #FC0; } 16 | .cm-s-vibrant-ink .cm-number { color: #FFEE98; } 17 | .cm-s-vibrant-ink .cm-def { color: #8DA6CE; } 18 | .cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D } 19 | .cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D } 20 | .cm-s-vibrant-ink .cm-operator { color: #888; } 21 | .cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } 22 | .cm-s-vibrant-ink .cm-string { color: #A5C25C } 23 | .cm-s-vibrant-ink .cm-string-2 { color: red } 24 | .cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } 25 | .cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } 26 | .cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } 27 | .cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } 28 | .cm-s-vibrant-ink .cm-header { color: #FF6400; } 29 | .cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } 30 | .cm-s-vibrant-ink .cm-link { color: blue; } 31 | .cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } 32 | 33 | .cm-s-vibrant-ink .CodeMirror-activeline-background {background: #27282E !important;} 34 | .cm-s-vibrant-ink .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 35 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/controller/ModifyProfileController.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.controller; 2 | 3 | import com.wenmrong.community1.community.mapper.UserMapper; 4 | import com.wenmrong.community1.community.model.User; 5 | import com.wenmrong.community1.community.provider.OssClientAuthorization; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.multipart.MultipartFile; 12 | import org.springframework.web.multipart.MultipartHttpServletRequest; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import java.io.IOException; 16 | 17 | @Controller 18 | public class ModifyProfileController { 19 | @Autowired 20 | private OssClientAuthorization ossClientAuthorization; 21 | 22 | @Autowired 23 | private UserMapper userMapper; 24 | @GetMapping("/modifyProfile") 25 | public String showProfile(HttpServletRequest request, Model model) { 26 | User user = (User) request.getSession().getAttribute("user"); 27 | model.addAttribute("user", user); 28 | return "profile_info"; 29 | } 30 | 31 | @PostMapping("/modifyProfile") 32 | public String modifyProfile(HttpServletRequest request, Model model) throws IOException { 33 | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; 34 | MultipartFile file = multipartRequest.getFile("head_portrait"); 35 | String uploadImageUrl = ossClientAuthorization.upload(file.getInputStream(), file.getOriginalFilename()); 36 | User user = (User) request.getSession().getAttribute("user"); 37 | user.setAvatarUrl(uploadImageUrl); 38 | userMapper.updateByPrimaryKey(user); 39 | model.addAttribute("user", user); 40 | return "profile_info"; 41 | } 42 | } -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/shell/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({}, "shell"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("var", 9 | "text [def $var] text"); 10 | MT("varBraces", 11 | "text[def ${var}]text"); 12 | MT("varVar", 13 | "text [def $a$b] text"); 14 | MT("varBracesVarBraces", 15 | "text[def ${a}${b}]text"); 16 | 17 | MT("singleQuotedVar", 18 | "[string 'text $var text']"); 19 | MT("singleQuotedVarBraces", 20 | "[string 'text ${var} text']"); 21 | 22 | MT("doubleQuotedVar", 23 | '[string "text ][def $var][string text"]'); 24 | MT("doubleQuotedVarBraces", 25 | '[string "text][def ${var}][string text"]'); 26 | MT("doubleQuotedVarPunct", 27 | '[string "text ][def $@][string text"]'); 28 | MT("doubleQuotedVarVar", 29 | '[string "][def $a$b][string "]'); 30 | MT("doubleQuotedVarBracesVarBraces", 31 | '[string "][def ${a}${b}][string "]'); 32 | 33 | MT("notAString", 34 | "text\\'text"); 35 | MT("escapes", 36 | "outside\\'\\\"\\`\\\\[string \"inside\\`\\'\\\"\\\\`\\$notAVar\"]outside\\$\\(notASubShell\\)"); 37 | 38 | MT("subshell", 39 | "[builtin echo] [quote $(whoami)] s log, stardate [quote `date`]."); 40 | MT("doubleQuotedSubshell", 41 | "[builtin echo] [string \"][quote $(whoami)][string 's log, stardate `date`.\"]"); 42 | 43 | MT("hashbang", 44 | "[meta #!/bin/bash]"); 45 | MT("comment", 46 | "text [comment # Blurb]"); 47 | 48 | MT("numbers", 49 | "[number 0] [number 1] [number 2]"); 50 | MT("keywords", 51 | "[keyword while] [atom true]; [keyword do]", 52 | " [builtin sleep] [number 3]", 53 | "[keyword done]"); 54 | MT("options", 55 | "[builtin ls] [attribute -l] [attribute --human-readable]"); 56 | MT("operator", 57 | "[def var][operator =]value"); 58 | })(); 59 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/dart/dart.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror"), require("../clike/clike")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror", "../clike/clike"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | 14 | var keywords = ("this super static final const abstract class extends external factory " + 15 | "implements get native operator set typedef with enum throw rethrow " + 16 | "assert break case continue default in return new deferred async await " + 17 | "try catch finally do else for if switch while import library export " + 18 | "part of show hide is").split(" "); 19 | var blockKeywords = "try catch finally do else for if switch while".split(" "); 20 | var atoms = "true false null".split(" "); 21 | var builtins = "void bool num int double dynamic var String".split(" "); 22 | 23 | function set(words) { 24 | var obj = {}; 25 | for (var i = 0; i < words.length; ++i) obj[words[i]] = true; 26 | return obj; 27 | } 28 | 29 | CodeMirror.defineMIME("application/dart", { 30 | name: "clike", 31 | keywords: set(keywords), 32 | multiLineStrings: true, 33 | blockKeywords: set(blockKeywords), 34 | builtin: set(builtins), 35 | atoms: set(atoms), 36 | hooks: { 37 | "@": function(stream) { 38 | stream.eatWhile(/[\w\$_]/); 39 | return "meta"; 40 | } 41 | } 42 | }); 43 | 44 | CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins)); 45 | 46 | // This is needed to make loading through meta.js work. 47 | CodeMirror.defineMode("dart", function(conf) { 48 | return CodeMirror.getMode(conf, "application/dart"); 49 | }, "clike"); 50 | }); 51 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/shell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Shell mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 27 | 28 |
29 |

Shell mode

30 | 31 | 32 | 56 | 57 | 64 | 65 |

MIME types defined: text/x-sh.

66 |
67 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/sparql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: SPARQL mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 25 | 26 |
27 |

SPARQL mode

28 |
52 | 58 | 59 |

MIME types defined: application/sparql-query.

60 | 61 |
62 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/twilight.css: -------------------------------------------------------------------------------- 1 | .cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ 2 | .cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ 3 | .cm-s-twilight.CodeMirror ::selection { background: rgba(50, 50, 50, 0.99); } 4 | .cm-s-twilight.CodeMirror ::-moz-selection { background: rgba(50, 50, 50, 0.99); } 5 | 6 | .cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } 7 | .cm-s-twilight .CodeMirror-guttermarker { color: white; } 8 | .cm-s-twilight .CodeMirror-guttermarker-subtle { color: #aaa; } 9 | .cm-s-twilight .CodeMirror-linenumber { color: #aaa; } 10 | .cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; } 11 | 12 | .cm-s-twilight .cm-keyword { color: #f9ee98; } /**/ 13 | .cm-s-twilight .cm-atom { color: #FC0; } 14 | .cm-s-twilight .cm-number { color: #ca7841; } /**/ 15 | .cm-s-twilight .cm-def { color: #8DA6CE; } 16 | .cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/ 17 | .cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/ 18 | .cm-s-twilight .cm-operator { color: #cda869; } /**/ 19 | .cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/ 20 | .cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/ 21 | .cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/ 22 | .cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/ 23 | .cm-s-twilight .cm-builtin { color: #cda869; } /*?*/ 24 | .cm-s-twilight .cm-tag { color: #997643; } /**/ 25 | .cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/ 26 | .cm-s-twilight .cm-header { color: #FF6400; } 27 | .cm-s-twilight .cm-hr { color: #AEAEAE; } 28 | .cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/ 29 | .cm-s-twilight .cm-error { border-bottom: 1px solid red; } 30 | 31 | .cm-s-twilight .CodeMirror-activeline-background {background: #27282E !important;} 32 | .cm-s-twilight .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 33 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/django/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Django template mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

Django template mode

30 |
50 | 51 | 59 | 60 |

Mode for HTML with embedded Django template markup.

61 | 62 |

MIME types defined: text/x-django

63 |
64 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/tornado/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Tornado template mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 27 | 28 |
29 |

Tornado template mode

30 |
50 | 51 | 59 | 60 |

Mode for HTML with embedded Tornado template markup.

61 | 62 |

MIME types defined: text/x-tornado

63 |
64 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/midnight.css: -------------------------------------------------------------------------------- 1 | /* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ 2 | 3 | /**/ 4 | .cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } 5 | .cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } 6 | 7 | /**/ 8 | .cm-s-midnight .CodeMirror-activeline-background {background: #253540 !important;} 9 | 10 | .cm-s-midnight.CodeMirror { 11 | background: #0F192A; 12 | color: #D1EDFF; 13 | } 14 | 15 | .cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} 16 | 17 | .cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} 18 | .cm-s-midnight.CodeMirror ::selection { background: rgba(49, 77, 103, .99); } 19 | .cm-s-midnight.CodeMirror ::-moz-selection { background: rgba(49, 77, 103, .99); } 20 | .cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} 21 | .cm-s-midnight .CodeMirror-guttermarker { color: white; } 22 | .cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } 23 | .cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;} 24 | .cm-s-midnight .CodeMirror-cursor { 25 | border-left: 1px solid #F8F8F0 !important; 26 | } 27 | 28 | .cm-s-midnight span.cm-comment {color: #428BDD;} 29 | .cm-s-midnight span.cm-atom {color: #AE81FF;} 30 | .cm-s-midnight span.cm-number {color: #D1EDFF;} 31 | 32 | .cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;} 33 | .cm-s-midnight span.cm-keyword {color: #E83737;} 34 | .cm-s-midnight span.cm-string {color: #1DC116;} 35 | 36 | .cm-s-midnight span.cm-variable {color: #FFAA3E;} 37 | .cm-s-midnight span.cm-variable-2 {color: #FFAA3E;} 38 | .cm-s-midnight span.cm-def {color: #4DD;} 39 | .cm-s-midnight span.cm-bracket {color: #D1EDFF;} 40 | .cm-s-midnight span.cm-tag {color: #449;} 41 | .cm-s-midnight span.cm-link {color: #AE81FF;} 42 | .cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;} 43 | 44 | .cm-s-midnight .CodeMirror-matchingbracket { 45 | text-decoration: underline; 46 | color: white !important; 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/wenmrong/community1/community/provider/GithubProvider.java: -------------------------------------------------------------------------------- 1 | package com.wenmrong.community1.community.provider; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.wenmrong.community1.community.dto.AccessTokenDTO; 5 | import com.wenmrong.community1.community.dto.GithubUser; 6 | import okhttp3.*; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.io.IOException; 10 | 11 | @Component 12 | public class GithubProvider { 13 | public String getAccessToken(AccessTokenDTO accessTokenDTO) { 14 | MediaType mediaType = MediaType.get("application/json; charset=utf-8"); 15 | OkHttpClient client = new OkHttpClient(); 16 | RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(accessTokenDTO)); 17 | Request request = new Request.Builder() 18 | .url("https://github.com/login/oauth/access_token") 19 | .post(body) 20 | .build(); 21 | try (Response response = client.newCall(request).execute()) { 22 | String string = response.body().string(); 23 | String token = string.split("&")[0].split("=")[1]; 24 | return token; 25 | } catch (Exception e) { 26 | e.printStackTrace(); 27 | } 28 | return null; 29 | } 30 | 31 | 32 | public GithubUser getUser(String accessToken) { 33 | OkHttpClient client = new OkHttpClient(); 34 | Request request = new Request.Builder() 35 | //github新版请求方式 36 | .url("https://api.github.com/user") 37 | .header("Authorization","token "+accessToken) 38 | // .url("https://api.github.com/user?access_token=" + accessToken) 39 | .build(); 40 | try { 41 | Response response = client.newCall(request).execute(); 42 | String string = response.body().string(); 43 | GithubUser githubUser = JSON.parseObject(string, GithubUser.class); 44 | return githubUser; 45 | } catch (IOException e) { 46 | } 47 | 48 | return null; 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/mode/forth/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | CodeMirror: Forth mode 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 31 | 32 |
33 | 34 |

Forth mode

35 | 36 |
57 |
58 | 59 | 70 | 71 |

Simple mode that handle Forth-Syntax (Forth on WikiPedia).

72 | 73 |

MIME types defined: text/x-forth.

74 | 75 |
76 | -------------------------------------------------------------------------------- /src/main/resources/static/js/lib/codemirror/theme/zenburn.css: -------------------------------------------------------------------------------- 1 | /** 2 | * " 3 | * Using Zenburn color palette from the Emacs Zenburn Theme 4 | * https://github.com/bbatsov/zenburn-emacs/blob/master/zenburn-theme.el 5 | * 6 | * Also using parts of https://github.com/xavi/coderay-lighttable-theme 7 | * " 8 | * From: https://github.com/wisenomad/zenburn-lighttable-theme/blob/master/zenburn.css 9 | */ 10 | 11 | .cm-s-zenburn .CodeMirror-gutters { background: #3f3f3f !important; } 12 | .cm-s-zenburn .CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: #999; } 13 | .cm-s-zenburn .CodeMirror-cursor { border-left: 1px solid white !important; } 14 | .cm-s-zenburn { background-color: #3f3f3f; color: #dcdccc; } 15 | .cm-s-zenburn span.cm-builtin { color: #dcdccc; font-weight: bold; } 16 | .cm-s-zenburn span.cm-comment { color: #7f9f7f; } 17 | .cm-s-zenburn span.cm-keyword { color: #f0dfaf; font-weight: bold; } 18 | .cm-s-zenburn span.cm-atom { color: #bfebbf; } 19 | .cm-s-zenburn span.cm-def { color: #dcdccc; } 20 | .cm-s-zenburn span.cm-variable { color: #dfaf8f; } 21 | .cm-s-zenburn span.cm-variable-2 { color: #dcdccc; } 22 | .cm-s-zenburn span.cm-string { color: #cc9393; } 23 | .cm-s-zenburn span.cm-string-2 { color: #cc9393; } 24 | .cm-s-zenburn span.cm-number { color: #dcdccc; } 25 | .cm-s-zenburn span.cm-tag { color: #93e0e3; } 26 | .cm-s-zenburn span.cm-property { color: #dfaf8f; } 27 | .cm-s-zenburn span.cm-attribute { color: #dfaf8f; } 28 | .cm-s-zenburn span.cm-qualifier { color: #7cb8bb; } 29 | .cm-s-zenburn span.cm-meta { color: #f0dfaf; } 30 | .cm-s-zenburn span.cm-header { color: #f0efd0; } 31 | .cm-s-zenburn span.cm-operator { color: #f0efd0; } 32 | .cm-s-zenburn span.CodeMirror-matchingbracket { box-sizing: border-box; background: transparent; border-bottom: 1px solid; } 33 | .cm-s-zenburn span.CodeMirror-nonmatchingbracket { border-bottom: 1px solid; background: none; } 34 | .cm-s-zenburn .CodeMirror-activeline { background: #000000; } 35 | .cm-s-zenburn .CodeMirror-activeline-background { background: #000000; } 36 | .cm-s-zenburn .CodeMirror-selected { background: #545454; } 37 | .cm-s-zenburn .CodeMirror-focused .CodeMirror-selected { background: #4f4f4f; } 38 | --------------------------------------------------------------------------------