package com.fxf.separation.taUser.controller;

import com.fxf.separation.taUser.model.TaUser;
import com.fxf.separation.taUser.service.TaUserServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author FXF
 * @date 2019-10-14
 */
@RestController
@RequestMapping("/")
public class TaUserController {
	
	@Autowired
	private TaUserServiceI taUserService;
	
	@GetMapping("/users")
	public List<TaUser> getList(){
		return taUserService.getList();
	}
	
	@PostMapping("/user")
	public TaUser addUser(@RequestBody TaUser taUser){
		return taUserService.addUser(taUser);
	}
}
