Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
Update api-version 2020-06-15 (#18)
Browse files Browse the repository at this point in the history
* Update sdk for v2020-06-15.

* Update freee SDK version in samples

* Add invoices page to basic-websample

* Add X-Api-Version header to SDK

* Fix missing import

* Remove unnecessary files

* Revert removed dependency

* Update SDK

- For freee-api-schema (git hash: 5ea1401eed56a47307a7a8b5ed9b078538586f07)
  • Loading branch information
dzeyelid authored Sep 14, 2020
1 parent e106017 commit c79916b
Show file tree
Hide file tree
Showing 1,139 changed files with 77,685 additions and 58,069 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Spring Initializr で構成する場合は、下記の Dependencies を選択し
<dependency>
<groupId>jp.co.freee</groupId>
<artifactId>freee-accounting-sdk</artifactId>
<version>2.0.0-alpha</version>
<version>2.0.0-beta</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion samples/basic-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>jp.co.freee</groupId>
<artifactId>freee-accounting-sdk</artifactId>
<version>2.0.0-alpha</version>
<version>2.0.0-beta</version>
</dependency>
</dependencies>
<build>
Expand Down
2 changes: 1 addition & 1 deletion samples/basic-websample-rx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>jp.co.freee</groupId>
<artifactId>freee-accounting-sdk</artifactId>
<version>2.0.0-alpha</version>
<version>2.0.0-beta</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand Down
2 changes: 1 addition & 1 deletion samples/basic-websample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>jp.co.freee</groupId>
<artifactId>freee-accounting-sdk</artifactId>
<version>2.0.0-alpha</version>
<version>2.0.0-beta-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

import freee.accounting.samples.basic.web.services.AccountingService;
Expand All @@ -26,6 +27,11 @@ public ModelAndView companies() {
return new ModelAndView("companies", "companies", _accountingService.getCompanies());
}

@GetMapping("/invoices/{company_id}")
public ModelAndView invoices(@PathVariable("company_id") Integer companyId) {
return new ModelAndView("invoices", "invoices", _accountingService.getInvoices(companyId));
}

@GetMapping("/token")
public ModelAndView token() {
Map<String, String> map = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
import jp.co.freee.accounting.ApiClient;
import jp.co.freee.accounting.api.CompaniesApi;
import jp.co.freee.accounting.api.UsersApi;
import jp.co.freee.accounting.models.CompaniesIndexResponseCompanies;
import jp.co.freee.accounting.models.UsersMeResponseUser;
import jp.co.freee.accounting.api.InvoicesApi;
import jp.co.freee.accounting.models.CompanyIndexResponseCompanies;
import jp.co.freee.accounting.models.MeResponseUser;
import jp.co.freee.accounting.models.Invoice;

@Service
@Scope(value = WebApplicationContext.SCOPE_SESSION, proxyMode = ScopedProxyMode.TARGET_CLASS)
Expand All @@ -35,16 +37,21 @@ public void init() {
_apiClient.setAccessToken(_token);
}

public UsersMeResponseUser getUserInfo() {
public MeResponseUser getUserInfo() {
UsersApi api = _apiClient.createService(UsersApi.class);
return api.getUsersMe(null).blockingSingle().getUser();
}

public List<CompaniesIndexResponseCompanies> getCompanies() {
public List<CompanyIndexResponseCompanies> getCompanies() {
CompaniesApi api = _apiClient.createService(CompaniesApi.class);
return api.getCompanies().blockingSingle().getCompanies();
}

public List<Invoice> getInvoices(Integer companyId) {
InvoicesApi api = _apiClient.createService(InvoicesApi.class);
return api.getInvoices(companyId, null, null, null, null, null, null, null, null, null, null, null, null).blockingSingle().getInvoices();
}

public String getToken() {
return _token;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ <h1>Companies Information</h1>
<tr>
<td th:text="${company.getId()}"></td>
<td th:text="${company.getDisplayName()}"></td>
<td><a th:href="@{/invoices/{companyId}(companyId=${company.getId()})}">Invoices</a></td>
</tr>
</tbody>
</table>
Expand Down
28 changes: 28 additions & 0 deletions samples/basic-websample/src/main/resources/templates/invoices.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<head>
<meta charset="utf-8">
<title>Invoices | Basic Web Sample</title>
<link rel="stylesheet" href="/webjars/bootstrap/4.3.1/css/bootstrap.min.css" />
<script src="/webjars/jquery/3.4.1/jquery.min.js"></script>
<script src="/webjars/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>

<body>
<div class=container-fluid style="padding: 20px">
<div class="row">
<h1>Invoices Information</h1>
</div>
<table class="table">
<tbody th:each="invoice : ${invoices}">
<tr>
<td th:text="${invoice.getId()}"></td>
<td th:text="${invoice.toString()}"></td>
</tr>
</tbody>
</table>
</div>
</body>

</html>
26 changes: 0 additions & 26 deletions sdk/docs/AccountItem.md

This file was deleted.

13 changes: 0 additions & 13 deletions sdk/docs/AccountItemItems.md

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/docs/AccountItemParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**companyId** | **Integer** | 事業所ID |
**accountItem** | [**AccountItemParamsAccountItem**](AccountItemParamsAccountItem.md) | |
**companyId** | **Integer** | 事業所ID |



18 changes: 9 additions & 9 deletions sdk/docs/AccountItemParamsAccountItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountCategoryId** | **Integer** | 勘定科目カテゴリーID Selectablesフォーム用選択項目情報エンドポイント(account_groups.account_category_id)で取得可能です |
**accumulatedDepAccountItemId** | **Integer** | 減価償却累計額勘定科目ID(法人のみ利用可能) | [optional]
**correspondingExpenseId** | **Integer** | 支出取引相手勘定科目ID |
**correspondingIncomeId** | **Integer** | 収入取引相手勘定科目ID |
**groupName** | **String** | 決算書表示名(小カテゴリー) Selectablesフォーム用選択項目情報エンドポイント(account_groups.name)で取得可能です |
**items** | [**List&lt;AccountItemParamsAccountItemItems&gt;**](AccountItemParamsAccountItemItems.md) | 品目 | [optional]
**name** | **String** | 勘定科目名 (30文字以内) |
**partners** | [**List&lt;AccountItemParamsAccountItemItems&gt;**](AccountItemParamsAccountItemItems.md) | 取引先 | [optional]
**searchable** | **Integer** | 検索可能:2, 検索不可:3(登録時未指定の場合は2で登録されます。更新時未指定の場合はsearchableは変更されません。) | [optional]
**shortcut** | **String** | ショートカット1 (20文字以内) | [optional]
**shortcutNum** | **String** | ショートカット2(勘定科目コード)(20文字以内) | [optional]
**taxName** | **String** | 税区分 |
**groupName** | **String** | 決算書表示名 |
**accountCategory** | **String** | 勘定科目カテゴリー |
**correspondingIncomeName** | **String** | 収入取引相手勘定科目 |
**correspondingExpenseName** | **String** | 支出取引相手勘定科目 |
**accumulatedDepAccountItemName** | **String** | 減価償却累計額勘定科目 | [optional]
**searchable** | **Integer** | 検索可能:2, 検索不可:3 | [optional]
**items** | [**List&lt;AccountItemParamsAccountItemItems&gt;**](AccountItemParamsAccountItemItems.md) | 品目 | [optional]
**partners** | [**List&lt;AccountItemParamsAccountItemItems&gt;**](AccountItemParamsAccountItemItems.md) | 取引先 | [optional]
**taxCode** | **Integer** | 税区分コード |



13 changes: 0 additions & 13 deletions sdk/docs/AccountItemPartners.md

This file was deleted.

12 changes: 12 additions & 0 deletions sdk/docs/AccountItemResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@


# AccountItemResponse

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountItem** | [**AccountItemResponseAccountItem**](AccountItemResponseAccountItem.md) | |



31 changes: 31 additions & 0 deletions sdk/docs/AccountItemResponseAccountItem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@


# AccountItemResponseAccountItem

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountCategory** | **String** | 勘定科目カテゴリー |
**accountCategoryId** | **Integer** | 勘定科目のカテゴリーID |
**accumulatedDepAccountItemId** | **Integer** | 減価償却累計額勘定科目ID(法人のみ利用可能) | [optional]
**accumulatedDepAccountItemName** | **String** | 減価償却累計額勘定科目(法人のみ利用可能) | [optional]
**available** | **Boolean** | 勘定科目の使用設定(true: 使用する、false: 使用しない) |
**companyId** | **Integer** | 事業所ID |
**correspondingExpenseId** | **Integer** | 支出取引相手勘定科目ID | [optional]
**correspondingExpenseName** | **String** | 支出取引相手勘定科目名 | [optional]
**correspondingIncomeId** | **Integer** | 収入取引相手勘定科目ID | [optional]
**correspondingIncomeName** | **String** | 収入取引相手勘定科目名 | [optional]
**groupName** | **String** | 決算書表示名(小カテゴリー) | [optional]
**id** | **Integer** | 勘定科目ID |
**items** | [**List&lt;AccountItemResponseAccountItemItems&gt;**](AccountItemResponseAccountItemItems.md) | | [optional]
**name** | **String** | 勘定科目名 (30文字以内) |
**partners** | [**List&lt;AccountItemResponseAccountItemPartners&gt;**](AccountItemResponseAccountItemPartners.md) | | [optional]
**searchable** | **Integer** | 検索可能:2, 検索不可:3 |
**shortcut** | **String** | ショートカット1 (20文字以内) | [optional]
**shortcutNum** | **String** | ショートカット2(勘定科目コード) (20文字以内) | [optional]
**taxCode** | **Integer** | 税区分コード |
**walletableId** | **Integer** | 口座ID |



13 changes: 13 additions & 0 deletions sdk/docs/AccountItemResponseAccountItemItems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


# AccountItemResponseAccountItemItems

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | 品目ID |
**name** | **String** | 品目 |



13 changes: 13 additions & 0 deletions sdk/docs/AccountItemResponseAccountItemPartners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


# AccountItemResponseAccountItemPartners

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **Integer** | 取引先ID |
**name** | **String** | 取引先 |



Loading

0 comments on commit c79916b

Please sign in to comment.