| | |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * API 문서 제작 패키지 Swagger 설정 클래스 |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | public class SwaggerConfig { |
| | |
| | | private static final String API_VERSION = "1.0.0"; |
| | | private static final String API_DESCRIPTION = "OWL API 명세서"; |
| | | |
| | | |
| | | /** |
| | | * API 설정 |
| | | * @return docket class |
| | | */ |
| | | @Bean |
| | | public Docket api() { |
| | | // Parameter parameterBuilder = new ParameterBuilder() |
| | |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * API 문서 타이틀/버전/설명 설정 |
| | | * @return ApiInfo 클래스 |
| | | */ |
| | | public ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title(API_NAME) |
| | |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * API 문서 테스트 Request Content-Type 설정 추가 |
| | | * @return consumes content-type 목록 |
| | | */ |
| | | private Set<String> getConsumeContentTypes() { |
| | | Set<String> consumes = new HashSet<>(); |
| | | consumes.add("application/json;charset=UTF-8"); |
| | |
| | | return consumes; |
| | | } |
| | | |
| | | /** |
| | | * API 문서 테스트 Response content-type 설정 추가 |
| | | * @return produce content-type 목록 |
| | | */ |
| | | private Set<String> getProduceContentTypes() { |
| | | Set<String> produces = new HashSet<>(); |
| | | produces.add("application/json;charset=UTF-8"); |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 이슈 사용자 정의 필드 값 검색 조건 클래스 |
| | | * Created by wisestone on 2018-06-07. |
| | | */ |
| | | public class IssueCustomFieldValueCondition { |
| | |
| | | private Long workspaceId; |
| | | private Long customFieldId; |
| | | private String customFieldType; |
| | | private List<String> useValues = Lists.newArrayList(); // 단일, 다중 일때 검색 값 |
| | | private String useValue; // 텍스트 필드일 때 검색 값 |
| | | /** |
| | | * 사용자 정의 필드 사용 값 |
| | | */ |
| | | private List<String> useValues = Lists.newArrayList(); |
| | | /** |
| | | * 텍스트 필드일 때 검색 값 |
| | | */ |
| | | private String useValue; |
| | | private boolean useParentIssueId = true; |
| | | /** |
| | | * 이슈 상태 유형(READY / OPEN / CLOSE) |
| | | */ |
| | | private String issueStatusType; |
| | | |
| | | public IssueCustomFieldValueCondition(){} |
| | |
| | | |
| | | |
| | | /** |
| | | * 이슈 추가 |
| | | * @param apiIssueAddForm 입력 폼 데이터 |
| | | * @param files 파일 |
| | | * @return JSON |
| | |
| | | } |
| | | |
| | | /** |
| | | * 이슈 상태 수정 |
| | | * @param apiIssueModifyForm 수정 폼 데이터 |
| | | * @return JSON |
| | | * @throws OwlRuntimeException 파라미터 오류시 발생 |
| | |
| | | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | // 이슈 조회 |
| | | // @RequestMapping(value = "/api/issueList", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | // public |
| | | // @ResponseBody |
| | | // Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) { |
| | | // Map<String, Object> resJsonData = new HashMap<>(); |
| | | // Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); |
| | | // |
| | | // // todo |
| | | // return this.setSuccessMessage(resJsonData); |
| | | // } |
| | | } |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * API 토큰 컨트롤러 클래스 |
| | | */ |
| | | @Controller |
| | | public class ApiTokenController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ApiTokenService apiTokenService; |
| | | |
| | | // 토큰 생성 |
| | | /** |
| | | * 토큰 생성 |
| | | * @param params 토큰 생성에 필요한 파라미터 |
| | | * @return 생성 결과 Map<String, Object> |
| | | */ |
| | | @RequestMapping(value = "/apiToken/add", produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | | @ResponseBody |
| | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 토큰 조회 |
| | | * @param params 토큰 조회에 필요한 파라미터 |
| | | * @return 조회 결과, Map<String, ApiTokenVo> |
| | | */ |
| | | // 토큰 조회 |
| | | @RequestMapping(value = "/apiToken/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | |
| | | return this.setSuccessMessage(resJsonData); |
| | | } |
| | | |
| | | /** |
| | | * 토큰 삭제 |
| | | * @param params 토큰 삭제에 필요한 파라미터 |
| | | * @return 삭제 결과, Map<String, Object> |
| | | */ |
| | | // 토큰 삭제 |
| | | @RequestMapping(value = "/apiToken/remove", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) |
| | | public |
| | |
| | | package kr.wisestone.owl.web.form; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | |
| | | /** |
| | | * API 이슈 추가용 Form class |
| | | */ |
| | | public class ApiIssueAddForm { |
| | | @ApiParam(value = "사용자 토큰", required = true) |
| | | private String token; |
| | |
| | | |
| | | import io.swagger.annotations.ApiParam; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * API 이슈 상태 수정용 Form class |
| | | */ |
| | | public class ApiIssueModifyForm { |
| | | @ApiParam(value = "사용자 토큰", required = true) |
| | | private String token; |
| | |
| | | package kr.wisestone.owl.web.form; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import kr.wisestone.owl.domain.User; |
| | | import kr.wisestone.owl.util.ConvertUtil; |
| | | import kr.wisestone.owl.util.MapUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * API 토큰 Form class |
| | | */ |
| | | public class ApiTokenForm { |
| | | private Long id; |
| | | private User user; |
| | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * |
| | | * API 이슈 추가 / 수정용 form class |
| | | */ |
| | | public class IssueApiForm implements Serializable { |
| | | |