package com.test.controller;

import com.test.bean.Admin;
import com.test.bean.Result;
import com.test.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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;

@RestController
@RequestMapping("/register")
public class RegisterController {

    @Autowired
    AdminService adminService;
    @PostMapping
    public Result doRegister(@RequestBody Admin admin){
        adminService.addAdmin(admin);
        return Result.success();
    }
}
