RemoteMaterialService.java 916 Bytes
package com.huaheng.config.api;

import com.huaheng.common.core.constant.ServiceNameConstants;
import com.huaheng.config.api.domain.Material;
import com.huaheng.config.api.factory.RemoteMaterialFallFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "RemoteMaterialService", value = ServiceNameConstants.CONFIG_SERVICE, fallbackFactory = RemoteMaterialFallFactory.class)
public interface RemoteMaterialService {

    @GetMapping("/material/findAllByCode/{code}")
    Material getByCode(@PathVariable("code") String code);

    @GetMapping("/material/getByName")
    Material getByName(@RequestParam(value = "name") String name);





}