Commit fb5a3237 authored by Quxl's avatar Quxl

优化SwaggerUI,优化接口文档

parent 5db250e7
...@@ -46,9 +46,9 @@ public class MemberOpenApiController { ...@@ -46,9 +46,9 @@ public class MemberOpenApiController {
@PostMapping("register") @PostMapping("register")
@ApiOperation("会员注册") @ApiOperation("会员注册")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "username"), @ApiImplicitParam(paramType = "query", dataType = "String", required = true, name = "username"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "password"), @ApiImplicitParam(paramType = "query", dataType = "String", required = true, name = "password"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "email"), @ApiImplicitParam(paramType = "query", dataType = "String", required = true, name = "email"),
}) })
public Object register(HttpServletRequest request, String username, String password, String email) { public Object register(HttpServletRequest request, String username, String password, String email) {
XException.assertNotBlank(messages.get("err.email_null"), email); XException.assertNotBlank(messages.get("err.email_null"), email);
...@@ -76,7 +76,7 @@ public class MemberOpenApiController { ...@@ -76,7 +76,7 @@ public class MemberOpenApiController {
@ResponseBody @ResponseBody
@PostMapping("resetPassword") @PostMapping("resetPassword")
@ApiOperation("找回密码") @ApiOperation("找回密码")
@ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "email")}) @ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "String", required = true, name = "email")})
public Object resetPassword(String email) { public Object resetPassword(String email) {
XException.assertNotBlank(messages.get("err.email_null"), email); XException.assertNotBlank(messages.get("err.email_null"), email);
int code = (int) ((Math.random() * 9 + 1) * 10000000); int code = (int) ((Math.random() * 9 + 1) * 10000000);
...@@ -113,7 +113,7 @@ public class MemberOpenApiController { ...@@ -113,7 +113,7 @@ public class MemberOpenApiController {
@ResponseBody @ResponseBody
@PostMapping("setLocale") @PostMapping("setLocale")
@ApiOperation("设置语言环境") @ApiOperation("设置语言环境")
@ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "i18n_language", defaultValue="zh_CN")}) @ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "String", required = true, name = "i18n_language", defaultValue="zh_CN")})
public Object setLocale(HttpSession session, String i18n_language) { public Object setLocale(HttpSession session, String i18n_language) {
Locale locale = new Locale(i18n_language); Locale locale = new Locale(i18n_language);
session.setAttribute(LocaleSessionInterceptor.I18N_LANGUAGE_SESSION, locale); session.setAttribute(LocaleSessionInterceptor.I18N_LANGUAGE_SESSION, locale);
......
...@@ -51,8 +51,8 @@ public class MemberApplyController { ...@@ -51,8 +51,8 @@ public class MemberApplyController {
@PostMapping("save_type") @PostMapping("save_type")
@ApiOperation("新增影片,并保存申报影片类型") @ApiOperation("新增影片,并保存申报影片类型")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_type_name", value="影片类型"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_type_name", value="影片类型"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "enroll_type_name", value="影片性质"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="enroll_type_name", value="影片性质"),
}) })
public Object saveMemberFilmType(String film_type_name, String enroll_type_name) { public Object saveMemberFilmType(String film_type_name, String enroll_type_name) {
LoginToken loginToken = tokenService.getToken(); LoginToken loginToken = tokenService.getToken();
...@@ -65,15 +65,27 @@ public class MemberApplyController { ...@@ -65,15 +65,27 @@ public class MemberApplyController {
@PostMapping("save_base") @PostMapping("save_base")
@ApiOperation("保存影片基本信息") @ApiOperation("保存影片基本信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "member_film_id", value="影片ID"), @ApiImplicitParam(paramType="query", dataType="long", required=true, name="member_film_id", value="影片ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "enroll_type_name_other", value="申报奖项", allowMultiple=true), @ApiImplicitParam(paramType="query", dataType="string", required=false, name="enroll_type_name_other", value="申报奖项", allowMultiple=true),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "cn_name", value="中文名称"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="cn_name", value="中文名称"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "cn_name", value="英文名称"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="cn_name", value="英文名称"),
}) })
public Object saveMemberFilmBase(Long member_film_id, String[] enroll_type_name_other, String cn_name, String en_name, String intro) { public Object saveMemberFilmBase(
Long member_film_id,
String[] enroll_type_name_other,
String cn_name,
String en_name,
String intro) {
LoginToken loginToken = tokenService.getToken(); LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId(); Integer member_id = (Integer)loginToken.getId();
memberService.saveMemberFilmBase(member_id, member_film_id, enroll_type_name_other, cn_name, en_name, intro); memberService.saveMemberFilmBase(
member_id,
member_film_id,
enroll_type_name_other,
cn_name,
en_name,
intro);
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
...@@ -81,16 +93,16 @@ public class MemberApplyController { ...@@ -81,16 +93,16 @@ public class MemberApplyController {
@PostMapping("save_info") @PostMapping("save_info")
@ApiOperation("保存影片制作信息") @ApiOperation("保存影片制作信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "member_film_id", value="影片ID"), @ApiImplicitParam(paramType="query", dataType="long", required=true, name="member_film_id", value="影片ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_country", value="制作国家"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_country", value="制作国家"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "dialogue_lang", value="对白语言"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="dialogue_lang", value="对白语言"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "subtitle_lang", value="字幕语言"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="subtitle_lang", value="字幕语言"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "co_production_country", value="合拍国家"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="co_production_country", value="合拍国家"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_total_time", value="影片时长"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_total_time", value="影片时长"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "completion_date", value="完成日期"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="completion_date", value="完成日期"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "show_date", value="公映日期"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="show_date", value="公映日期"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_medium", value="影片色彩"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_medium", value="影片色彩"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_format", value="样片规格"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_format", value="样片规格"),
}) })
public Object saveMemberFilmInfo( public Object saveMemberFilmInfo(
Long member_film_id, Long member_film_id,
...@@ -126,14 +138,14 @@ public class MemberApplyController { ...@@ -126,14 +138,14 @@ public class MemberApplyController {
@PostMapping("save_playactor") @PostMapping("save_playactor")
@ApiOperation("保存影片演职员信息") @ApiOperation("保存影片演职员信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "long", allowMultiple=false, required = true, name = "member_film_id", value="影片ID"), @ApiImplicitParam(paramType="query", dataType="long", allowMultiple=false, required=true, name="member_film_id", value="影片ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = true, name = "playactor_type", value="演职员类型"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=true, name="playactor_type", value="演职员类型"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = true, name = "playactor_name", value="演职员名称"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=true, name="playactor_name", value="演职员名称"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = true, name = "playactor_film_nums", value="演职员第几部长片"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=true, name="playactor_film_nums", value="演职员第几部长片"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = false, name = "playactor_country", value="演职员国家"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=false, name="playactor_country", value="演职员国家"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = false, name = "playactor_birthday", value="演职员生日"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=false, name="playactor_birthday", value="演职员生日"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = true, name = "playactor_intro", value="演职员简介"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=true, name="playactor_intro", value="演职员简介"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = false, name = "is_play_shanghai", value="演职员作品是否参加过上海电影节"), @ApiImplicitParam(paramType="query", dataType="integer", allowMultiple=true, required=false, name="is_play_shanghai", value="演职员作品是否参加过上海电影节"),
}) })
public Object saveMemberFilmPlayactor( public Object saveMemberFilmPlayactor(
Long member_film_id, Long member_film_id,
...@@ -165,11 +177,11 @@ public class MemberApplyController { ...@@ -165,11 +177,11 @@ public class MemberApplyController {
@PostMapping("save_issuer") @PostMapping("save_issuer")
@ApiOperation("保存影片发行信息") @ApiOperation("保存影片发行信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "long", allowMultiple=false, required = true, name = "member_film_id", value="影片ID"), @ApiImplicitParam(paramType="query", dataType="long", allowMultiple=false, required=true, name="member_film_id", value="影片ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = true, name = "issuer_company", value="发行公司"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=true, name="issuer_company", value="发行公司"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = false, name = "issuer_contacts", value="发行方联系人"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=false, name="issuer_contacts", value="发行方联系人"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = false, name = "issuer_email", value="发行方Email"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=false, name="issuer_email", value="发行方Email"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = false, name = "issuer_tel", value="发行方电话"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=false, name="issuer_tel", value="发行方电话"),
}) })
public Object saveMemberFilmIssuer( public Object saveMemberFilmIssuer(
Long member_film_id, Long member_film_id,
...@@ -195,11 +207,11 @@ public class MemberApplyController { ...@@ -195,11 +207,11 @@ public class MemberApplyController {
@PostMapping("save_show") @PostMapping("save_show")
@ApiOperation("保存影片放映信息") @ApiOperation("保存影片放映信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "long", allowMultiple=false, required = true, name = "member_film_id", value="影片ID"), @ApiImplicitParam(paramType="query", dataType="long", allowMultiple=false, required=true, name="member_film_id", value="影片ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=false, required = true, name = "play_shanghai", value="该片在上海电影节放映是"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=false, required=true, name="play_shanghai", value="该片在上海电影节放映是"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = true, name = "show_filmfest", value="参加过什么电影节"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=true, name="show_filmfest", value="参加过什么电影节"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = true, name = "show_filmfest_type", value="参与类型"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=true, name="show_filmfest_type", value="参与类型"),
@ApiImplicitParam(paramType = "query", dataType = "string", allowMultiple=true, required = false, name = "show_filmfest_intro", value="简介(获奖或报名奖项等)"), @ApiImplicitParam(paramType="query", dataType="string", allowMultiple=true, required=false, name="show_filmfest_intro", value="简介(获奖或报名奖项等)"),
}) })
public Object saveMemberFilmShow( public Object saveMemberFilmShow(
Long member_film_id, Long member_film_id,
...@@ -224,13 +236,13 @@ public class MemberApplyController { ...@@ -224,13 +236,13 @@ public class MemberApplyController {
@PostMapping("save_company") @PostMapping("save_company")
@ApiOperation("保存影片申报信息") @ApiOperation("保存影片申报信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "member_film_id", value="影片ID"), @ApiImplicitParam(paramType="query", dataType="long", required=true, name="member_film_id", value="影片ID"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_apply_company", value="申报公司"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_apply_company", value="申报公司"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_apply_realname", value="申报联系人"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_apply_realname", value="申报联系人"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_apply_email", value="申报邮件"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_apply_email", value="申报邮件"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_apply_tel", value="申报电话"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_apply_tel", value="申报电话"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_apply_mobile", value="申报手机"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_apply_mobile", value="申报手机"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_apply_country", value="申报国家"), @ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_apply_country", value="申报国家"),
}) })
public Object saveMemberFilmCompany( public Object saveMemberFilmCompany(
Long member_film_id, String Long member_film_id, String
...@@ -258,7 +270,7 @@ public class MemberApplyController { ...@@ -258,7 +270,7 @@ public class MemberApplyController {
@ResponseBody @ResponseBody
@PostMapping("get_detail") @PostMapping("get_detail")
@ApiOperation("获取全部申报信息") @ApiOperation("获取全部申报信息")
@ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "member_film_id", value="申报影片ID")}) @ApiImplicitParams({@ApiImplicitParam(paramType="query", dataType="long", required=true, name="member_film_id", value="申报影片ID")})
public Object getDetail(Long member_film_id) { public Object getDetail(Long member_film_id) {
Fc_member_film memberFilm = memberService.queryMemberFilmById(member_film_id); Fc_member_film memberFilm = memberService.queryMemberFilmById(member_film_id);
List<Fc_member_film_director> directorList = memberService.queryMemberFilmDirectorList(memberFilm.getId()); List<Fc_member_film_director> directorList = memberService.queryMemberFilmDirectorList(memberFilm.getId());
...@@ -277,7 +289,7 @@ public class MemberApplyController { ...@@ -277,7 +289,7 @@ public class MemberApplyController {
@ResponseBody @ResponseBody
@PostMapping("do_apply") @PostMapping("do_apply")
@ApiOperation("提交申报") @ApiOperation("提交申报")
@ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "long", required = true, name = "member_film_id", value="申报影片ID")}) @ApiImplicitParams({@ApiImplicitParam(paramType="query", dataType="long", required=true, name="member_film_id", value="申报影片ID")})
public Object doApply(Long member_film_id) { public Object doApply(Long member_film_id) {
LoginToken loginToken = tokenService.getToken(); LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId(); Integer member_id = (Integer)loginToken.getId();
...@@ -288,7 +300,7 @@ public class MemberApplyController { ...@@ -288,7 +300,7 @@ public class MemberApplyController {
@ResponseBody @ResponseBody
@PostMapping("get_more") @PostMapping("get_more")
@ApiOperation("获取更多影片信息") @ApiOperation("获取更多影片信息")
@ApiImplicitParams({@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "film_no", value="情报影片编号")}) @ApiImplicitParams({@ApiImplicitParam(paramType="query", dataType="string", required=true, name="film_no", value="情报影片编号")})
public Object getMore(String film_no) { public Object getMore(String film_no) {
Fc_member_film_all more = memberService.queryMoreByNo(film_no); Fc_member_film_all more = memberService.queryMoreByNo(film_no);
return Rjx.jsonOk().setData(more); return Rjx.jsonOk().setData(more);
......
...@@ -42,11 +42,11 @@ public class MemberInfoController { ...@@ -42,11 +42,11 @@ public class MemberInfoController {
@PostMapping("save") @PostMapping("save")
@ApiOperation("保存会员基本信息") @ApiOperation("保存会员基本信息")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "email"), @ApiImplicitParam(paramType = "query", dataType = "String", required = true, name = "email"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "realname"), @ApiImplicitParam(paramType = "query", dataType = "String", required = false, name = "realname"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "address"), @ApiImplicitParam(paramType = "query", dataType = "String", required = false, name = "address"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "company"), @ApiImplicitParam(paramType = "query", dataType = "String", required = false, name = "company"),
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "tel"), @ApiImplicitParam(paramType = "query", dataType = "String", required = false, name = "tel"),
}) })
public Object save(String email, String realname, String address, String company, String tel) { public Object save(String email, String realname, String address, String company, String tel) {
LoginToken loginToken = tokenService.getToken(); LoginToken loginToken = tokenService.getToken();
......
/*
*
* Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package springfox.documentation.spring.web.readers.parameter;
import static springfox.documentation.schema.Collections.collectionElementType;
import static springfox.documentation.schema.Collections.isContainerType;
import static springfox.documentation.schema.Maps.isMapType;
import static springfox.documentation.schema.ResolvedTypes.modelRefFactory;
import static springfox.documentation.schema.Types.isBaseType;
import static springfox.documentation.schema.Types.typeNameFor;
import static springfox.documentation.spi.schema.contexts.ModelContext.inputParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import com.fasterxml.classmate.ResolvedType;
import com.fasterxml.classmate.TypeResolver;
import com.google.common.base.Optional;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.schema.ModelReference;
import springfox.documentation.schema.TypeNameExtractor;
import springfox.documentation.service.ResolvedMethodParameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.schema.contexts.ModelContext;
import springfox.documentation.spi.service.ParameterBuilderPlugin;
import springfox.documentation.spi.service.contexts.ParameterContext;
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class ParameterDataTypeReader implements ParameterBuilderPlugin {
private final TypeNameExtractor nameExtractor;
private final TypeResolver resolver;
@Autowired
public ParameterDataTypeReader(TypeNameExtractor nameExtractor, TypeResolver resolver) {
this.nameExtractor = nameExtractor;
this.resolver = resolver;
}
@Override
public boolean supports(DocumentationType delimiter) {
return true;
}
@Override
public void apply(ParameterContext context) {
ResolvedMethodParameter methodParameter = context.resolvedMethodParameter();
ResolvedType parameterType = methodParameter.getParameterType();
parameterType = context.alternateFor(parameterType);
ModelReference modelRef = null;
if (methodParameter.hasParameterAnnotation(PathVariable.class) && treatAsAString(parameterType)) {
parameterType = resolver.resolve(String.class);
modelRef = new ModelRef("string");
} else if (methodParameter.hasParameterAnnotation(RequestParam.class) && isMapType(parameterType)) {
modelRef = new ModelRef("", new ModelRef("string"), true);
} else if (methodParameter.hasParameterAnnotation(RequestParam.class) && treatRequestParamAsString(parameterType)) {
parameterType = resolver.resolve(String.class);
modelRef = new ModelRef("string");
}
if (!methodParameter.hasParameterAnnotations()) {
Class<?> t = parameterType.getErasedType();
String typeName = typeNameFor(t);
if (isBaseType(typeName)) {
modelRef = new ModelRef(typeName);
} else {
//LOG.warn("Trying to infer dataType {}", parameterType);
}
}
ModelContext modelContext = inputParam(parameterType,
context.getDocumentationType(),
context.getAlternateTypeProvider(),
context.getGenericNamingStrategy(),
context.getIgnorableParameterTypes());
context.parameterBuilder()
.type(parameterType)
.modelRef(Optional.fromNullable(modelRef)
.or(modelRefFactory(modelContext, nameExtractor).apply(parameterType)));
}
private boolean treatRequestParamAsString(ResolvedType parameterType) {
return treatAsAString(parameterType) && !isContainerType(parameterType)
|| (isContainerType(parameterType) && treatAsAString(collectionElementType(parameterType)));
}
private boolean treatAsAString(ResolvedType parameterType) {
return !(isBaseType(typeNameFor(parameterType.getErasedType()))
|| parameterType.getErasedType().isEnum());
}
}
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<logger name="org" level="INFO" /> <logger name="org" level="INFO" />
<logger name="com" level="INFO" /> <logger name="com" level="INFO" />
<logger name="com.egolm" level="INFO" /> <logger name="swagger" level="DEBUG" />
<logger name="com.egolm" level="DEBUG" />
<appender name="siftingAppender" class="ch.qos.logback.classic.sift.SiftingAppender"> <appender name="siftingAppender" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator> <discriminator>
......
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