UserSysController.java 867 Bytes
Newer Older
m1991's avatar
m1991 committed
1 2 3 4 5 6 7 8 9 10 11 12 13
package cn.wisenergy.controller;
import cn.wisenergy.model.app.User;
import cn.wisenergy.service.app.impl.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by m1991 on 2021/2/23 15:45
 */
@RestController
@RequestMapping("/sys")
licc's avatar
licc committed
14
public class UserSysController {
m1991's avatar
m1991 committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    @Autowired
    UserService userService;

    /**
     * 登录
     */
    @PostMapping("/login")
    public String login(User user){
        return
                userService.login(user);
    }

    /**
     * 注册
     * @param user
     * @return
     */
    @PostMapping("/regist")
    public String regist(User user){
        return userService.regist(user);
    }
}