9361f45ff5be4c56f882927d7195bcf6b0015711
[institute/sw-backend.git] /
1 package com.supwisdom.institute.backend.admin.aggr.apis.remote.biz;
2
3 import org.springframework.cloud.openfeign.FeignClient;
4 import org.springframework.web.bind.annotation.PathVariable;
5 import org.springframework.web.bind.annotation.RequestBody;
6 import org.springframework.web.bind.annotation.RequestMapping;
7 import org.springframework.web.bind.annotation.RequestMethod;
8 import org.springframework.web.bind.annotation.RequestParam;
9
10 import com.alibaba.fastjson.JSONObject;
11 import com.supwisdom.institute.backend.admin.aggr.apis.model.biz.Biz;
12
13 @FeignClient(
14     name = "biz-biz-remote-feign-client",
15     url = "${sw-backend-biz-api.uri}/v1/admin/biz",
16     fallbackFactory = BizRemoteFallbackFactory.class
17 )
18 public interface BizRemoteFeignClient {
19   
20   @RequestMapping(method = RequestMethod.GET)
21   JSONObject query(
22       @RequestParam(name = "loadAll") boolean loadAll,
23       @RequestParam(name = "pageIndex") int pageIndex,
24       @RequestParam(name = "pageSize") int pageSize
25       
26   );
27   
28   @RequestMapping(method = RequestMethod.GET, path = "/{id}")
29   JSONObject load(
30       @PathVariable(name = "id") String id
31   );
32
33   @RequestMapping(method = RequestMethod.POST)
34   JSONObject create(
35       @RequestBody Biz biz
36   );
37
38   @RequestMapping(method = RequestMethod.PUT, path = "/{id}")
39   JSONObject update(
40       @PathVariable(name = "id") String id,
41       @RequestBody Biz biz
42   );
43   
44   @RequestMapping(method = RequestMethod.DELETE, path = "/{id}")
45   JSONObject delete(
46       @PathVariable(name = "id") String id
47   );
48
49 }