26 | Z80 assembly mode
27 |
28 |
29 |
44 |
45 |
50 |
51 | MIME type defined: text/x-z80.
52 |
53 |
--------------------------------------------------------------------------------
/src/main/java/com/wip/utils/IPKit.java:
--------------------------------------------------------------------------------
1 | package com.wip.utils;
2 |
3 | import org.apache.commons.lang3.StringUtils;
4 |
5 | import javax.servlet.http.HttpServletRequest;
6 |
7 | /**
8 | * ip工具类
9 | */
10 | public class IPKit {
11 |
12 | /**
13 | * 获取请求IP地址
14 | * @param request
15 | * @return
16 | */
17 | public static String getIpAddressByRequest(HttpServletRequest request) {
18 | String ip = request.getHeader("x-forwarded-for");
19 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
20 | ip = request.getHeader("Proxy-Client-IP");
21 | }
22 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
23 | ip = request.getHeader("WL-Proxy-Client-IP");
24 | }
25 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
26 | ip = request.getRemoteAddr();
27 | }
28 | return ip;
29 | }
30 |
31 | public static String getIpAddressByRequest1(HttpServletRequest request) {
32 | String ip = request.getHeader("X-Forwarded-For");
33 | if(StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)){
34 | //多次反向代理后会有多个ip值,第一个ip才是真实ip
35 | int index = ip.indexOf(",");
36 | if(index != -1){
37 | return ip.substring(0,index);
38 | }else{
39 | return ip;
40 | }
41 | }
42 |
43 | ip = request.getHeader("X-Real-IP");
44 | if(StringUtils.isNotEmpty(ip) && !"unKnown".equalsIgnoreCase(ip)){
45 | return ip;
46 | }
47 | return request.getRemoteAddr();
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/resources/static/admin/editormd/lib/codemirror/mode/ecl/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
26 | Rust mode
27 |
28 |
29 |
52 |
53 |
58 |
59 | MIME types defined: text/x-rustsrc.
60 |
61 |
--------------------------------------------------------------------------------
/src/main/resources/static/admin/editormd/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/java/com/wip/service/article/ContentService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by IntelliJ IDEA.
3 | * User: Kyrie
4 | * DateTime: 2018/7/25 16:48
5 | **/
6 | package com.wip.service.article;
7 |
8 | import com.github.pagehelper.PageInfo;
9 | import com.wip.dto.cond.ContentCond;
10 | import com.wip.model.ContentDomain;
11 | import com.wip.model.MetaDomain;
12 |
13 | import java.util.List;
14 |
15 | /**
16 | * 文章相关Service接口
17 | */
18 | public interface ContentService {
19 |
20 | /***
21 | * 添加文章
22 | * @param contentDomain
23 | */
24 | void addArticle(ContentDomain contentDomain);
25 |
26 | /**
27 | * 根据编号获取文章
28 | * @param cid
29 | * @return
30 | */
31 | ContentDomain getArticleById(Integer cid);
32 |
33 | /**
34 | * 更新文章
35 | * @param contentDomain
36 | */
37 | void updateArticleById(ContentDomain contentDomain);
38 |
39 | /**
40 | * 根据条件获取文章列表
41 | * @param contentCond
42 | * @param page
43 | * @param limit
44 | * @return
45 | */
46 | PageInfo