8 changed files with 907 additions and 801 deletions
@ -0,0 +1,30 @@ |
|||
package com.yxt.anrui.terminal.api.base.baidu; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/31 11:43 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "百度") |
|||
@FeignClient( |
|||
contextId = "anrui-terminal-BaiDu", |
|||
name = "anrui-terminal", |
|||
path = "/base/v1/baidu", |
|||
fallback = BaiDuFeignFallback.class) |
|||
public interface BaiDuFeign { |
|||
|
|||
@ApiOperation(value = "移动:百度-车辆合格证识别") |
|||
@ResponseBody |
|||
@PostMapping("/vehicleCertificate") |
|||
ResultBean<Map<String, Object>> vehicleCertificate(@RequestParam("imageB64") String imageB64); |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.yxt.anrui.terminal.api.base.baidu; |
|||
|
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/31 11:44 |
|||
* @Description |
|||
*/ |
|||
@Component |
|||
public class BaiDuFeignFallback { |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.anrui.terminal.biz.base.baidu; |
|||
|
|||
import com.yxt.anrui.terminal.api.base.baidu.BaiDuFeign; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/31 13:31 |
|||
* @Description |
|||
*/ |
|||
@Api(tags = "百度车辆合格证") |
|||
@Controller |
|||
@RequestMapping("/base/v1/baidu") |
|||
public class BaiDuRest implements BaiDuFeign { |
|||
|
|||
@Autowired |
|||
private BaiDuService baiDuService; |
|||
|
|||
@Override |
|||
public ResultBean<Map<String, Object>> vehicleCertificate(String imageB64) { |
|||
return baiDuService.vehicleCertificate(imageB64); |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.yxt.anrui.terminal.biz.base.baidu; |
|||
|
|||
import com.yxt.anrui.portal.api.index.IndexFeign; |
|||
import com.yxt.anrui.portal.api.index.IndexQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Author dimengzhe |
|||
* @Date 2022/10/31 13:32 |
|||
* @Description |
|||
*/ |
|||
@Service |
|||
public class BaiDuService { |
|||
|
|||
@Autowired |
|||
private IndexFeign indexFeign; |
|||
|
|||
public ResultBean<Map<String, Object>> vehicleCertificate(String imageB64) { |
|||
IndexQuery indexQuery = new IndexQuery(); |
|||
indexQuery.setImage(imageB64); |
|||
ResultBean<Map<String, Object>> resultBean = indexFeign.getVehicleCertificate(indexQuery); |
|||
return resultBean; |
|||
} |
|||
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue