Commit 3f59594c by chenweisong

更新

parent 1ec66554
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.keymobile</groupId> <groupId>com.keymobile</groupId>
<artifactId>activiti</artifactId> <artifactId>admin</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<description>Activiti Demo</description> <description>Activiti Demo</description>
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<build> <build>
<finalName>mdsactiviti</finalName> <finalName>admin</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
package com.keymobile.rest.conf;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.List;
@Configuration
@EnableSwagger2
public class Swagger2Config {
@Value("${swagger2.host}")
private String host;
/**
* 该套 API 说明,包含作者、简介、版本、host、服务URL
*
* @return
*/
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("补录系统")
.description("补录系统api")
.termsOfServiceUrl("")
.version("1.0.0")
.contact(new Contact("", "", ""))
.build();
}
@Bean
public Docket createRestApi() {
ParameterBuilder builder = new ParameterBuilder();
Parameter parameter = builder
// 从cookie中获取token
.parameterType("cookie") // 参数类型支持header, cookie, body, query etc
.name("token") // 参数名
.defaultValue("") // 默认值
.description("请输入token")
.modelRef(new ModelRef("string")) // 指定参数值的类型
.required(false).build(); // 非必需,这里是全局配置,然而在登陆的时候是不用验证的
List<Parameter> parameters = Lists.newArrayList(parameter);
return new Docket(DocumentationType.SWAGGER_2)
.host(this.host)
.select()
.apis(RequestHandlerSelectors.basePackage("com.keymobile.rest.ctrl"))
.paths(PathSelectors.any())
.build()
.apiInfo(this.apiInfo());
}
}
\ No newline at end of file
...@@ -36,7 +36,6 @@ import java.util.stream.Collectors; ...@@ -36,7 +36,6 @@ import java.util.stream.Collectors;
@RequestMapping(path = "/api") @RequestMapping(path = "/api")
public class IndexCtrl { public class IndexCtrl {
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@Autowired @Autowired
......
package com.keymobile.rest.service; package com.keymobile.rest.service;
import com.keymobile.rest.dao.TaskDao; import com.keymobile.rest.dao.TaskDao;
import com.keymobile.rest.dao.UserDao;
import com.keymobile.rest.model.Task; import com.keymobile.rest.model.Task;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
...@@ -10,7 +9,7 @@ import org.springframework.data.domain.Pageable; ...@@ -10,7 +9,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service(value = "ApiTaskService") @Service("ApiTaskService")
public class TaskService { public class TaskService {
@Autowired @Autowired
......
...@@ -51,6 +51,12 @@ server: ...@@ -51,6 +51,12 @@ server:
app: app:
active-process: RecordProcess.bpmn active-process: RecordProcess.bpmn
swagger2:
# host: localhost:8110
host: 47.105.236.43/activiti
security: security:
permit: true permit: true
authUser: root authUser: root
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment