GithubHelp home page GithubHelp logo

kazuki43zoo / api-stub Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 7.0 8.36 MB

Stub for API on Spring Boot

License: Other

Java 71.36% HTML 20.77% JavaScript 2.46% CSS 0.33% Groovy 5.08%
api-stub mybatis spring-boot thymeleaf

api-stub's Introduction

Hi there 👋

api-stub's People

Contributors

kazuki43zoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

api-stub's Issues

Error at update a response

①APIキー一覧からデータキーを一度登録した後、削除する。(レスポンス一覧上データキーが残ったままのはず)
②①のレスポンスを削除すると下記のエラーが発生

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri Jul 15 19:39:39 JST 2016
There was an unexpected error (type=Internal Server Error, status=500).
### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: 列 "DATA_KEY" にはnull値が許されていません NULL not allowed for column "DATA_KEY"; SQL statement: UPDATE mock_api_response SET data_key = ?, status_code = ?, header = ?, body = ? , body_editor_mode = ?, attachment_file = ?, file_name = ? , waiting_msec = ?, description = ? WHERE id = ? [23502-192] ### The error may involve com.kazuki43zoo.domain.repository.ApiResponseRepository.update-Inline ### The error occurred while setting parameters ### SQL: UPDATE mock_api_response SET data_key = ?, status_code = ?, header = ?, body = ? , body_editor_mode = ?, attachment_file = ?, file_name = ? , waiting_msec = ?, description = ? WHERE id = ? ### Cause: org.h2.jdbc.JdbcSQLException: 列 "DATA_KEY" にはnull値が許されていません NULL not allowed for column "DATA_KEY"; SQL statement: UPDATE mock_api_response SET data_key = ?, status_code = ?, header = ?, body = ? , body_editor_mode = ?, attachment_file = ?, file_name = ? , waiting_msec = ?, description = ? WHERE id = ? [23502-192] ; SQL []; 列 "DATA_KEY" にはnull値が許されていません NULL not allowed for column "DATA_KEY"; SQL statement: UPDATE mock_api_response SET data_key = ?, status_code = ?, header = ?, body = ? , body_editor_mode = ?, attachment_file = ?, file_name = ? , waiting_msec = ?, description = ? WHERE id = ? [23502-192]; nested exception is org.h2.jdbc.JdbcSQLException: 列 "DATA_KEY" にはnull値が許されていません NULL not allowed for column "DATA_KEY"; SQL statement: UPDATE mock_api_response SET data_key = ?, status_code = ?, header = ?, body = ? , body_editor_mode = ?, attachment_file = ?, file_name = ? , waiting_msec = ?, description = ? WHERE id = ? [23502-192]

Add tests

Add unit tests and integration test (e2e tests).

Errro at remove a resuponse

レスポンス一覧から削除すると下記エラーが発生する。

=========================
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri Jul 15 19:49:15 JST 2016
There was an unexpected error (type=Internal Server Error, status=500).
### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: SQLステートメントに文法エラーがあります "DELETE FROM mock_api_response WHERE id = ?[​*]""" Syntax error in SQL statement "DELETE FROM mock_api_response WHERE id = ?[*​]"""; SQL statement: DELETE FROM mock_api_response WHERE id = ?" [42000-192] ### SQL: DELETE FROM mock_api_response WHERE id = ?" ### Cause: org.h2.jdbc.JdbcSQLException: SQLステートメントに文法エラーがあります "DELETE FROM mock_api_response WHERE id = ?[​*]""" Syntax error in SQL statement "DELETE FROM mock_api_response WHERE id = ?[*​]"""; SQL statement: DELETE FROM mock_api_response WHERE id = ?" [42000-192] ; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLException: SQLステートメントに文法エラーがあります "DELETE FROM mock_api_response WHERE id = ?[​*]""" Syntax error in SQL statement "DELETE FROM mock_api_response WHERE id = ?[*​]"""; SQL statement: DELETE FROM mock_api_response WHERE id = ?" [42000-192]

Error at startup ...

2016-07-15 12:09:06.600 ERROR 11076 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method (com.kazuki43zoo.domain.repository.ApiResponseRepository$SqlProvider.findAll).  Cause: java.lang.InstantiationException: com.kazuki43zoo.domain.repository.ApiResponseRepository$SqlProvider] with root cause

java.lang.NoSuchMethodException: com.kazuki43zoo.domain.repository.ApiResponseRepository$SqlProvider.<init>()
        at java.lang.Class.getConstructor0(Unknown Source) ~[na:1.8.0_77]
        at java.lang.Class.newInstance(Unknown Source) ~[na:1.8.0_77]
        at org.apache.ibatis.builder.annotation.ProviderSqlSource.createSqlSource(ProviderSqlSource.java:89) ~[mybatis-3.4.0.jar!/:3.4.0]
        at org.apache.ibatis.builder.annotation.ProviderSqlSource.getBoundSql(ProviderSqlSource.java:73) ~[mybatis-3.4.0.jar!/:3.4.0]
        at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:292) ~[mybatis-3.4.0.jar!/:3.4.0]
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) ~[mybatis-3.4.0.jar!/:3.4.0]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) ~[mybatis-3.4.0.jar!/:3.4.0]
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.0.jar!/:3.4.0]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_77]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_77]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_77]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_77]
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434) ~[mybatis-spring-1.3.0.jar!/:1.3.0]
        at com.sun.proxy.$Proxy52.selectList(Unknown Source) ~[na:na]
        at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:231) ~[mybatis-spring-1.3.0.jar!/:1.3.0]
        at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:128) ~[mybatis-3.4.0.jar!/:3.4.0]
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68) ~[mybatis-3.4.0.jar!/:3.4.0]
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53) ~[mybatis-3.4.0.jar!/:3.4.0]
        at com.sun.proxy.$Proxy61.findAll(Unknown Source) ~[na:na]
        at com.kazuki43zoo.domain.service.ApiResponseService.findAll(ApiResponseService.java:36) ~[api-stub-core-1.0.0-SNAPSHOT.jar!/:1.0.0-SNAPSHOT]
        at com.kazuki43zoo.domain.service.ApiResponseService$$FastClassBySpringCGLIB$$62a7f42e.invoke(<generated>) ~[api-stub-core-1.0.0-SNAPSHOT.jar!/:1.0.0-SNAPSHOT]
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.2.7.RELEASE.jar!/:4.2.7.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720
...

Support executable jar

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <executable>true</executable> <!-- Add -->
    </configuration>
</plugin>

Allow to takeover the request data into response content

リクエスト内容をレスポンスにそのまま引き継ぐ機能が欲しいです。

【イメージ】

  • リクエストにUUIDが設定されており、レスポンスにそのまま値を設定する。

request

{ 
    "uuid" : "550e8400-e29b-41d4-a716-446655440000", 
    "name" : "josh" 
}

response

{
 "uuid" : "550e8400-e29b-41d4-a716-446655440000",
 "result_code" : "000"
 }

H2 database error occurred on shutdown

org.h2.jdbc.JdbcSQLException: ??‡????????????????? ̄?????§??≪??‰?????‰??????????????? (VM?μ???†???????‡??????‡????????????????? ̄???????????’????????
≪??????????????≪?? ̄???db URL??≪ ";DB_CLOSE_ON_EXIT=FALSE" ??’????????????????????????)
Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-191]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
        at org.h2.message.DbException.get(DbException.java:179)
        at org.h2.message.DbException.get(DbException.java:155)
        at org.h2.message.DbException.get(DbException.java:144)
        at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1468)
        at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1443)
        at org.h2.jdbc.JdbcConnection.createStatement(JdbcConnection.java:191)
        at org.h2.server.web.DbStarter.contextDestroyed(DbStarter.java:76)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4856)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5474)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:224)
        at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1424)
        at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1413)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

Add pagination feature on the list screen

一覧画面にページングの機能が欲しいです。
検索である程度絞れますが、データが多くなるにつれ見難くなってきてしまっている

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.