parent
dec68ef103
commit
4558f3a858
5 changed files with 74 additions and 11 deletions
@ -0,0 +1,27 @@ |
|||||||
|
package org.springblade.resource.feign; |
||||||
|
|
||||||
|
import org.springblade.core.launch.constant.AppConstant; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.resource.pojo.entity.Attach; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = AppConstant.APPLICATION_RESOURCE_NAME |
||||||
|
) |
||||||
|
public interface IAttachClient { |
||||||
|
|
||||||
|
String API_PREFIX = "/feign/client/attach"; |
||||||
|
|
||||||
|
String DETAIL = API_PREFIX + "/detail"; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @param attach |
||||||
|
* @return |
||||||
|
*/ |
||||||
|
@PostMapping(DETAIL) |
||||||
|
public R<Attach> detail(@RequestBody Attach attach); |
||||||
|
} |
||||||
@ -0,0 +1,25 @@ |
|||||||
|
package org.springblade.resource.feign; |
||||||
|
|
||||||
|
import jakarta.annotation.Resource; |
||||||
|
import lombok.Data; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.resource.pojo.entity.Attach; |
||||||
|
import org.springblade.resource.service.IAttachService; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
@RestController |
||||||
|
@Data |
||||||
|
public class AttachClient implements IAttachClient { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private IAttachService attachService; |
||||||
|
|
||||||
|
@Override |
||||||
|
@PostMapping(DETAIL) |
||||||
|
public R<Attach> detail(Attach attach) { |
||||||
|
Attach detail = attachService.getOne(Condition.getQueryWrapper(attach)); |
||||||
|
return R.data(detail); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue