zhenghaoyu
9 months ago
2 changed files with 42 additions and 0 deletions
@ -0,0 +1,19 @@
|
||||
package com.logpm.trunkline.feign; |
||||
|
||||
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; |
||||
import org.springblade.common.constant.ModuleNameConstant; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
@FeignClient( |
||||
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME |
||||
) |
||||
public interface ITrunklineCarsLoadClient { |
||||
|
||||
String API_PREFIX = "trunklineCarsLoad/client"; |
||||
|
||||
@GetMapping(API_PREFIX+"/findEntityByCarsNo") |
||||
TrunklineCarsLoadEntity findEntityByCarsNo(@RequestParam String carsNo); |
||||
|
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.logpm.trunkline.feign; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; |
||||
import com.logpm.trunkline.service.ITrunklineCarsLoadService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
@Slf4j |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class TrunklineCarsLoadClient implements ITrunklineCarsLoadClient{ |
||||
|
||||
private final ITrunklineCarsLoadService carsLoadService; |
||||
|
||||
@Override |
||||
public TrunklineCarsLoadEntity findEntityByCarsNo(String carsNo) { |
||||
QueryWrapper<TrunklineCarsLoadEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("cars_no",carsNo); |
||||
return carsLoadService.getOne(queryWrapper); |
||||
} |
||||
} |
Loading…
Reference in new issue