Skip to content

Commit

Permalink
各功能的完善
Browse files Browse the repository at this point in the history
  • Loading branch information
lancelee98 committed Dec 18, 2018
1 parent 53de3cf commit 92f0b14
Show file tree
Hide file tree
Showing 62 changed files with 96,904 additions and 196 deletions.
210 changes: 105 additions & 105 deletions sql/guns.sql

Large diffs are not rendered by default.

41 changes: 32 additions & 9 deletions src/main/java/cn/stylefeng/guns/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@
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.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;

/**
* swagger配置类
*
Expand All @@ -40,23 +46,40 @@ public class SwaggerConfig {

@Bean
public Docket createRestApi() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name("Authorization").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
//添加head参数配置end
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) //这里采用包含注解的方式来确定要显示的接口
//.apis(RequestHandlerSelectors.basePackage("cn.stylefeng.guns.modular.system.controller")) //这里采用包扫描的方式来确定要显示的接口
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any())
.build();
.build()
.globalOperationParameters(pars);//注意这里
// return new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(apiInfo())
// .select()
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) //这里采用包含注解的方式来确定要显示的接口
// //.apis(RequestHandlerSelectors.basePackage("cn.stylefeng.guns.modular.system.datastatstic")) //这里采用包扫描的方式来确定要显示的接口
// .paths(PathSelectors.any())
// .build();
}

private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Guns Doc")
.description("Guns Api文档")
.termsOfServiceUrl("https://gitee.com/stylefeng/guns")
.contact("stylefeng")
.version("2.0")
.title("小区人口管理系统接口说明")
.version("1.0")
.build();
// return new ApiInfoBuilder()
// .title("Guns Doc")
// .description("Guns Api文档")
// .termsOfServiceUrl("https://gitee.com/stylefeng/guns")
// .contact("stylefeng")
// .version("2.0")
// .build();
}

}


Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ public Object delete(@RequestParam Integer affairId) {
public Object update(@PathVariable Integer affairId,Affair affair) {
affair.setAffairId(affairId);
String content=affair.getReceipt();
content=content.replaceAll("(&\\s)+", "&");
String nescapeStr2 = StringEscapeUtils.unescapeXml(content);
affair.setReceipt(nescapeStr2);
// content=content.replaceAll("(&\\s)+", "&");
// String nescapeStr2 = StringEscapeUtils.unescapeXml(content);
affair.setReceipt(content);
affair.setAdminId(ShiroKit.getUser().getId());
affair.setSolved(1);
affairService.updateById(affair);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
*/
public interface IAffairService extends IService<Affair> {
List<Map<String, Object>> list(@Param("condition") String condition);
List<Affair> selectByIdNum(@Param("idNumber") Integer idNumber);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
public List<Map<String, Object>> list(String condition) {
return this.baseMapper.list(condition);
}

@Override
public List<Affair> selectByIdNum(Integer idNumber) {
return this.baseMapper.selectByIdNum(idNumber);
}
}
Loading

0 comments on commit 92f0b14

Please sign in to comment.