├── src
├── main
│ ├── resources
│ │ ├── static
│ │ │ └── apidocs
│ │ │ │ ├── css
│ │ │ │ ├── typography.css
│ │ │ │ ├── reset.css
│ │ │ │ └── style.css
│ │ │ │ ├── images
│ │ │ │ ├── expand.gif
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── collapse.gif
│ │ │ │ ├── logo_small.png
│ │ │ │ ├── throbber.gif
│ │ │ │ ├── wordnik_api.png
│ │ │ │ ├── explorer_icons.png
│ │ │ │ ├── favicon-16x16.png
│ │ │ │ ├── favicon-32x32.png
│ │ │ │ └── pet_store_api.png
│ │ │ │ ├── fonts
│ │ │ │ ├── DroidSans.ttf
│ │ │ │ └── DroidSans-Bold.ttf
│ │ │ │ ├── lib
│ │ │ │ ├── highlight.9.1.0.pack_extended.js
│ │ │ │ ├── object-assign-pollyfill.js
│ │ │ │ ├── jquery.slideto.min.js
│ │ │ │ ├── jquery.wiggle.min.js
│ │ │ │ ├── jquery.ba-bbq.min.js
│ │ │ │ ├── swagger-oauth.js
│ │ │ │ ├── highlight.9.1.0.pack.js
│ │ │ │ ├── marked.js
│ │ │ │ ├── backbone-min.js
│ │ │ │ └── es5-shim.js
│ │ │ │ ├── o2c.html
│ │ │ │ ├── lang
│ │ │ │ ├── translator.js
│ │ │ │ ├── ko-kr.js
│ │ │ │ ├── zh-cn.js
│ │ │ │ ├── ja.js
│ │ │ │ ├── tr.js
│ │ │ │ ├── pl.js
│ │ │ │ ├── pt.js
│ │ │ │ ├── en.js
│ │ │ │ ├── ru.js
│ │ │ │ ├── ca.js
│ │ │ │ ├── geo.js
│ │ │ │ ├── it.js
│ │ │ │ ├── es.js
│ │ │ │ ├── fr.js
│ │ │ │ └── el.js
│ │ │ │ └── index.html
│ │ ├── config
│ │ │ └── spring-integration-file-context.xml
│ │ ├── application.yml
│ │ └── application-integration-redis.xml
│ └── java
│ │ └── online
│ │ └── zhaopei
│ │ └── myproject
│ │ ├── service
│ │ ├── CityService.java
│ │ ├── UserTestService.java
│ │ ├── Receiver.java
│ │ ├── impl
│ │ │ ├── UserTestServiceImpl.java
│ │ │ └── CityServiceImpl.java
│ │ └── Sender.java
│ │ ├── sqlprovide
│ │ ├── UserTestProvide.java
│ │ └── CitySqlProvide.java
│ │ ├── config
│ │ ├── RedisConfigation.java
│ │ ├── JerseyConfig.java
│ │ ├── SecondDatabaseConfig.java
│ │ ├── RabbitMQConfigration.java
│ │ ├── PrimaryDatabaseConfiguration.java
│ │ └── IntegrationConfiguration.java
│ │ ├── mapper
│ │ ├── second
│ │ │ └── UserTestMapper.java
│ │ └── primary
│ │ │ └── CityMapper.java
│ │ ├── resource
│ │ └── HelloResource.java
│ │ ├── domain
│ │ ├── UserTest.java
│ │ └── City.java
│ │ ├── CXFClientTest.java
│ │ ├── Application.java
│ │ ├── controller
│ │ ├── QueueController.java
│ │ ├── RedisController.java
│ │ ├── CityController.java
│ │ └── UserController.java
│ │ ├── integration
│ │ ├── QueueReadingMessageSource.java
│ │ └── DefaultFileNameGenerator.java
│ │ ├── jerseyservice
│ │ └── HelloEndpoint.java
│ │ └── util
│ │ └── QRCodeUtil.java
└── test
│ └── java
│ └── online
│ └── zhaopei
│ └── myproject
│ └── util
│ └── test
│ └── QRcodeUtilTest.java
├── .gitignore
├── README.md
├── pom.xml
└── springboot.iml
/src/main/resources/static/apidocs/css/typography.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/expand.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/expand.gif
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/favicon.ico
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/fonts/DroidSans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/fonts/DroidSans.ttf
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/collapse.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/collapse.gif
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/logo_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/logo_small.png
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/throbber.gif
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/wordnik_api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/wordnik_api.png
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/fonts/DroidSans-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/fonts/DroidSans-Bold.ttf
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/explorer_icons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/explorer_icons.png
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/favicon-16x16.png
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/favicon-32x32.png
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/images/pet_store_api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhaopei0418/springboot/HEAD/src/main/resources/static/apidocs/images/pet_store_api.png
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/service/CityService.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.service;
2 |
3 | import java.util.List;
4 |
5 | import online.zhaopei.myproject.domain.City;
6 |
7 | public interface CityService {
8 |
9 | List findByState(String state);
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/service/UserTestService.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.service;
2 |
3 | import java.util.List;
4 |
5 | import online.zhaopei.myproject.domain.UserTest;
6 |
7 | public interface UserTestService {
8 |
9 | List getAllUsers();
10 | }
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /bin/
2 | *.DS_Store
3 | /build
4 | /target
5 | /.gradle
6 | /.gradle*
7 | /out
8 | /.idea
9 | #/.settings
10 | /work
11 | WebContent/.idea/
12 | *.log
13 | *.log.*
14 | *.swp
15 | *.iml
16 |
17 | *.class
18 | /.settings
19 | .project
20 | .classpath
21 |
22 | # Package Files #
23 | *.war
24 | *.ear
25 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/sqlprovide/UserTestProvide.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.sqlprovide;
2 |
3 | import org.apache.ibatis.jdbc.SQL;
4 |
5 | public class UserTestProvide {
6 |
7 | public String getAllUsers() {
8 | return new SQL() {{
9 | this.SELECT("*").FROM("user_test");
10 | }}.toString();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lib/highlight.9.1.0.pack_extended.js:
--------------------------------------------------------------------------------
1 | "use strict";!function(){var h,l;h=hljs.configure,hljs.configure=function(l){var i=l.highlightSizeThreshold;hljs.highlightSizeThreshold=i===+i?i:null,h.call(this,l)},l=hljs.highlightBlock,hljs.highlightBlock=function(h){var i=h.innerHTML,g=hljs.highlightSizeThreshold;(null==g||g>i.length)&&l.call(hljs,h)}}();
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/config/RedisConfigation.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.config;
2 |
3 | import org.springframework.context.annotation.Configuration;
4 | import org.springframework.context.annotation.ImportResource;
5 |
6 | @Configuration
7 | @ImportResource(locations = {"classpath:application-*.xml"})
8 | public class RedisConfigation {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/sqlprovide/CitySqlProvide.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.sqlprovide;
2 |
3 | import org.apache.ibatis.jdbc.SQL;
4 |
5 |
6 | public class CitySqlProvide {
7 |
8 | public String findByState(String state) {
9 |
10 | return new SQL() {{
11 | this.SELECT("*").FROM("city").WHERE("state = #{state}");
12 | }}.toString();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lib/object-assign-pollyfill.js:
--------------------------------------------------------------------------------
1 | "function"!=typeof Object.assign&&!function(){Object.assign=function(n){"use strict";if(void 0===n||null===n)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),o=1;o getAllUsers();
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lib/jquery.wiggle.min.js:
--------------------------------------------------------------------------------
1 | jQuery.fn.wiggle=function(e){var a={speed:50,wiggles:3,travel:5,callback:null},e=jQuery.extend(a,e);return this.each(function(){var a=this,l=(jQuery(this).wrap('
').css("position","relative"),0);for(i=1;i<=e.wiggles;i++)jQuery(this).animate({left:"-="+e.travel},e.speed).animate({left:"+="+2*e.travel},2*e.speed).animate({left:"-="+e.travel},e.speed,function(){l++,jQuery(a).parent().hasClass("wiggle-wrap")&&jQuery(a).parent().replaceWith(a),l==e.wiggles&&jQuery.isFunction(e.callback)&&e.callback()})})};
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/resource/HelloResource.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.resource;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 |
6 | /**
7 | * The domain model class
8 | *
9 | * @author bright.zheng
10 | *
11 | */
12 | @ApiModel(description = "Hello 类")
13 | public class HelloResource {
14 |
15 | @ApiModelProperty(value = "消息", required = true)
16 | private String msg;
17 |
18 | public String getMsg() {
19 | return this.msg;
20 | }
21 |
22 | public void setMsg(String msg) {
23 | this.msg = msg;
24 | }
25 | }
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/o2c.html:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/domain/UserTest.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | public class UserTest implements Serializable {
6 |
7 | /**
8 | * serialVersionUID
9 | */
10 | private static final long serialVersionUID = 6075844282964984795L;
11 |
12 | private String id;
13 |
14 | private String name;
15 |
16 | public String getId() {
17 | return id;
18 | }
19 |
20 | public void setId(String id) {
21 | this.id = id;
22 | }
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/mapper/primary/CityMapper.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.mapper.primary;
2 |
3 | import java.util.List;
4 |
5 | import org.apache.ibatis.annotations.Mapper;
6 | import org.apache.ibatis.annotations.Param;
7 | import org.apache.ibatis.annotations.Select;
8 | import org.apache.ibatis.annotations.SelectProvider;
9 |
10 | import online.zhaopei.myproject.domain.City;
11 | import online.zhaopei.myproject.sqlprovide.CitySqlProvide;
12 |
13 | public interface CityMapper {
14 |
15 | @SelectProvider(type = CitySqlProvide.class, method = "findByState")
16 | List findByState(@Param("state") String state);
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/service/Receiver.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.service;
2 |
3 | import org.springframework.amqp.rabbit.annotation.RabbitListener;
4 | import org.springframework.stereotype.Component;
5 |
6 | import com.google.gson.Gson;
7 |
8 | import online.zhaopei.myproject.domain.City;
9 |
10 | @Component
11 | public class Receiver {
12 |
13 | public void process(String hello) {
14 | System.out.println("receiver:" + hello);
15 | }
16 |
17 | /**
18 | * 注释掉不监听rabbit队列
19 | * @param city
20 | */
21 | // @RabbitListener(queues = "hello")
22 | public void process(City city) {
23 | System.out.println("city.name===[" + city.getCountry() + "]");
24 | System.out.println(new Gson().toJson(city));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/css/reset.css:
--------------------------------------------------------------------------------
1 | a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/CXFClientTest.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject;
2 |
3 | import javax.xml.namespace.QName;
4 |
5 | import org.apache.cxf.endpoint.Client;
6 | import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
7 |
8 | public class CXFClientTest {
9 |
10 | public static void main(String[] args) throws Exception {
11 | JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
12 | Client client = dcf.createClient("http://171.12.5.86:83/DataInteractonWbs/webservice/wbs?wsdl");
13 | Object[] objects = null;
14 | QName opName = new QName("http://com.mh.webservice", "payParse");
15 | objects = client.invoke(opName, "111");
16 | System.out.println(objects[0].getClass());
17 | System.out.println(objects[0]);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/Application.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 | import org.springframework.boot.builder.SpringApplicationBuilder;
6 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
7 |
8 | @SpringBootApplication
9 | //@ImportResource({"classpath:config/spring-integration-file-context.xml"})
10 | public class Application extends SpringBootServletInitializer {
11 |
12 | @Override
13 | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
14 | return builder.sources(Application.class);
15 | }
16 |
17 | public static void main(String[] args) throws Exception {
18 | SpringApplication.run(Application.class, args);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/controller/QueueController.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.controller;
2 |
3 | import online.zhaopei.myproject.config.IntegrationConfiguration;
4 | import org.springframework.web.bind.annotation.PathVariable;
5 | import org.springframework.web.bind.annotation.RequestMapping;
6 | import org.springframework.web.bind.annotation.RestController;
7 |
8 | /**
9 | * Created by zhaopei on 17/12/21.
10 | */
11 | @RestController
12 | @RequestMapping("/queue")
13 | public class QueueController {
14 |
15 | @RequestMapping("/{type}/{message}")
16 | public String putMessage(@PathVariable("type") String type, @PathVariable("message") String message) throws Exception {
17 | IntegrationConfiguration.RECEIPT_QUEUE.put(new String[]{type, message});
18 | return "{\"success\": true}";
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/service/impl/UserTestServiceImpl.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.service.impl;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | import online.zhaopei.myproject.domain.UserTest;
10 | import online.zhaopei.myproject.mapper.second.UserTestMapper;
11 | import online.zhaopei.myproject.service.UserTestService;
12 |
13 | @Service
14 | public class UserTestServiceImpl implements UserTestService {
15 |
16 | @Autowired
17 | private UserTestMapper userTestMapper;
18 |
19 | @Override
20 | @Transactional(value = "secondTxMan", readOnly = true)
21 | public List getAllUsers() {
22 | return this.userTestMapper.getAllUsers();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 用java 语言 + springboot + springmvc + mybatis + (maven/gradle) 搭成的框架
2 |
3 | 增加redis的发布订阅,及消息队列例子
4 |
5 | 1.用maven启动命令是
6 | mvn spring-boot:run
7 |
8 | 添加restful风格API
9 | ```
10 | 文档地址:http://localhost:8081/apidocs/index.html
11 | ```
12 |
13 | 启动之后输入localhost:8081 返回home 就成功了
14 |
15 | 测试redis订阅发布:发出如下命令
16 | ```
17 | curl -v http://localhost:8081/redis/publish\?message\=zhaopei-123
18 | ```
19 |
20 | 或者在浏览器中打开:
21 | 会显示日志如下:
22 | o.z.m.config.IntegrationConfiguration : subscribeMessage = zhaopei-123
23 | 发布订阅已成功
24 |
25 | ## 注意如出现以下错误:
26 | ```
27 | org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
28 | ```
29 | 请修改src/main/resources/application.yml中的
30 | ```
31 | rabbitmq:
32 | username: 自己队列的用户名
33 | password: 自己队列的密码
34 | ```
35 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/service/impl/CityServiceImpl.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.service.impl;
2 |
3 | import java.util.List;
4 |
5 | import org.springframework.beans.factory.annotation.Autowired;
6 | import org.springframework.stereotype.Service;
7 | import org.springframework.transaction.annotation.Transactional;
8 |
9 | import online.zhaopei.myproject.domain.City;
10 | import online.zhaopei.myproject.mapper.primary.CityMapper;
11 | import online.zhaopei.myproject.mapper.second.UserTestMapper;
12 | import online.zhaopei.myproject.service.CityService;
13 |
14 | @Service
15 | public class CityServiceImpl implements CityService {
16 |
17 | @Autowired
18 | private CityMapper cityMapper;
19 |
20 | @Override
21 | @Transactional(value = "primaryTxMan", readOnly = true)
22 | public List findByState(String state) {
23 | return this.cityMapper.findByState(state);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/service/Sender.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.service;
2 |
3 | import java.util.Date;
4 |
5 | import org.springframework.amqp.core.AmqpTemplate;
6 | import org.springframework.amqp.rabbit.core.RabbitMessagingTemplate;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.stereotype.Component;
9 |
10 | import online.zhaopei.myproject.domain.City;
11 |
12 | @Component
13 | public class Sender {
14 |
15 | @Autowired
16 | private AmqpTemplate amqpTemlate;
17 |
18 | @Autowired
19 | private RabbitMessagingTemplate rabbitMessagingTemplate;
20 |
21 | public void send() throws Exception {
22 | String context = "hello" + new Date();
23 | System.out.println("Sender:" + context);
24 | this.amqpTemlate.convertAndSend("hello", context);
25 | }
26 |
27 | public void send(City city) {
28 | this.rabbitMessagingTemplate.convertAndSend("hello", city);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/online/zhaopei/myproject/util/test/QRcodeUtilTest.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.util.test;
2 |
3 | import online.zhaopei.myproject.util.QRCodeUtil;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 | import org.springframework.boot.test.context.SpringBootTest;
7 | import org.springframework.test.context.junit4.SpringRunner;
8 |
9 | /**
10 | * Created by zhaopei on 18/1/22.
11 | */
12 | @RunWith(SpringRunner.class)
13 | @SpringBootTest
14 | public class QRcodeUtilTest {
15 |
16 | @Test
17 | public void testCreateQRCode() throws Exception {
18 | //QRCodeUtil.createQRCode("zhaopei", "/Users/zhaopei/Desktop/qrtest.png", 200, 200);
19 | QRCodeUtil.createLogoQRCode("/Users/zhaopei/Documents/myn2.jpeg", "https://www.baidu.com",
20 | "/Users/zhaopei/Desktop/logoqr.jpeg", 200, 200);
21 | //QRCodeUtil.drawTwoImage("/Users/zhaopei/Desktop/logoqr.jpeg", "/Users/zhaopei/Documents/vim.jpg",
22 | // "/Users/zhaopei/Desktop/1.jpg");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/config/spring-integration-file-context.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/controller/RedisController.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.controller;
2 |
3 | import org.springframework.integration.context.IntegrationObjectSupport;
4 | import org.springframework.messaging.Message;
5 | import org.springframework.messaging.MessageChannel;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | import javax.annotation.Resource;
10 |
11 | @RestController
12 | @RequestMapping("/redis")
13 | public class RedisController extends IntegrationObjectSupport {
14 |
15 | @Resource(name = "redisReceiveChannel")
16 | private MessageChannel redisReceiveChannel;
17 |
18 | @Resource(name = "redisSendChannel")
19 | private MessageChannel redisSendChannel;
20 |
21 | @RequestMapping("/publish")
22 | public String publishMessage(String message) {
23 | Message m = this.getMessageBuilderFactory().withPayload(message).build();
24 | this.redisSendChannel.send(m);
25 | return "put message: [" + message + "] success";
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8081
3 |
4 | spring:
5 | datasource.primary:
6 | driverClassName: com.mysql.jdbc.Driver
7 | url: jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
8 | username: root
9 | password: root
10 | initialSize: 5
11 | minIdle: 5
12 | maxActive: 20
13 | filters: stat,wall
14 | datasource.second:
15 | driverClassName: com.mysql.jdbc.Driver
16 | url: jdbc:mysql://localhost:3306/public_declaration?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
17 | username: root
18 | password: root
19 | initialSize: 5
20 | minIdle: 5
21 | maxActive: 20
22 | filters: stat,wall
23 | rabbitmq:
24 | host: www.haeport.com
25 | virtualHost: ase
26 | port: 5672
27 | username: username
28 | password: password
29 | redis:
30 | host: localhost
31 | port: 6379
32 |
33 |
34 | logging:
35 | file: springboot.log
36 | level:
37 | org:
38 | mybatis: TRACE
39 | springframework: INFO
40 | online:
41 | zhaopei:
42 | mypoject: TRACE
43 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/domain/City.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.domain;
2 |
3 | import java.io.Serializable;
4 |
5 | public class City implements Serializable {
6 |
7 | /**
8 | *
9 | */
10 | private static final long serialVersionUID = -4482271496994608810L;
11 |
12 | private Long id;
13 |
14 | private String name;
15 |
16 | private String state;
17 |
18 | private String country;
19 |
20 | public Long getId() {
21 | return id;
22 | }
23 |
24 | public void setId(Long id) {
25 | this.id = id;
26 | }
27 |
28 | public String getName() {
29 | return name;
30 | }
31 |
32 | public void setName(String name) {
33 | this.name = name;
34 | }
35 |
36 | public String getState() {
37 | return state;
38 | }
39 |
40 | public void setState(String state) {
41 | this.state = state;
42 | }
43 |
44 | public String getCountry() {
45 | return country;
46 | }
47 |
48 | public void setCountry(String country) {
49 | this.country = country;
50 | }
51 |
52 | @Override
53 | public String toString() {
54 | return this.getId() + "," + this.getName() + "," + this.getState() + "," + this.getCountry();
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/controller/CityController.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.controller;
2 |
3 | import java.util.List;
4 |
5 | import javax.annotation.Resource;
6 |
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.web.bind.annotation.RequestMapping;
9 | import org.springframework.web.bind.annotation.RestController;
10 |
11 | import com.github.pagehelper.PageHelper;
12 |
13 | import online.zhaopei.myproject.domain.City;
14 | import online.zhaopei.myproject.domain.UserTest;
15 | import online.zhaopei.myproject.service.CityService;
16 | import online.zhaopei.myproject.service.UserTestService;
17 |
18 | @RestController
19 | public class CityController {
20 |
21 | @Autowired
22 | private CityService cityService;
23 |
24 | @Autowired
25 | private UserTestService userService;
26 |
27 | @RequestMapping("/city/getCity")
28 | public List getCity() {
29 | PageHelper.startPage(1, 3);
30 | return this.cityService.findByState("CA");
31 | }
32 |
33 | @RequestMapping("/user/getUsers")
34 | public List getAllUsers() {
35 | PageHelper.startPage(1, 3);
36 | return this.userService.getAllUsers();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/controller/UserController.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.controller;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.web.bind.annotation.RequestMapping;
8 | import org.springframework.web.bind.annotation.RestController;
9 |
10 | import online.zhaopei.myproject.domain.City;
11 | import online.zhaopei.myproject.service.Sender;
12 |
13 | @RestController
14 | public class UserController {
15 |
16 | @Autowired
17 | private Sender sender;
18 |
19 | @RequestMapping("/")
20 | public String home() throws Exception {
21 | // this.sender.send();
22 |
23 | City city = new City();
24 | city.setId(111L);
25 | city.setName("name-city");
26 | city.setState("sss");
27 | city.setCountry("country===");
28 | //注释掉不再发送,自行开启
29 | // this.sender.send(city);
30 |
31 | return "home";
32 | }
33 |
34 | @RequestMapping("/user/list")
35 | public List listUser() {
36 | List list = new ArrayList();
37 | list.add("s1");
38 | list.add("s2");
39 | list.add("s3");
40 | list.add("s4");
41 |
42 | return list;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/integration/QueueReadingMessageSource.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.integration;
2 |
3 | import ch.qos.logback.core.CoreConstants;
4 | import online.zhaopei.myproject.config.IntegrationConfiguration;
5 | import org.apache.commons.logging.Log;
6 | import org.apache.commons.logging.LogFactory;
7 | import org.springframework.integration.context.IntegrationObjectSupport;
8 | import org.springframework.integration.core.MessageSource;
9 | import org.springframework.messaging.Message;
10 | import org.springframework.util.Assert;
11 |
12 | import java.util.Map;
13 |
14 | /**
15 | * Created by zhaopei on 17/12/21.
16 | */
17 | public class QueueReadingMessageSource extends IntegrationObjectSupport implements MessageSource {
18 |
19 | private static final Log logger = LogFactory.getLog(QueueReadingMessageSource.class);
20 |
21 | @Override
22 | public Message receive() {
23 | Message message = null;
24 | String[] ss = IntegrationConfiguration.RECEIPT_QUEUE.poll();
25 | if (null != ss) {
26 | message = this.getMessageBuilderFactory().withPayload(ss[1]).setHeaderIfAbsent("type", ss[0]).build();
27 | logger.info("Created message: [" + message + "]");
28 | }
29 | return message;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/translator.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /**
4 | * Translator for documentation pages.
5 | *
6 | * To enable translation you should include one of language-files in your index.html
7 | * after .
8 | * For example -
9 | *
10 | * If you wish to translate some new texts you should do two things:
11 | * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
12 | * 2. Mark that text it templates this way New Phrase or .
13 | * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
14 | *
15 | */
16 | window.SwaggerTranslator = {
17 |
18 | _words:[],
19 |
20 | translate: function(sel) {
21 | var $this = this;
22 | sel = sel || '[data-sw-translate]';
23 |
24 | $(sel).each(function() {
25 | $(this).html($this._tryTranslate($(this).html()));
26 |
27 | $(this).val($this._tryTranslate($(this).val()));
28 | $(this).attr('title', $this._tryTranslate($(this).attr('title')));
29 | });
30 | },
31 |
32 | _tryTranslate: function(word) {
33 | return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
34 | },
35 |
36 | learn: function(wordsMap) {
37 | this._words = wordsMap;
38 | }
39 | };
40 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/config/JerseyConfig.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.config;
2 |
3 | import javax.annotation.PostConstruct;
4 | import javax.ws.rs.ApplicationPath;
5 |
6 | import org.glassfish.jersey.server.ResourceConfig;
7 | import org.springframework.beans.factory.annotation.Value;
8 | import org.springframework.stereotype.Component;
9 |
10 | import io.swagger.jaxrs.config.BeanConfig;
11 | import io.swagger.jaxrs.listing.ApiListingResource;
12 | import io.swagger.jaxrs.listing.SwaggerSerializers;
13 | import online.zhaopei.myproject.jerseyservice.HelloEndpoint;
14 |
15 | @Component
16 | @ApplicationPath("api")
17 | public class JerseyConfig extends ResourceConfig {
18 |
19 | @Value("${spring.jersey.application-path:/api}")
20 | private String apiPath;
21 |
22 | public JerseyConfig() {
23 | this.registerEndpoints();
24 | }
25 |
26 | @PostConstruct
27 | public void init() {
28 | this.configureSwagger();
29 | }
30 |
31 | private void registerEndpoints() {
32 | this.register(HelloEndpoint.class);
33 | }
34 |
35 | private void configureSwagger() {
36 | this.register(ApiListingResource.class);
37 | this.register(SwaggerSerializers.class);
38 |
39 | BeanConfig config = new BeanConfig();
40 | config.setTitle("基于Spring Boot,Jersey, Swagger的Restful API");
41 | config.setVersion("1.0.0");
42 | config.setContact("赵配");
43 | config.setSchemes(new String[] { "http", "https" });
44 | config.setBasePath(this.apiPath);
45 | config.setResourcePackage("online.zhaopei.myproject.jerseyservice");
46 | config.setPrettyPrint(true);
47 | config.setScan(true);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/integration/DefaultFileNameGenerator.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.integration;
2 |
3 | import org.springframework.integration.file.FileNameGenerator;
4 | import org.springframework.messaging.Message;
5 |
6 | import java.text.SimpleDateFormat;
7 | import java.util.Calendar;
8 |
9 | /**
10 | * Created by zhaopei on 17/12/20.
11 | */
12 | public class DefaultFileNameGenerator implements FileNameGenerator {
13 |
14 | private String prefix = "";
15 |
16 | private String suffix = "";
17 |
18 | private Boolean headerId = false;
19 |
20 | private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("yyyyMMddHHmmssSSS");
21 |
22 | public DefaultFileNameGenerator(String prefix, String suffix, Boolean headerId) {
23 | this.prefix = prefix;
24 | this.suffix = suffix;
25 | this.headerId = headerId;
26 | }
27 |
28 | public DefaultFileNameGenerator() {
29 |
30 | }
31 |
32 | @Override
33 | public String generateFileName(Message> message) {
34 | if (this.headerId) {
35 | return this.prefix + TIME_FORMAT.format(Calendar.getInstance().getTime()) + "_" + message.getHeaders().getId() + this.suffix;
36 | }
37 | return this.prefix + TIME_FORMAT.format(Calendar.getInstance().getTime()) + this.suffix;
38 | }
39 |
40 | public String getPrefix() {
41 | return prefix;
42 | }
43 |
44 | public void setPrefix(String prefix) {
45 | this.prefix = prefix;
46 | }
47 |
48 | public String getSuffix() {
49 | return suffix;
50 | }
51 |
52 | public void setSuffix(String suffix) {
53 | this.suffix = suffix;
54 | }
55 |
56 | public Boolean getHeaderId() {
57 | return headerId;
58 | }
59 |
60 | public void setHeaderId(Boolean headerId) {
61 | this.headerId = headerId;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/ko-kr.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"경고:폐기예정됨",
6 | "Implementation Notes":"구현 노트",
7 | "Response Class":"응답 클래스",
8 | "Status":"상태",
9 | "Parameters":"매개변수들",
10 | "Parameter":"매개변수",
11 | "Value":"값",
12 | "Description":"설명",
13 | "Parameter Type":"매개변수 타입",
14 | "Data Type":"데이터 타입",
15 | "Response Messages":"응답 메세지",
16 | "HTTP Status Code":"HTTP 상태 코드",
17 | "Reason":"원인",
18 | "Response Model":"응답 모델",
19 | "Request URL":"요청 URL",
20 | "Response Body":"응답 본문",
21 | "Response Code":"응답 코드",
22 | "Response Headers":"응답 헤더",
23 | "Hide Response":"응답 숨기기",
24 | "Headers":"헤더",
25 | "Try it out!":"써보기!",
26 | "Show/Hide":"보이기/숨기기",
27 | "List Operations":"목록 작업",
28 | "Expand Operations":"전개 작업",
29 | "Raw":"원본",
30 | "can't parse JSON. Raw result":"JSON을 파싱할수 없음. 원본결과:",
31 | "Model Schema":"모델 스키마",
32 | "Model":"모델",
33 | "apply":"적용",
34 | "Username":"사용자 이름",
35 | "Password":"암호",
36 | "Terms of service":"이용약관",
37 | "Created by":"작성자",
38 | "See more at":"추가정보:",
39 | "Contact the developer":"개발자에게 문의",
40 | "api version":"api버전",
41 | "Response Content Type":"응답Content Type",
42 | "fetching resource":"리소스 가져오기",
43 | "fetching resource list":"리소스 목록 가져오기",
44 | "Explore":"탐색",
45 | "Show Swagger Petstore Example Apis":"Swagger Petstore 예제 보기",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"서버로부터 읽어들일수 없습니다. access-control-origin 설정이 올바르지 않을수 있습니다.",
47 | "Please specify the protocol for":"다음을 위한 프로토콜을 정하세요",
48 | "Can't read swagger JSON from":"swagger JSON 을 다음으로 부터 읽을수 없습니다",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"리소스 정보 불러오기 완료. Swagger UI 랜더링",
50 | "Unable to read api":"api를 읽을 수 없습니다.",
51 | "from path":"다음 경로로 부터",
52 | "server returned":"서버 응답함."
53 | });
54 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/zh-cn.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"警告:已过时",
6 | "Implementation Notes":"实现备注",
7 | "Response Class":"响应类",
8 | "Status":"状态",
9 | "Parameters":"参数",
10 | "Parameter":"参数",
11 | "Value":"值",
12 | "Description":"描述",
13 | "Parameter Type":"参数类型",
14 | "Data Type":"数据类型",
15 | "Response Messages":"响应消息",
16 | "HTTP Status Code":"HTTP状态码",
17 | "Reason":"原因",
18 | "Response Model":"响应模型",
19 | "Request URL":"请求URL",
20 | "Response Body":"响应体",
21 | "Response Code":"响应码",
22 | "Response Headers":"响应头",
23 | "Hide Response":"隐藏响应",
24 | "Headers":"头",
25 | "Try it out!":"试一下!",
26 | "Show/Hide":"显示/隐藏",
27 | "List Operations":"显示操作",
28 | "Expand Operations":"展开操作",
29 | "Raw":"原始",
30 | "can't parse JSON. Raw result":"无法解析JSON. 原始结果",
31 | "Example Value":"示例",
32 | "Click to set as parameter value":"点击设置参数",
33 | "Model Schema":"模型架构",
34 | "Model":"模型",
35 | "apply":"应用",
36 | "Username":"用户名",
37 | "Password":"密码",
38 | "Terms of service":"服务条款",
39 | "Created by":"创建者",
40 | "See more at":"查看更多:",
41 | "Contact the developer":"联系开发者",
42 | "api version":"api版本",
43 | "Response Content Type":"响应Content Type",
44 | "Parameter content type:":"参数类型:",
45 | "fetching resource":"正在获取资源",
46 | "fetching resource list":"正在获取资源列表",
47 | "Explore":"浏览",
48 | "Show Swagger Petstore Example Apis":"显示 Swagger Petstore 示例 Apis",
49 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"无法从服务器读取。可能没有正确设置access-control-origin。",
50 | "Please specify the protocol for":"请指定协议:",
51 | "Can't read swagger JSON from":"无法读取swagger JSON于",
52 | "Finished Loading Resource Information. Rendering Swagger UI":"已加载资源信息。正在渲染Swagger UI",
53 | "Unable to read api":"无法读取api",
54 | "from path":"从路径",
55 | "server returned":"服务器返回"
56 | });
57 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/jerseyservice/HelloEndpoint.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.jerseyservice;
2 |
3 | import javax.ws.rs.Consumes;
4 | import javax.ws.rs.GET;
5 | import javax.ws.rs.Path;
6 | import javax.ws.rs.PathParam;
7 | import javax.ws.rs.Produces;
8 | import javax.ws.rs.core.MediaType;
9 | import javax.ws.rs.core.Response;
10 | import javax.ws.rs.core.Response.Status;
11 |
12 | import org.slf4j.Logger;
13 | import org.slf4j.LoggerFactory;
14 | import org.springframework.stereotype.Component;
15 |
16 | import io.swagger.annotations.Api;
17 | import io.swagger.annotations.ApiOperation;
18 | import io.swagger.annotations.ApiParam;
19 | import io.swagger.annotations.ApiResponse;
20 | import io.swagger.annotations.ApiResponses;
21 | import online.zhaopei.myproject.resource.HelloResource;
22 |
23 | @Component
24 | @Path("/v1/hello")
25 | @Consumes(MediaType.APPLICATION_JSON)
26 | @Produces(MediaType.APPLICATION_JSON)
27 | @Api(value = "Hello API - say hello the world", produces = "application/json")
28 | public class HelloEndpoint {
29 |
30 | private static final Logger LOGGER = LoggerFactory.getLogger(HelloEndpoint.class);
31 |
32 | @GET //JAX-RS Annotation
33 | @Path("/{name}") //JAX-RS Annotation
34 | @ApiOperation( //Swagger Annotation
35 | value = "提供一个名称",
36 | response = HelloResource.class)
37 | @ApiResponses(value = { //Swagger Annotation
38 | @ApiResponse(code = 200, message = "成功", response = HelloResource.class),
39 | @ApiResponse(code = 404, message = "找不到资源")
40 | })
41 | public Response sayHelloByGet(@ApiParam @PathParam("name") String name) {
42 | LOGGER.info("v1/hello/{} - {}", name, MediaType.APPLICATION_JSON);
43 | return this.constructHelloResponse(name, MediaType.APPLICATION_JSON);
44 | }
45 |
46 | private Response constructHelloResponse(String name, String via) {
47 | if ("404".equals(name)) {
48 | return Response.status(Status.NOT_FOUND).build();
49 | }
50 | HelloResource result = new HelloResource();
51 | result.setMsg(String.format("Hello %s - %s", name, via));
52 | return Response.status(Status.OK).entity(result).build();
53 | }
54 | }
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/ja.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"警告: 廃止予定",
6 | "Implementation Notes":"実装メモ",
7 | "Response Class":"レスポンスクラス",
8 | "Status":"ステータス",
9 | "Parameters":"パラメータ群",
10 | "Parameter":"パラメータ",
11 | "Value":"値",
12 | "Description":"説明",
13 | "Parameter Type":"パラメータタイプ",
14 | "Data Type":"データタイプ",
15 | "Response Messages":"レスポンスメッセージ",
16 | "HTTP Status Code":"HTTPステータスコード",
17 | "Reason":"理由",
18 | "Response Model":"レスポンスモデル",
19 | "Request URL":"リクエストURL",
20 | "Response Body":"レスポンスボディ",
21 | "Response Code":"レスポンスコード",
22 | "Response Headers":"レスポンスヘッダ",
23 | "Hide Response":"レスポンスを隠す",
24 | "Headers":"ヘッダ",
25 | "Try it out!":"実際に実行!",
26 | "Show/Hide":"表示/非表示",
27 | "List Operations":"操作一覧",
28 | "Expand Operations":"操作の展開",
29 | "Raw":"未加工",
30 | "can't parse JSON. Raw result":"JSONへ解釈できません. 未加工の結果",
31 | "Example Value":"値の例",
32 | "Model Schema":"モデルスキーマ",
33 | "Model":"モデル",
34 | "Click to set as parameter value":"パラメータ値と設定するにはクリック",
35 | "apply":"実行",
36 | "Username":"ユーザ名",
37 | "Password":"パスワード",
38 | "Terms of service":"サービス利用規約",
39 | "Created by":"Created by",
40 | "See more at":"詳細を見る",
41 | "Contact the developer":"開発者に連絡",
42 | "api version":"APIバージョン",
43 | "Response Content Type":"レスポンス コンテンツタイプ",
44 | "Parameter content type:":"パラメータコンテンツタイプ:",
45 | "fetching resource":"リソースの取得",
46 | "fetching resource list":"リソース一覧の取得",
47 | "Explore":"調査",
48 | "Show Swagger Petstore Example Apis":"SwaggerペットストアAPIの表示",
49 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"サーバから読み込めません. 適切なaccess-control-origin設定を持っていない可能性があります.",
50 | "Please specify the protocol for":"プロトコルを指定してください",
51 | "Can't read swagger JSON from":"次からswagger JSONを読み込めません",
52 | "Finished Loading Resource Information. Rendering Swagger UI":"リソース情報の読み込みが完了しました. Swagger UIを描画しています",
53 | "Unable to read api":"APIを読み込めません",
54 | "from path":"次のパスから",
55 | "server returned":"サーバからの返答"
56 | });
57 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/tr.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Uyarı: Deprecated",
6 | "Implementation Notes":"Gerçekleştirim Notları",
7 | "Response Class":"Dönen Sınıf",
8 | "Status":"Statü",
9 | "Parameters":"Parametreler",
10 | "Parameter":"Parametre",
11 | "Value":"Değer",
12 | "Description":"Açıklama",
13 | "Parameter Type":"Parametre Tipi",
14 | "Data Type":"Veri Tipi",
15 | "Response Messages":"Dönüş Mesajı",
16 | "HTTP Status Code":"HTTP Statü Kodu",
17 | "Reason":"Gerekçe",
18 | "Response Model":"Dönüş Modeli",
19 | "Request URL":"İstek URL",
20 | "Response Body":"Dönüş İçeriği",
21 | "Response Code":"Dönüş Kodu",
22 | "Response Headers":"Dönüş Üst Bilgileri",
23 | "Hide Response":"Dönüşü Gizle",
24 | "Headers":"Üst Bilgiler",
25 | "Try it out!":"Dene!",
26 | "Show/Hide":"Göster/Gizle",
27 | "List Operations":"Operasyonları Listele",
28 | "Expand Operations":"Operasyonları Aç",
29 | "Raw":"Ham",
30 | "can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç",
31 | "Model Schema":"Model Şema",
32 | "Model":"Model",
33 | "apply":"uygula",
34 | "Username":"Kullanıcı Adı",
35 | "Password":"Parola",
36 | "Terms of service":"Servis şartları",
37 | "Created by":"Oluşturan",
38 | "See more at":"Daha fazlası için",
39 | "Contact the developer":"Geliştirici ile İletişime Geçin",
40 | "api version":"api versiyon",
41 | "Response Content Type":"Dönüş İçerik Tipi",
42 | "fetching resource":"kaynak getiriliyor",
43 | "fetching resource list":"kaynak listesi getiriliyor",
44 | "Explore":"Keşfet",
45 | "Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.",
47 | "Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz",
48 | "Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor",
50 | "Unable to read api":"api okunamadı",
51 | "from path":"yoldan",
52 | "server returned":"sunucuya dönüldü"
53 | });
54 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/pl.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Uwaga: Wycofane",
6 | "Implementation Notes":"Uwagi Implementacji",
7 | "Response Class":"Klasa Odpowiedzi",
8 | "Status":"Status",
9 | "Parameters":"Parametry",
10 | "Parameter":"Parametr",
11 | "Value":"Wartość",
12 | "Description":"Opis",
13 | "Parameter Type":"Typ Parametru",
14 | "Data Type":"Typ Danych",
15 | "Response Messages":"Wiadomości Odpowiedzi",
16 | "HTTP Status Code":"Kod Statusu HTTP",
17 | "Reason":"Przyczyna",
18 | "Response Model":"Model Odpowiedzi",
19 | "Request URL":"URL Wywołania",
20 | "Response Body":"Treść Odpowiedzi",
21 | "Response Code":"Kod Odpowiedzi",
22 | "Response Headers":"Nagłówki Odpowiedzi",
23 | "Hide Response":"Ukryj Odpowiedź",
24 | "Headers":"Nagłówki",
25 | "Try it out!":"Wypróbuj!",
26 | "Show/Hide":"Pokaż/Ukryj",
27 | "List Operations":"Lista Operacji",
28 | "Expand Operations":"Rozwiń Operacje",
29 | "Raw":"Nieprzetworzone",
30 | "can't parse JSON. Raw result":"nie można przetworzyć pliku JSON. Nieprzetworzone dane",
31 | "Model Schema":"Schemat Modelu",
32 | "Model":"Model",
33 | "apply":"użyj",
34 | "Username":"Nazwa użytkownika",
35 | "Password":"Hasło",
36 | "Terms of service":"Warunki używania",
37 | "Created by":"Utworzone przez",
38 | "See more at":"Zobacz więcej na",
39 | "Contact the developer":"Kontakt z deweloperem",
40 | "api version":"wersja api",
41 | "Response Content Type":"Typ Zasobu Odpowiedzi",
42 | "fetching resource":"ładowanie zasobu",
43 | "fetching resource list":"ładowanie listy zasobów",
44 | "Explore":"Eksploruj",
45 | "Show Swagger Petstore Example Apis":"Pokaż Przykładowe Api Swagger Petstore",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Brak połączenia z serwerem. Może on nie mieć odpowiednich ustawień access-control-origin.",
47 | "Please specify the protocol for":"Proszę podać protokół dla",
48 | "Can't read swagger JSON from":"Nie można odczytać swagger JSON z",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"Ukończono Ładowanie Informacji o Zasobie. Renderowanie Swagger UI",
50 | "Unable to read api":"Nie można odczytać api",
51 | "from path":"ze ścieżki",
52 | "server returned":"serwer zwrócił"
53 | });
54 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/pt.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Aviso: Depreciado",
6 | "Implementation Notes":"Notas de Implementação",
7 | "Response Class":"Classe de resposta",
8 | "Status":"Status",
9 | "Parameters":"Parâmetros",
10 | "Parameter":"Parâmetro",
11 | "Value":"Valor",
12 | "Description":"Descrição",
13 | "Parameter Type":"Tipo de parâmetro",
14 | "Data Type":"Tipo de dados",
15 | "Response Messages":"Mensagens de resposta",
16 | "HTTP Status Code":"Código de status HTTP",
17 | "Reason":"Razão",
18 | "Response Model":"Modelo resposta",
19 | "Request URL":"URL requisição",
20 | "Response Body":"Corpo da resposta",
21 | "Response Code":"Código da resposta",
22 | "Response Headers":"Cabeçalho da resposta",
23 | "Headers":"Cabeçalhos",
24 | "Hide Response":"Esconder resposta",
25 | "Try it out!":"Tente agora!",
26 | "Show/Hide":"Mostrar/Esconder",
27 | "List Operations":"Listar operações",
28 | "Expand Operations":"Expandir operações",
29 | "Raw":"Cru",
30 | "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru",
31 | "Model Schema":"Modelo esquema",
32 | "Model":"Modelo",
33 | "apply":"Aplicar",
34 | "Username":"Usuário",
35 | "Password":"Senha",
36 | "Terms of service":"Termos do serviço",
37 | "Created by":"Criado por",
38 | "See more at":"Veja mais em",
39 | "Contact the developer":"Contate o desenvolvedor",
40 | "api version":"Versão api",
41 | "Response Content Type":"Tipo de conteúdo da resposta",
42 | "fetching resource":"busca recurso",
43 | "fetching resource list":"buscando lista de recursos",
44 | "Explore":"Explorar",
45 | "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin",
47 | "Please specify the protocol for":"Por favor especifique o protocolo",
48 | "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI",
50 | "Unable to read api":"Não foi possível ler api",
51 | "from path":"do caminho",
52 | "server returned":"servidor retornou"
53 | });
54 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/en.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Warning: Deprecated",
6 | "Implementation Notes":"Implementation Notes",
7 | "Response Class":"Response Class",
8 | "Status":"Status",
9 | "Parameters":"Parameters",
10 | "Parameter":"Parameter",
11 | "Value":"Value",
12 | "Description":"Description",
13 | "Parameter Type":"Parameter Type",
14 | "Data Type":"Data Type",
15 | "Response Messages":"Response Messages",
16 | "HTTP Status Code":"HTTP Status Code",
17 | "Reason":"Reason",
18 | "Response Model":"Response Model",
19 | "Request URL":"Request URL",
20 | "Response Body":"Response Body",
21 | "Response Code":"Response Code",
22 | "Response Headers":"Response Headers",
23 | "Hide Response":"Hide Response",
24 | "Headers":"Headers",
25 | "Try it out!":"Try it out!",
26 | "Show/Hide":"Show/Hide",
27 | "List Operations":"List Operations",
28 | "Expand Operations":"Expand Operations",
29 | "Raw":"Raw",
30 | "can't parse JSON. Raw result":"can't parse JSON. Raw result",
31 | "Example Value":"Example Value",
32 | "Model Schema":"Model Schema",
33 | "Model":"Model",
34 | "Click to set as parameter value":"Click to set as parameter value",
35 | "apply":"apply",
36 | "Username":"Username",
37 | "Password":"Password",
38 | "Terms of service":"Terms of service",
39 | "Created by":"Created by",
40 | "See more at":"See more at",
41 | "Contact the developer":"Contact the developer",
42 | "api version":"api version",
43 | "Response Content Type":"Response Content Type",
44 | "Parameter content type:":"Parameter content type:",
45 | "fetching resource":"fetching resource",
46 | "fetching resource list":"fetching resource list",
47 | "Explore":"Explore",
48 | "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis",
49 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.",
50 | "Please specify the protocol for":"Please specify the protocol for",
51 | "Can't read swagger JSON from":"Can't read swagger JSON from",
52 | "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI",
53 | "Unable to read api":"Unable to read api",
54 | "from path":"from path",
55 | "server returned":"server returned"
56 | });
57 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/ru.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Предупреждение: Устарело",
6 | "Implementation Notes":"Заметки",
7 | "Response Class":"Пример ответа",
8 | "Status":"Статус",
9 | "Parameters":"Параметры",
10 | "Parameter":"Параметр",
11 | "Value":"Значение",
12 | "Description":"Описание",
13 | "Parameter Type":"Тип параметра",
14 | "Data Type":"Тип данных",
15 | "HTTP Status Code":"HTTP код",
16 | "Reason":"Причина",
17 | "Response Model":"Структура ответа",
18 | "Request URL":"URL запроса",
19 | "Response Body":"Тело ответа",
20 | "Response Code":"HTTP код ответа",
21 | "Response Headers":"Заголовки ответа",
22 | "Hide Response":"Спрятать ответ",
23 | "Headers":"Заголовки",
24 | "Response Messages":"Что может прийти в ответ",
25 | "Try it out!":"Попробовать!",
26 | "Show/Hide":"Показать/Скрыть",
27 | "List Operations":"Операции кратко",
28 | "Expand Operations":"Операции подробно",
29 | "Raw":"В сыром виде",
30 | "can't parse JSON. Raw result":"Не удается распарсить ответ:",
31 | "Example Value":"Пример",
32 | "Model Schema":"Структура",
33 | "Model":"Описание",
34 | "Click to set as parameter value":"Нажмите, чтобы испльзовать в качестве значения параметра",
35 | "apply":"применить",
36 | "Username":"Имя пользователя",
37 | "Password":"Пароль",
38 | "Terms of service":"Условия использования",
39 | "Created by":"Разработано",
40 | "See more at":"Еще тут",
41 | "Contact the developer":"Связаться с разработчиком",
42 | "api version":"Версия API",
43 | "Response Content Type":"Content Type ответа",
44 | "Parameter content type:":"Content Type параметра:",
45 | "fetching resource":"Получение ресурса",
46 | "fetching resource list":"Получение ресурсов",
47 | "Explore":"Показать",
48 | "Show Swagger Petstore Example Apis":"Показать примеры АПИ",
49 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, проблема с настройками доступа",
50 | "Please specify the protocol for":"Пожалуйста, укажите протокол для",
51 | "Can't read swagger JSON from":"Не получается прочитать swagger json из",
52 | "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим",
53 | "Unable to read api":"Не удалось прочитать api",
54 | "from path":"по адресу",
55 | "server returned":"сервер сказал"
56 | });
57 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/ca.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Advertència: Obsolet",
6 | "Implementation Notes":"Notes d'implementació",
7 | "Response Class":"Classe de la Resposta",
8 | "Status":"Estatus",
9 | "Parameters":"Paràmetres",
10 | "Parameter":"Paràmetre",
11 | "Value":"Valor",
12 | "Description":"Descripció",
13 | "Parameter Type":"Tipus del Paràmetre",
14 | "Data Type":"Tipus de la Dada",
15 | "Response Messages":"Missatges de la Resposta",
16 | "HTTP Status Code":"Codi d'Estatus HTTP",
17 | "Reason":"Raó",
18 | "Response Model":"Model de la Resposta",
19 | "Request URL":"URL de la Sol·licitud",
20 | "Response Body":"Cos de la Resposta",
21 | "Response Code":"Codi de la Resposta",
22 | "Response Headers":"Capçaleres de la Resposta",
23 | "Hide Response":"Amagar Resposta",
24 | "Try it out!":"Prova-ho!",
25 | "Show/Hide":"Mostrar/Amagar",
26 | "List Operations":"Llista Operacions",
27 | "Expand Operations":"Expandir Operacions",
28 | "Raw":"Cru",
29 | "can't parse JSON. Raw result":"no puc analitzar el JSON. Resultat cru",
30 | "Example Value":"Valor d'Exemple",
31 | "Model Schema":"Esquema del Model",
32 | "Model":"Model",
33 | "apply":"aplicar",
34 | "Username":"Nom d'usuari",
35 | "Password":"Contrasenya",
36 | "Terms of service":"Termes del servei",
37 | "Created by":"Creat per",
38 | "See more at":"Veure més en",
39 | "Contact the developer":"Contactar amb el desenvolupador",
40 | "api version":"versió de la api",
41 | "Response Content Type":"Tipus de Contingut de la Resposta",
42 | "fetching resource":"recollint recurs",
43 | "fetching resource list":"recollins llista de recursos",
44 | "Explore":"Explorant",
45 | "Show Swagger Petstore Example Apis":"Mostrar API d'Exemple Swagger Petstore",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"No es pot llegir del servidor. Potser no teniu la configuració de control d'accés apropiada.",
47 | "Please specify the protocol for":"Si us plau, especifiqueu el protocol per a",
48 | "Can't read swagger JSON from":"No es pot llegir el JSON de swagger des de",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"Finalitzada la càrrega del recurs informatiu. Renderitzant Swagger UI",
50 | "Unable to read api":"No es pot llegir l'api",
51 | "from path":"des de la ruta",
52 | "server returned":"el servidor ha retornat"
53 | });
54 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/geo.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"ყურადღება: აღარ გამოიყენება",
6 | "Implementation Notes":"იმპლემენტაციის აღწერა",
7 | "Response Class":"რესპონს კლასი",
8 | "Status":"სტატუსი",
9 | "Parameters":"პარამეტრები",
10 | "Parameter":"პარამეტრი",
11 | "Value":"მნიშვნელობა",
12 | "Description":"აღწერა",
13 | "Parameter Type":"პარამეტრის ტიპი",
14 | "Data Type":"მონაცემის ტიპი",
15 | "Response Messages":"პასუხი",
16 | "HTTP Status Code":"HTTP სტატუსი",
17 | "Reason":"მიზეზი",
18 | "Response Model":"რესპონს მოდელი",
19 | "Request URL":"მოთხოვნის URL",
20 | "Response Body":"პასუხის სხეული",
21 | "Response Code":"პასუხის კოდი",
22 | "Response Headers":"პასუხის ჰედერები",
23 | "Hide Response":"დამალე პასუხი",
24 | "Headers":"ჰედერები",
25 | "Try it out!":"ცადე !",
26 | "Show/Hide":"გამოჩენა/დამალვა",
27 | "List Operations":"ოპერაციების სია",
28 | "Expand Operations":"ოპერაციები ვრცლად",
29 | "Raw":"ნედლი",
30 | "can't parse JSON. Raw result":"JSON-ის დამუშავება ვერ მოხერხდა. ნედლი პასუხი",
31 | "Example Value":"მაგალითი",
32 | "Model Schema":"მოდელის სტრუქტურა",
33 | "Model":"მოდელი",
34 | "Click to set as parameter value":"პარამეტრისთვის მნიშვნელობის მისანიჭებლად, დააკლიკე",
35 | "apply":"გამოყენება",
36 | "Username":"მოხმარებელი",
37 | "Password":"პაროლი",
38 | "Terms of service":"მომსახურების პირობები",
39 | "Created by":"შექმნა",
40 | "See more at":"ნახე ვრცლად",
41 | "Contact the developer":"დაუკავშირდი დეველოპერს",
42 | "api version":"api ვერსია",
43 | "Response Content Type":"პასუხის კონტენტის ტიპი",
44 | "Parameter content type:":"პარამეტრის კონტენტის ტიპი:",
45 | "fetching resource":"რესურსების მიღება",
46 | "fetching resource list":"რესურსების სიის მიღება",
47 | "Explore":"ნახვა",
48 | "Show Swagger Petstore Example Apis":"ნახე Swagger Petstore სამაგალითო Api",
49 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"სერვერთან დაკავშირება ვერ ხერხდება. შეამოწმეთ access-control-origin.",
50 | "Please specify the protocol for":"მიუთითეთ პროტოკოლი",
51 | "Can't read swagger JSON from":"swagger JSON წაკითხვა ვერ მოხერხდა",
52 | "Finished Loading Resource Information. Rendering Swagger UI":"რესურსების ჩატვირთვა სრულდება. Swagger UI რენდერდება",
53 | "Unable to read api":"api წაკითხვა ვერ მოხერხდა",
54 | "from path":"მისამართიდან",
55 | "server returned":"სერვერმა დააბრუნა"
56 | });
57 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/it.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Attenzione: Deprecato",
6 | "Implementation Notes":"Note di implementazione",
7 | "Response Class":"Classe della risposta",
8 | "Status":"Stato",
9 | "Parameters":"Parametri",
10 | "Parameter":"Parametro",
11 | "Value":"Valore",
12 | "Description":"Descrizione",
13 | "Parameter Type":"Tipo di parametro",
14 | "Data Type":"Tipo di dato",
15 | "Response Messages":"Messaggi della risposta",
16 | "HTTP Status Code":"Codice stato HTTP",
17 | "Reason":"Motivo",
18 | "Response Model":"Modello di risposta",
19 | "Request URL":"URL della richiesta",
20 | "Response Body":"Corpo della risposta",
21 | "Response Code":"Oggetto della risposta",
22 | "Response Headers":"Intestazioni della risposta",
23 | "Hide Response":"Nascondi risposta",
24 | "Try it out!":"Provalo!",
25 | "Show/Hide":"Mostra/Nascondi",
26 | "List Operations":"Mostra operazioni",
27 | "Expand Operations":"Espandi operazioni",
28 | "Raw":"Grezzo (raw)",
29 | "can't parse JSON. Raw result":"non è possibile parsare il JSON. Risultato grezzo (raw).",
30 | "Model Schema":"Schema del modello",
31 | "Model":"Modello",
32 | "apply":"applica",
33 | "Username":"Nome utente",
34 | "Password":"Password",
35 | "Terms of service":"Condizioni del servizio",
36 | "Created by":"Creato da",
37 | "See more at":"Informazioni aggiuntive:",
38 | "Contact the developer":"Contatta lo sviluppatore",
39 | "api version":"versione api",
40 | "Response Content Type":"Tipo di contenuto (content type) della risposta",
41 | "fetching resource":"recuperando la risorsa",
42 | "fetching resource list":"recuperando lista risorse",
43 | "Explore":"Esplora",
44 | "Show Swagger Petstore Example Apis":"Mostra le api di esempio di Swagger Petstore",
45 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Non è possibile leggere dal server. Potrebbe non avere le impostazioni di controllo accesso origine (access-control-origin) appropriate.",
46 | "Please specify the protocol for":"Si prega di specificare il protocollo per",
47 | "Can't read swagger JSON from":"Impossibile leggere JSON swagger da:",
48 | "Finished Loading Resource Information. Rendering Swagger UI":"Lettura informazioni risorse termianta. Swagger UI viene mostrata",
49 | "Unable to read api":"Impossibile leggere la api",
50 | "from path":"da cartella",
51 | "server returned":"il server ha restituito"
52 | });
53 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/es.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Advertencia: Obsoleto",
6 | "Implementation Notes":"Notas de implementación",
7 | "Response Class":"Clase de la Respuesta",
8 | "Status":"Status",
9 | "Parameters":"Parámetros",
10 | "Parameter":"Parámetro",
11 | "Value":"Valor",
12 | "Description":"Descripción",
13 | "Parameter Type":"Tipo del Parámetro",
14 | "Data Type":"Tipo del Dato",
15 | "Response Messages":"Mensajes de la Respuesta",
16 | "HTTP Status Code":"Código de Status HTTP",
17 | "Reason":"Razón",
18 | "Response Model":"Modelo de la Respuesta",
19 | "Request URL":"URL de la Solicitud",
20 | "Response Body":"Cuerpo de la Respuesta",
21 | "Response Code":"Código de la Respuesta",
22 | "Response Headers":"Encabezados de la Respuesta",
23 | "Hide Response":"Ocultar Respuesta",
24 | "Try it out!":"Pruébalo!",
25 | "Show/Hide":"Mostrar/Ocultar",
26 | "List Operations":"Listar Operaciones",
27 | "Expand Operations":"Expandir Operaciones",
28 | "Raw":"Crudo",
29 | "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo",
30 | "Example Value":"Valor de Ejemplo",
31 | "Model Schema":"Esquema del Modelo",
32 | "Model":"Modelo",
33 | "apply":"aplicar",
34 | "Username":"Nombre de usuario",
35 | "Password":"Contraseña",
36 | "Terms of service":"Términos de Servicio",
37 | "Created by":"Creado por",
38 | "See more at":"Ver más en",
39 | "Contact the developer":"Contactar al desarrollador",
40 | "api version":"versión de la api",
41 | "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta",
42 | "fetching resource":"buscando recurso",
43 | "fetching resource list":"buscando lista del recurso",
44 | "Explore":"Explorar",
45 | "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore",
46 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.",
47 | "Please specify the protocol for":"Por favor, especificar el protocola para",
48 | "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde",
49 | "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI",
50 | "Unable to read api":"No se puede leer la api",
51 | "from path":"desde ruta",
52 | "server returned":"el servidor retornó"
53 | });
54 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/config/SecondDatabaseConfig.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.config;
2 |
3 | import com.alibaba.druid.pool.DruidDataSource;
4 | import com.github.pagehelper.PageHelper;
5 | import org.apache.ibatis.plugin.Interceptor;
6 | import org.apache.ibatis.session.SqlSessionFactory;
7 | import org.mybatis.spring.SqlSessionFactoryBean;
8 | import org.mybatis.spring.annotation.MapperScan;
9 | import org.slf4j.Logger;
10 | import org.slf4j.LoggerFactory;
11 | import org.springframework.boot.context.properties.ConfigurationProperties;
12 | import org.springframework.context.annotation.Bean;
13 | import org.springframework.context.annotation.Configuration;
14 | import org.springframework.jdbc.datasource.DataSourceTransactionManager;
15 | import org.springframework.transaction.PlatformTransactionManager;
16 |
17 | import javax.sql.DataSource;
18 | import java.util.Properties;
19 |
20 | @Configuration
21 | @MapperScan(basePackages = "online.zhaopei.myproject.mapper.second", sqlSessionFactoryRef = "secondSqlSessionFactory")
22 | public class SecondDatabaseConfig {
23 |
24 | private static Logger logger = LoggerFactory.getLogger(SecondDatabaseConfig.class);
25 |
26 | @Bean(name = "secondDataSource")
27 | @ConfigurationProperties(prefix = "spring.datasource.second")
28 | public DataSource secondDataSource() {
29 | return new DruidDataSource();
30 | }
31 |
32 | @Bean(name = "secondSqlSessionFactory")
33 | public SqlSessionFactory secondSqlSessionFactory() throws Exception {
34 | SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
35 | logger.info("second sqlsession--" + this.secondDataSource().hashCode());
36 | sqlSessionFactoryBean.setDataSource(this.secondDataSource());
37 | PageHelper pageHelper = new PageHelper();
38 | Properties properties = new Properties();
39 | properties.setProperty("dialect", "mysql");
40 | properties.setProperty("pageSizeZero", "true");
41 | properties.setProperty("reasonable", "false");
42 | properties.setProperty("params", "pageNum=pageHelperStart;pageSize=pageHelperRows;");
43 | properties.setProperty("supportMethodsArguments", "true");
44 | properties.setProperty("returnPageInfo", "none");
45 | pageHelper.setProperties(properties);
46 | Interceptor[] interceptors = new Interceptor[] { pageHelper };
47 | sqlSessionFactoryBean.setPlugins(interceptors);
48 | return sqlSessionFactoryBean.getObject();
49 | }
50 |
51 |
52 | @Bean(name = "secondTxMan")
53 | public PlatformTransactionManager secondTransactionManager() {
54 | logger.info("second dataSource--" + this.secondDataSource().hashCode());
55 | return new DataSourceTransactionManager(this.secondDataSource());
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/fr.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Avertissement : Obsolète",
6 | "Implementation Notes":"Notes d'implémentation",
7 | "Response Class":"Classe de la réponse",
8 | "Status":"Statut",
9 | "Parameters":"Paramètres",
10 | "Parameter":"Paramètre",
11 | "Value":"Valeur",
12 | "Description":"Description",
13 | "Parameter Type":"Type du paramètre",
14 | "Data Type":"Type de données",
15 | "Response Messages":"Messages de la réponse",
16 | "HTTP Status Code":"Code de statut HTTP",
17 | "Reason":"Raison",
18 | "Response Model":"Modèle de réponse",
19 | "Request URL":"URL appelée",
20 | "Response Body":"Corps de la réponse",
21 | "Response Code":"Code de la réponse",
22 | "Response Headers":"En-têtes de la réponse",
23 | "Hide Response":"Cacher la réponse",
24 | "Headers":"En-têtes",
25 | "Try it out!":"Testez !",
26 | "Show/Hide":"Afficher/Masquer",
27 | "List Operations":"Liste des opérations",
28 | "Expand Operations":"Développer les opérations",
29 | "Raw":"Brut",
30 | "can't parse JSON. Raw result":"impossible de décoder le JSON. Résultat brut",
31 | "Example Value":"Exemple la valeur",
32 | "Model Schema":"Définition du modèle",
33 | "Model":"Modèle",
34 | "apply":"appliquer",
35 | "Username":"Nom d'utilisateur",
36 | "Password":"Mot de passe",
37 | "Terms of service":"Conditions de service",
38 | "Created by":"Créé par",
39 | "See more at":"Voir plus sur",
40 | "Contact the developer":"Contacter le développeur",
41 | "api version":"version de l'api",
42 | "Response Content Type":"Content Type de la réponse",
43 | "fetching resource":"récupération de la ressource",
44 | "fetching resource list":"récupération de la liste de ressources",
45 | "Explore":"Explorer",
46 | "Show Swagger Petstore Example Apis":"Montrer les Apis de l'exemple Petstore de Swagger",
47 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Impossible de lire à partir du serveur. Il se peut que les réglages access-control-origin ne soient pas appropriés.",
48 | "Please specify the protocol for":"Veuillez spécifier un protocole pour",
49 | "Can't read swagger JSON from":"Impossible de lire le JSON swagger à partir de",
50 | "Finished Loading Resource Information. Rendering Swagger UI":"Chargement des informations terminé. Affichage de Swagger UI",
51 | "Unable to read api":"Impossible de lire l'api",
52 | "from path":"à partir du chemin",
53 | "server returned":"réponse du serveur"
54 | });
55 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/config/RabbitMQConfigration.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.config;
2 |
3 | import org.springframework.amqp.core.AcknowledgeMode;
4 | import org.springframework.amqp.core.Queue;
5 | import org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer;
6 | import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
7 | import org.springframework.amqp.rabbit.connection.ConnectionFactory;
8 | import org.springframework.amqp.rabbit.core.RabbitMessagingTemplate;
9 | import org.springframework.amqp.rabbit.core.RabbitTemplate;
10 | import org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar;
11 | import org.springframework.context.annotation.Bean;
12 | import org.springframework.context.annotation.Configuration;
13 | import org.springframework.messaging.converter.MappingJackson2MessageConverter;
14 | import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
15 |
16 |
17 | @Configuration
18 | public class RabbitMQConfigration implements RabbitListenerConfigurer{
19 |
20 | // @Autowired
21 | // private ConnectionFactory connectionFactory;
22 | //
23 | @Bean
24 | public Queue helloQueue() {
25 | return new Queue("hello");
26 | }
27 |
28 | @Bean
29 | public RabbitMessagingTemplate rabbitMessagingTemplate(RabbitTemplate rabbitTemplate) {
30 | RabbitMessagingTemplate rabbitMessagingTemplate = new RabbitMessagingTemplate();
31 | rabbitMessagingTemplate.setMessageConverter(jackson2Converter());
32 | rabbitMessagingTemplate.setRabbitTemplate(rabbitTemplate);
33 | return rabbitMessagingTemplate;
34 | }
35 |
36 | @Bean
37 | public MappingJackson2MessageConverter jackson2Converter() {
38 | MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
39 | return converter;
40 | }
41 |
42 | @Bean
43 | public DefaultMessageHandlerMethodFactory myHandlerMethodFactory() {
44 | DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
45 | factory.setMessageConverter(new MappingJackson2MessageConverter());
46 | return factory;
47 | }
48 |
49 | @Bean
50 | public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) {
51 | SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
52 | factory.setConnectionFactory(connectionFactory);
53 | // factory.setPrefetchCount(5);
54 | factory.setAcknowledgeMode(AcknowledgeMode.AUTO);
55 | return factory;
56 | }
57 |
58 | @Override
59 | public void configureRabbitListeners(RabbitListenerEndpointRegistrar registrar) {
60 | registrar.setMessageHandlerMethodFactory(myHandlerMethodFactory());
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lang/el.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint quotmark: double */
4 | window.SwaggerTranslator.learn({
5 | "Warning: Deprecated":"Προειδοποίηση: Έχει αποσυρθεί",
6 | "Implementation Notes":"Σημειώσεις Υλοποίησης",
7 | "Response Class":"Απόκριση",
8 | "Status":"Κατάσταση",
9 | "Parameters":"Παράμετροι",
10 | "Parameter":"Παράμετρος",
11 | "Value":"Τιμή",
12 | "Description":"Περιγραφή",
13 | "Parameter Type":"Τύπος Παραμέτρου",
14 | "Data Type":"Τύπος Δεδομένων",
15 | "Response Messages":"Μηνύματα Απόκρισης",
16 | "HTTP Status Code":"Κωδικός Κατάστασης HTTP",
17 | "Reason":"Αιτιολογία",
18 | "Response Model":"Μοντέλο Απόκρισης",
19 | "Request URL":"URL Αιτήματος",
20 | "Response Body":"Σώμα Απόκρισης",
21 | "Response Code":"Κωδικός Απόκρισης",
22 | "Response Headers":"Επικεφαλίδες Απόκρισης",
23 | "Hide Response":"Απόκρυψη Απόκρισης",
24 | "Headers":"Επικεφαλίδες",
25 | "Try it out!":"Δοκιμάστε το!",
26 | "Show/Hide":"Εμφάνιση/Απόκρυψη",
27 | "List Operations":"Λίστα Λειτουργιών",
28 | "Expand Operations":"Ανάπτυξη Λειτουργιών",
29 | "Raw":"Ακατέργαστο",
30 | "can't parse JSON. Raw result":"αδυναμία ανάλυσης JSON. Ακατέργαστο αποτέλεσμα",
31 | "Example Value":"Παράδειγμα Τιμής",
32 | "Model Schema":"Σχήμα Μοντέλου",
33 | "Model":"Μοντέλο",
34 | "Click to set as parameter value":"Πατήστε για να θέσετε τιμή παραμέτρου",
35 | "apply":"εφαρμογή",
36 | "Username":"Όνομα χρήση",
37 | "Password":"Κωδικός πρόσβασης",
38 | "Terms of service":"Όροι χρήσης",
39 | "Created by":"Δημιουργήθηκε από",
40 | "See more at":"Δείτε περισσότερα στο",
41 | "Contact the developer":"Επικοινωνήστε με τον προγραμματιστή",
42 | "api version":"έκδοση api",
43 | "Response Content Type":"Τύπος Περιεχομένου Απόκρισης",
44 | "Parameter content type:":"Τύπος περιεχομένου παραμέτρου:",
45 | "fetching resource":"παραλαβή πόρου",
46 | "fetching resource list":"παραλαβή λίστας πόρων",
47 | "Explore":"Εξερεύνηση",
48 | "Show Swagger Petstore Example Apis":"Εμφάνιση Api Δειγμάτων Petstore του Swagger",
49 | "Can't read from server. It may not have the appropriate access-control-origin settings.":"Αδυναμία ανάγνωσης από τον εξυπηρετητή. Μπορεί να μην έχει κατάλληλες ρυθμίσεις για access-control-origin.",
50 | "Please specify the protocol for":"Παρακαλώ προσδιορίστε το πρωτόκολλο για",
51 | "Can't read swagger JSON from":"Αδυναμία ανάγνωσης swagger JSON από",
52 | "Finished Loading Resource Information. Rendering Swagger UI":"Ολοκλήρωση Φόρτωσης Πληροφορικών Πόρου. Παρουσίαση Swagger UI",
53 | "Unable to read api":"Αδυναμία ανάγνωσης api",
54 | "from path":"από το μονοπάτι",
55 | "server returned":"ο εξυπηρετηρής επέστρεψε"
56 | });
57 |
--------------------------------------------------------------------------------
/src/main/resources/application-integration-redis.xml:
--------------------------------------------------------------------------------
1 |
2 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lib/jquery.ba-bbq.min.js:
--------------------------------------------------------------------------------
1 | !function(e,t){function n(e){return"string"==typeof e}function r(e){var t=g.call(arguments,1);return function(){return e.apply(this,t.concat(g.call(arguments)))}}function o(e){return e.replace(/^[^#]*#?(.*)$/,"$1")}function a(e){return e.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function i(r,o,a,i,c){var u,s,p,h,d;return i!==f?(p=a.match(r?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/),d=p[3]||"",2===c&&n(i)?s=i.replace(r?R:E,""):(h=l(p[2]),i=n(i)?l[r?A:w](i):i,s=2===c?i:1===c?e.extend({},i,h):e.extend({},h,i),s=b(s),r&&(s=s.replace(m,y))),u=p[1]+(r?"#":s||!p[1]?"?":"")+s+d):u=o(a!==f?a:t[S][q]),u}function c(e,t,r){return t===f||"boolean"==typeof t?(r=t,t=b[e?A:w]()):t=n(t)?t.replace(e?R:E,""):t,l(t,r)}function u(t,r,o,a){return n(o)||"object"==typeof o||(a=o,o=r,r=f),this.each(function(){var n=e(this),i=r||v()[(this.nodeName||"").toLowerCase()]||"",c=i&&n.attr(i)||"";n.attr(i,b[t](c,o,a))})}var f,s,l,p,h,d,v,m,g=Array.prototype.slice,y=decodeURIComponent,b=e.param,$=e.bbq=e.bbq||{},x=e.event.special,j="hashchange",w="querystring",A="fragment",N="elemUrlAttr",S="location",q="href",C="src",E=/^.*\?|#.*$/g,R=/^.*\#/,U={};b[w]=r(i,0,a),b[A]=s=r(i,1,o),s.noEscape=function(t){t=t||"";var n=e.map(t.split(""),encodeURIComponent);m=new RegExp(n.join("|"),"g")},s.noEscape(",/"),e.deparam=l=function(t,n){var r={},o={"true":!0,"false":!1,"null":null};return e.each(t.replace(/\+/g," ").split("&"),function(t,a){var i,c=a.split("="),u=y(c[0]),s=r,l=0,p=u.split("]["),h=p.length-1;if(/\[/.test(p[0])&&/\]$/.test(p[h])?(p[h]=p[h].replace(/\]$/,""),p=p.shift().split("[").concat(p),h=p.length-1):h=0,2===c.length)if(i=y(c[1]),n&&(i=i&&!isNaN(i)?+i:"undefined"===i?f:o[i]!==f?o[i]:i),h)for(;l<=h;l++)u=""===p[l]?s.length:p[l],s=s[u]=l ').hide().insertAfter("body")[0].contentWindow,s=function(){return r(a.document[i][u])},(f=function(e,t){if(e!==t){var n=a.document;n.open().close(),n[i].hash="#"+e}})(r()))}var o,a,f,s,p={};return p.start=function(){if(!o){var a=r();f||n(),function l(){var n=r(),p=s(a);n!==a?(f(a=n,p),e(t).trigger(c)):p!==a&&(t[i][u]=t[i][u].replace(/#.*/,"")+"#"+p),o=setTimeout(l,e[c+"Delay"])}()}},p.stop=function(){a||(o&&clearTimeout(o),o=0)},p}()}(jQuery,this);
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/css/style.css:
--------------------------------------------------------------------------------
1 | .swagger-section #header a#logo{font-size:1.5em;font-weight:700;text-decoration:none;background:transparent url(../images/logo.png) no-repeat 0;padding:20px 0 20px 40px}#text-head{font-size:80px;font-family:Roboto,sans-serif;color:#fff;float:right;margin-right:20%}.navbar-fixed-top .navbar-brand,.navbar-fixed-top .navbar-nav,.navbar-header{height:auto}.navbar-inverse{background-color:#000;border-color:#000}#navbar-brand{margin-left:20%}.navtext{font-size:10px}.h1,h1{font-size:60px}.navbar-default .navbar-header .navbar-brand{color:#a2dfee}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a{color:#393939;font-family:Arvo,serif;font-size:1.5em}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover{color:#000}.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2{color:#525252;padding-left:0;display:block;clear:none;float:left;font-family:Arvo,serif;font-weight:700}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#0a0a0a}.container1{width:1500px;margin:auto;margin-top:0;background-image:url(../images/shield.png);background-repeat:no-repeat;background-position:-40px -20px;margin-bottom:210px}.container-inner{width:1200px;margin:auto;background-color:hsla(192,8%,88%,.75);padding-bottom:40px;padding-top:40px;border-radius:15px}.header-content{padding:0;width:1000px}.title1{font-size:80px;font-family:Vollkorn,serif;color:#404040;text-align:center;padding-top:40px;padding-bottom:100px}#icon{margin-top:-18px}.subtext{font-size:25px;font-style:italic;color:#08b;text-align:right;padding-right:250px}.bg-primary{background-color:#00468b}.navbar-default .nav>li>a,.navbar-default .nav>li>a:focus,.navbar-default .nav>li>a:focus:hover,.navbar-default .nav>li>a:hover{color:#08b}.text-faded{font-size:25px;font-family:Vollkorn,serif}.section-heading{font-family:Vollkorn,serif;font-size:45px;padding-bottom:10px}hr{border-color:#00468b;padding-bottom:10px}.description{margin-top:20px;padding-bottom:200px}.description li{font-family:Vollkorn,serif;font-size:25px;color:#525252;margin-left:28%;padding-top:5px}.gap{margin-top:200px}.troubleshootingtext{color:hsla(0,0%,100%,.7);padding-left:30%}.troubleshootingtext li{list-style-type:circle;font-size:25px;padding-bottom:5px}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1}.block.response_body.json:hover{cursor:pointer}.backdrop{color:blue}#myModal{height:100%}.modal-backdrop{bottom:0;position:fixed}.curl{padding:10px;font-family:Anonymous Pro,Menlo,Consolas,Bitstream Vera Sans Mono,Courier New,monospace;font-size:.9em;max-height:400px;margin-top:5px;overflow-y:auto;background-color:#fcf6db;border:1px solid #e5e0c6;border-radius:4px}.curl_title{font-size:1.1em;margin:0;padding:15px 0 5px;font-family:Open Sans,Helvetica Neue,Arial,sans-serif;font-weight:500;line-height:1.1}.footer{display:none}.swagger-section .swagger-ui-wrap h2{padding:0}h2{margin:0;margin-bottom:5px}.markdown p,.swagger-section .swagger-ui-wrap .code{font-size:15px;font-family:Arvo,serif}.swagger-section .swagger-ui-wrap b{font-family:Arvo,serif}#signin:hover{cursor:pointer}.dropdown-menu{padding:15px}.navbar-right .dropdown-menu{left:0;right:auto}#signinbutton{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b}.navbar-default .nav>li .details{color:#000;text-transform:none;font-size:15px;font-weight:400;font-family:Open Sans,sans-serif;font-style:italic;line-height:20px;top:-2px}.navbar-default .nav>li .details:hover{color:#000}#signout{width:100%;height:32px;font-size:13px;font-weight:700;color:#08b}
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/config/PrimaryDatabaseConfiguration.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.config;
2 |
3 | import com.alibaba.druid.pool.DruidDataSource;
4 | import com.alibaba.druid.support.http.StatViewServlet;
5 | import com.alibaba.druid.support.http.WebStatFilter;
6 | import com.github.pagehelper.PageHelper;
7 | import org.apache.ibatis.plugin.Interceptor;
8 | import org.apache.ibatis.session.SqlSessionFactory;
9 | import org.mybatis.spring.SqlSessionFactoryBean;
10 | import org.mybatis.spring.annotation.MapperScan;
11 | import org.slf4j.Logger;
12 | import org.slf4j.LoggerFactory;
13 | import org.springframework.boot.context.properties.ConfigurationProperties;
14 | import org.springframework.boot.web.servlet.FilterRegistrationBean;
15 | import org.springframework.boot.web.servlet.ServletRegistrationBean;
16 | import org.springframework.context.annotation.Bean;
17 | import org.springframework.context.annotation.Configuration;
18 | import org.springframework.context.annotation.Primary;
19 | import org.springframework.jdbc.datasource.DataSourceTransactionManager;
20 | import org.springframework.transaction.PlatformTransactionManager;
21 | import org.springframework.transaction.annotation.EnableTransactionManagement;
22 |
23 | import javax.sql.DataSource;
24 | import java.util.Properties;
25 |
26 | @Configuration
27 | @EnableTransactionManagement
28 | @MapperScan(basePackages = "online.zhaopei.myproject.mapper.primary", sqlSessionFactoryRef = "primarySqlSessionFactory")
29 | public class PrimaryDatabaseConfiguration {
30 |
31 | private static Logger logger = LoggerFactory.getLogger(PrimaryDatabaseConfiguration.class);
32 |
33 | @Bean
34 | public ServletRegistrationBean druidServlet() {
35 | ServletRegistrationBean reg = new ServletRegistrationBean();
36 | reg.setServlet(new StatViewServlet());
37 | reg.addUrlMappings("/druid/*");
38 | // reg.addInitParameter("allow", "127.0.0.1");
39 | // reg.addInitParameter("deny","");
40 | reg.addInitParameter("loginUsername", "admin");
41 | reg.addInitParameter("loginPassword", "admin");
42 | return reg;
43 | }
44 |
45 | @Primary
46 | @Bean(name = "primaryDataSource")
47 | @ConfigurationProperties(prefix = "spring.datasource.primary")
48 | public DataSource primeryDataSource() {
49 | return new DruidDataSource();
50 | }
51 |
52 | @Primary
53 | @Bean(name = "primarySqlSessionFactory")
54 | public SqlSessionFactory primarySqlSessionFactory() throws Exception {
55 | SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
56 | logger.info("primary sqlsession--" + this.primeryDataSource().hashCode());
57 | sqlSessionFactoryBean.setDataSource(this.primeryDataSource());
58 | PageHelper pageHelper = new PageHelper();
59 | Properties properties = new Properties();
60 | properties.setProperty("dialect", "mysql");
61 | properties.setProperty("pageSizeZero", "true");
62 | properties.setProperty("reasonable", "false");
63 | properties.setProperty("params", "pageNum=pageHelperStart;pageSize=pageHelperRows;");
64 | properties.setProperty("supportMethodsArguments", "true");
65 | properties.setProperty("returnPageInfo", "none");
66 | pageHelper.setProperties(properties);
67 | Interceptor[] interceptors = new Interceptor[] { pageHelper };
68 | sqlSessionFactoryBean.setPlugins(interceptors);
69 | return sqlSessionFactoryBean.getObject();
70 | }
71 |
72 | @Bean(name = "primaryTxMan")
73 | public PlatformTransactionManager primaryTransactionManager() {
74 | logger.info("primary dataSource--" + this.primeryDataSource().hashCode());
75 | return new DataSourceTransactionManager(this.primeryDataSource());
76 | }
77 |
78 | @Bean
79 | public FilterRegistrationBean filterRegistrationBean() {
80 | FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
81 | filterRegistrationBean.setFilter(new WebStatFilter());
82 | filterRegistrationBean.addUrlPatterns("/*");
83 | filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
84 | return filterRegistrationBean;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | online.zhaopei
7 | springboot
8 | 1.0
9 |
10 |
11 | org.springframework.boot
12 | spring-boot-starter-parent
13 | 2.1.0.RELEASE
14 |
15 |
16 |
17 | UTF-8
18 | UTF-8
19 | 1.8
20 |
21 |
22 |
23 | org.springframework.boot
24 | spring-boot-starter-actuator
25 |
26 |
27 | org.springframework.boot
28 | spring-boot-starter-web
29 |
30 |
31 | org.springframework.boot
32 | spring-boot-starter-data-redis
33 |
34 |
35 | org.springframework.boot
36 | spring-boot-starter-jersey
37 |
38 |
39 | org.mybatis.spring.boot
40 | mybatis-spring-boot-starter
41 | 1.1.1
42 |
43 |
44 | org.springframework.boot
45 | spring-boot-starter-amqp
46 |
47 |
48 | org.springframework.boot
49 | spring-boot-starter-integration
50 |
51 |
52 | org.springframework.integration
53 | spring-integration-file
54 |
55 |
56 | org.springframework.integration
57 | spring-integration-redis
58 |
59 |
60 | org.springframework.boot
61 | spring-boot-starter-undertow
62 |
63 |
64 | io.swagger
65 | swagger-jersey2-jaxrs
66 | 1.5.10
67 |
68 |
69 | org.springframework.boot
70 | spring-boot-devtools
71 | true
72 |
73 |
74 | mysql
75 | mysql-connector-java
76 |
77 |
78 | com.alibaba
79 | druid
80 | 1.0.25
81 |
82 |
83 | com.github.pagehelper
84 | pagehelper
85 | 4.1.6
86 |
87 |
88 | com.google.code.gson
89 | gson
90 | 2.8.0
91 |
92 |
93 | org.springframework.boot
94 | spring-boot-starter-test
95 | test
96 |
97 |
98 | org.codehaus.jackson
99 | jackson-mapper-asl
100 | 1.9.13
101 |
102 |
103 | org.codehaus.jackson
104 | jackson-core-asl
105 | 1.9.13
106 |
107 |
108 | org.apache.cxf
109 | cxf-spring-boot-starter-jaxws
110 | 3.2.1
111 |
112 |
113 | com.google.zxing
114 | javase
115 | 3.3.1
116 |
117 |
118 | net.coobird
119 | thumbnailator
120 | 0.4.8
121 |
122 |
123 |
124 |
125 |
126 | org.springframework.boot
127 | spring-boot-maven-plugin
128 |
129 |
130 |
131 |
132 |
133 |
134 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Swagger UI
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
90 |
91 |
92 |
93 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/src/main/java/online/zhaopei/myproject/util/QRCodeUtil.java:
--------------------------------------------------------------------------------
1 | package online.zhaopei.myproject.util;
2 |
3 | import com.google.zxing.BarcodeFormat;
4 | import com.google.zxing.EncodeHintType;
5 | import com.google.zxing.MultiFormatWriter;
6 | import com.google.zxing.WriterException;
7 | import com.google.zxing.client.j2se.MatrixToImageConfig;
8 | import com.google.zxing.client.j2se.MatrixToImageWriter;
9 | import com.google.zxing.common.BitMatrix;
10 | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
11 | import net.coobird.thumbnailator.Thumbnails;
12 | import net.coobird.thumbnailator.geometry.Positions;
13 |
14 | import javax.imageio.ImageIO;
15 | import java.awt.*;
16 | import java.awt.image.BufferedImage;
17 | import java.io.File;
18 | import java.io.IOException;
19 | import java.io.OutputStream;
20 | import java.util.HashMap;
21 | import java.util.Map;
22 |
23 | /**
24 | * Created by zhaopei on 18/1/22.
25 | */
26 | public class QRCodeUtil {
27 | private static final int width = 300;// 默认二维码宽度
28 | private static final int height = 300;// 默认二维码高度
29 | private static int onColor = 0x00000000; //前景色
30 | private static int offColor = 0xFFFFFFFF; //背景色
31 | private static final String format = "png";// 默认二维码文件格式
32 | private static final Map hints = new HashMap();// 二维码参数
33 |
34 | static {
35 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8");// 字符编码
36 | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);// 容错等级 L、M、Q、H 其中 L 为最低, H 为最高
37 | hints.put(EncodeHintType.MARGIN, 2);// 二维码与图片边距
38 | }
39 | /**
40 | * 返回一个 BufferedImage 对象
41 | * @param content 二维码内容
42 | * @param width 宽
43 | * @param height 高
44 | */
45 | public static BufferedImage toBufferedImage(String content, int width, int height) throws WriterException, IOException {
46 | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints);
47 | return MatrixToImageWriter.toBufferedImage(bitMatrix);
48 | }
49 | /**
50 | * 将二维码图片输出到一个流中
51 | * @param content 二维码内容
52 | * @param stream 输出流
53 | * @param width 宽
54 | * @param height 高
55 | */
56 | public static void writeToStream(String content, OutputStream stream, int width, int height) throws WriterException, IOException {
57 | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints);
58 | MatrixToImageWriter.writeToStream(bitMatrix, format, stream);
59 | }
60 | /**
61 | * 生成二维码图片文件
62 | * @param content 二维码内容
63 | * @param path 文件保存路径
64 | * @param width 宽
65 | * @param height 高
66 | */
67 | public static void createQRCode(String content, String path, int width, int height) throws WriterException, IOException {
68 | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints);
69 | //toPath() 方法由 jdk1.7 及以上提供
70 | MatrixToImageWriter.writeToPath(bitMatrix, format, new File(path).toPath());
71 | }
72 |
73 | /**
74 | * 二维码绘制logo
75 | * @param qrCodeImg 二维码图片文件
76 | * @param logoImg logo图片文件
77 | * */
78 | private static BufferedImage encodeImgLogo(BufferedImage qrCodeImg, File logoImg){
79 | try{
80 | if(null == qrCodeImg|| !logoImg.isFile()){
81 | return null;
82 | }
83 |
84 | //获取画笔
85 | Graphics2D g = qrCodeImg.createGraphics();
86 | //读取logo图片
87 | BufferedImage logo = ImageIO.read(logoImg);
88 | //设置二维码大小,太大,会覆盖二维码,此处20%
89 | int logoWidth = logo.getWidth(null) > qrCodeImg.getWidth() * 2 / 10 ?
90 | (qrCodeImg.getWidth() * 2 / 10) : logo.getWidth(null);
91 | int logoHeight = logo.getHeight(null) > qrCodeImg.getHeight() * 2 / 10 ?
92 | (qrCodeImg.getHeight() * 2 / 10) : logo.getHeight(null);
93 | //设置logo图片放置位置
94 | //中心
95 | int x = (qrCodeImg.getWidth() - logoWidth) / 2;
96 | int y = (qrCodeImg.getHeight() - logoHeight) / 2;
97 | //右下角,15为调整值
98 | // int x = twodimensioncode.getWidth() - logoWidth-15;
99 | // int y = twodimensioncode.getHeight() - logoHeight-15;
100 | //开始合并绘制图片
101 | g.drawImage(logo, x, y, logoWidth, logoHeight, null);
102 | g.drawRoundRect(x, y, logoWidth, logoHeight, 15 ,15);
103 | //logo边框大小
104 | g.setStroke(new BasicStroke(2));
105 | //logo边框颜色
106 | g.setColor(Color.white);
107 | g.drawRect(x, y, logoWidth, logoHeight);
108 | g.dispose();
109 | logo.flush();
110 | qrCodeImg.flush();
111 | }catch(Exception e){
112 | System.out.println("二维码绘制logo失败");
113 | }
114 | return qrCodeImg;
115 | }
116 |
117 | public static BufferedImage toBufferedImage(BitMatrix matrix){
118 | int width = matrix.getWidth();
119 | int height = matrix.getHeight();
120 | BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
121 |
122 | for(int x = 0;x < width; x++){
123 | for(int y = 0;y < height; y++){
124 | image.setRGB(x, y, matrix.get(x, y) ? onColor : offColor);
125 | }
126 | }
127 | return image;
128 | }
129 |
130 | /**
131 | * 生成logo二维码,用Thumbnails
132 | * @param logoPath logo图片路径
133 | * @param content 二维码内容
134 | * @param path 生成二维码路径
135 | * @param width 宽
136 | * @param height 高
137 | * @throws WriterException
138 | * @throws IOException
139 | */
140 | public static void createLogoQRCode(String logoPath, String content, String path, int width, int height) throws WriterException, IOException {
141 | BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints);
142 | BufferedImage bi = toBufferedImage(bitMatrix);
143 | //使用 Graphics2D,logo宽,高不超过二维码的20%
144 | bi = encodeImgLogo(bi, new File(logoPath));
145 | ImageIO.write(bi, path.substring(path.lastIndexOf(".") + 1, path.length()), new File(path));
146 | //使用Thumbnails
147 | //Thumbnails.Builder builder = Thumbnails.of(bi);
148 | //BufferedImage logoImage = Thumbnails.of(new File(logoPath)).forceSize((int) (width * 0.2), (int) (height * 0.2)).asBufferedImage();
149 | //builder.watermark(Positions.CENTER, logoImage, 1F).scale(1F).toFile(new File(path));
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/src/main/resources/static/apidocs/lib/swagger-oauth.js:
--------------------------------------------------------------------------------
1 | function handleLogin(){var e=[],o=window.swaggerUiAuth.authSchemes||window.swaggerUiAuth.securityDefinitions;if(o){var i,a=o;for(i in a){var n=a[i];if("oauth2"===n.type&&n.scopes){var t;if(Array.isArray(n.scopes)){var p;for(p=0;p
"+s(c.message+"",!0)+" ";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,u,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},u=0;u ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,u=0;u1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===i[1]||"script"===i[1]||"style"===i[1],text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=s(this.smartypants(i[0]));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+=""+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?''+(n?e:s(e,!0))+"\n \n":""+(n?e:s(e,!0))+"\n "},n.prototype.blockquote=function(e){return"\n"+e+" \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"\n"},n.prototype.hr=function(){return this.options.xhtml?" \n":" \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+""+n+">\n"},n.prototype.listitem=function(e){return""+e+" \n"},n.prototype.paragraph=function(e){return""+e+"
\n"},n.prototype.table=function(e,t){return"\n"},n.prototype.tablerow=function(e){return"\n"+e+" \n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+""+n+">\n"},n.prototype.strong=function(e){return""+e+" "},n.prototype.em=function(e){return""+e+" "},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?" ":" "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(0===r.indexOf("javascript:"))return""}var l='"+n+" "},n.prototype.image=function(e,t,n){var r=' ":">"},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e").attr(t);this.setElement(n,!1)}}}),e.sync=function(t,n,s){var r=E[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:r,dataType:"json"};if(s.url||(a.url=i.result(n,"url")||j()),null!=s.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(s.attrs||n.toJSON(s))),s.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),s.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",s.emulateJSON&&(a.data._method=r);var o=s.beforeSend;s.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",r),o)return o.apply(this,arguments)}}"GET"===a.type||s.emulateJSON||(a.processData=!1),"PATCH"===a.type&&x&&(a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var h=s.xhr=e.ajax(i.extend(a,s));return n.trigger("request",n,h,s),h};var x=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),E={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var k=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},T=/\((.*?)\)/g,$=/(\(\?)?:\w+/g,S=/\*\w+/g,H=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(k.prototype,o,{initialize:function(){},route:function(t,n,s){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(s=n,n=""),s||(s=this[n]);var r=this;return e.history.route(t,function(i){var a=r._extractParameters(t,i);r.execute(s,a),r.trigger.apply(r,["route:"+n].concat(a)),r.trigger("route",n,a),e.history.trigger("route",r,n,a)}),this},execute:function(t,e){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(H,"\\$&").replace(T,"(?:$1)?").replace($,function(t,e){return e?t:"([^/?]+)"}).replace(S,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null})}});var A=e.History=function(){this.handlers=[],i.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},I=/^[#\/]|\s+$/g,N=/^\/+|\/+$/g,R=/msie [\w.]+/,O=/\/$/,P=/#.*$/;A.started=!1,i.extend(A.prototype,o,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(null==t)if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(O,"");t.indexOf(i)||(t=t.slice(i.length))}else t=this.getHash();return t.replace(I,"")},start:function(t){if(A.started)throw new Error("Backbone.history has already been started");A.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var n=this.getFragment(),s=document.documentMode,r=R.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);if(this.root=("/"+this.root+"/").replace(N,"/"),r&&this._wantsHashChange){var a=e.$('