user.go
815 字节
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
35
36
37
38
39
40
41
package v1
import (
"ability/protocol"
"ability/controllers"
)
type UserController struct {
controllers.BaseController
}
//匹配的是路由
// 127.0.0.1:8080/user/login/*
//127.0.0.1:8080/user/logout/*
func (this *UserController) URLMapping() {
//this.Mapping("/v1/user/login",this.Login)
//this.Mapping("/v1/user/select",this.SelectUser)
}
// Login
// @Title Login
// @Description 登录
// @Param body body string true "body"
// @router /v1/user/login [post]
func (this *UserController) Login() {
var msg *protocol.ResponseMessage
defer func() {
this.Resp(msg)
}()
msg = protocol.NewReturnResponse("login success", nil)
}
func (this *UserController) Logout() {
var msg *protocol.ResponseMessage
defer func() {
this.Resp(msg)
}()
msg = protocol.NewReturnResponse("logout success", nil)
}