Skip to content

Commit

Permalink
Merge pull request #469 from YuukiToriyama/feature/chimei-ruiju/fix-i…
Browse files Browse the repository at this point in the history
…nteractor

chimei-ruiju.orgへの対応: `ChimeiRujiuInteractor`のメソッドの引数を変更
  • Loading branch information
YuukiToriyama authored Oct 19, 2024
2 parents b9dba28 + ce1f0ed commit 4bccc95
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions core/src/interactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ pub(crate) trait ChimeiRuijuInteractor {
/// 都道府県マスタを取得
async fn get_prefecture_master(
&self,
prefecture_name: &str,
prefecture: &Prefecture,
) -> Result<PrefectureMaster, ApiError>;
/// 市区町村マスタを取得
async fn get_city_master(
&self,
prefecture_name: &str,
prefecture: &Prefecture,
city_name: &str,
) -> Result<CityMaster, ApiError>;
/// 町名マスタを取得
async fn get_town_master(
&self,
prefecture_name: &str,
prefecture: &Prefecture,
city_name: &str,
town_name: &str,
) -> Result<TownMaster, ApiError>;
Expand All @@ -44,28 +44,25 @@ impl Default for ChimeiRuijuInteractorImpl {
impl ChimeiRuijuInteractor for ChimeiRuijuInteractorImpl {
async fn get_prefecture_master(
&self,
prefecture_name: &str,
prefecture: &Prefecture,
) -> Result<PrefectureMaster, ApiError> {
let prefecture = Prefecture::try_from(prefecture_name).unwrap();
PrefectureMasterRepository::get(&self.api_service, &prefecture).await
PrefectureMasterRepository::get(&self.api_service, prefecture).await
}

async fn get_city_master(
&self,
prefecture_name: &str,
prefecture: &Prefecture,
city_name: &str,
) -> Result<CityMaster, ApiError> {
let prefecture = Prefecture::try_from(prefecture_name).unwrap();
CityMasterRepository::get(&self.api_service, &prefecture, city_name).await
CityMasterRepository::get(&self.api_service, prefecture, city_name).await
}

async fn get_town_master(
&self,
prefecture_name: &str,
prefecture: &Prefecture,
city_name: &str,
town_name: &str,
) -> Result<TownMaster, ApiError> {
let prefecture = Prefecture::try_from(prefecture_name).unwrap();
TownMasterRepository::get(&self.api_service, &prefecture, city_name, town_name).await
TownMasterRepository::get(&self.api_service, prefecture, city_name, town_name).await
}
}

0 comments on commit 4bccc95

Please sign in to comment.