package com.xiaojian.cloud.controller;

import com.xiaojian.cloud.bean.Dept;
import com.xiaojian.cloud.service.DeptClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptControllerConsumer {

   @Autowired
   private DeptClient deptClient;

   @RequestMapping("/consumer/dept/get/{id}")
   public Dept get(@PathVariable("id") Long id) {
       return deptClient.get(id);
   }

   @RequestMapping("/consumer/dept/list")
   public List<Dept> list() {
       return deptClient.list();
   }

}
