12345678910111213141516171819202122232425262728293031 |
- package cn.hhj.controller;
- import cn.hhj.service.IDeptClientService;
- import cn.hhj.vo.Dept;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.http.HttpEntity;
- import org.springframework.http.HttpHeaders;
- import org.springframework.http.HttpMethod;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.client.RestTemplate;
- import java.util.List;
- @RestController
- public class ConsumerDeptController {
- @Autowired
- private IDeptClientService deptClientService;
- @RequestMapping(value = "/consumer/dept/get")
- public Object getDept(long id) {
- return deptClientService.get(id);
- }
- @RequestMapping(value = "/consumer/dept/list")
- public Object listDept() {
- return deptClientService.list();
- }
- @RequestMapping(value = "/consumer/dept/add")
- public Object addDept(Dept dept) {
- return deptClientService.add(dept);
- }
- }
|