1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package com.wuwenze.api;
import cn.hutool.core.util.RandomUtil;
import com.wuwenze.entity.Token;
import com.wuwenze.support.mvc.entity.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* @author wuwenze
* @date 2019/1/28
*/
@RestController
@RequestMapping("/UserApi")
@Api(value = "UserApi", description = "用户相关接口")
public class UserApi {
@ApiOperation(value = "用户登陆", notes = "登陆成功后返回Token")
@ApiImplicitParams({
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "query", dataType = "String")
})
@RequestMapping(value = "/login", method = RequestMethod.POST)
ResultBody<Token> login(String username, String password) {
return ResultBody.ok(
Token.builder().token(RandomUtil.simpleUUID()).build()
);
}
}
|
评论