You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package com.supervision.controller;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import com.supervision.domain.UserInfo;
|
|
|
|
import com.supervision.exception.BusinessException;
|
|
|
|
import com.supervision.util.TokenUtil;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
@Api(tags = "用户管理")
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("user")
|
|
|
|
public class UserController {
|
|
|
|
|
|
|
|
@GetMapping("login")
|
|
|
|
public String login(String userName, String password) {
|
|
|
|
if (StrUtil.isBlank(userName)) {
|
|
|
|
throw new BusinessException("用户名不能为空");
|
|
|
|
}
|
|
|
|
// TODO 后面实现
|
|
|
|
UserInfo userInfo = new UserInfo();
|
|
|
|
return TokenUtil.creatToken(userInfo);
|
|
|
|
}
|
|
|
|
}
|