Add Info.
This commit is contained in:
		@ -37,6 +37,7 @@ func (this *UserController) RegisterRoutes() map[string]func(writer http.Respons
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	routeMap := make(map[string]func(writer http.ResponseWriter, request *http.Request))
 | 
						routeMap := make(map[string]func(writer http.ResponseWriter, request *http.Request))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						routeMap["/api/user/info"] = this.Wrap(this.Info, USER_ROLE_GUEST)
 | 
				
			||||||
	routeMap["/api/user/login"] = this.Wrap(this.Login, USER_ROLE_GUEST)
 | 
						routeMap["/api/user/login"] = this.Wrap(this.Login, USER_ROLE_GUEST)
 | 
				
			||||||
	routeMap["/api/user/authentication/login"] = this.Wrap(this.AuthenticationLogin, USER_ROLE_GUEST)
 | 
						routeMap["/api/user/authentication/login"] = this.Wrap(this.AuthenticationLogin, USER_ROLE_GUEST)
 | 
				
			||||||
	routeMap["/api/user/register"] = this.Wrap(this.Register, USER_ROLE_GUEST)
 | 
						routeMap["/api/user/register"] = this.Wrap(this.Register, USER_ROLE_GUEST)
 | 
				
			||||||
@ -131,6 +132,12 @@ func (this *UserController) AuthenticationLogin(writer http.ResponseWriter, requ
 | 
				
			|||||||
	return this.Success(user)
 | 
						return this.Success(user)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//fetch current user's info.
 | 
				
			||||||
 | 
					func (this *UserController) Info(writer http.ResponseWriter, request *http.Request) *result.WebResult {
 | 
				
			||||||
 | 
						user := this.checkUser(request)
 | 
				
			||||||
 | 
						return this.Success(user)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//register by username and password. After registering, will auto login.
 | 
					//register by username and password. After registering, will auto login.
 | 
				
			||||||
func (this *UserController) Register(writer http.ResponseWriter, request *http.Request) *result.WebResult {
 | 
					func (this *UserController) Register(writer http.ResponseWriter, request *http.Request) *result.WebResult {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user