一些框架优化

This commit is contained in:
tangping
2025-01-07 16:43:33 +08:00
parent d562558a3e
commit b107b88800
9 changed files with 120 additions and 24 deletions

View File

@@ -33,6 +33,7 @@ type UserApi struct {
func init() {
moduleName := "UserApi"
methodName := "Register"
skipVerifyTokenPage := true
methodDesc := "注册用户"
methodAuthor := "tangping"
methodMendor := ""
@@ -47,7 +48,7 @@ func init() {
"id '类型:int'": "用户id",
}
}`
remark.RegisterMethodRemark(moduleName, methodName, methodDesc, methodAuthor, methodMendor, methodDate, methodInParam, methodOutParam)
remark.RegisterMethodRemark(moduleName, methodName, methodDesc, methodAuthor, methodMendor, methodDate, methodInParam, methodOutParam, skipVerifyTokenPage)
}
func (a *UserApi) Register(account string, name string, password string, sex int32, birthday string, phone int64, email string, wechatGroup string, describe string) (responseObj *webServer.ResponseObject) {
responseObj = webServer.GetInitResponseObj()
@@ -86,6 +87,7 @@ func (a *UserApi) Register(account string, name string, password string, sex int
func init() {
moduleName := "UserApi"
methodName := "Login"
skipVerifyTokenPage := true
methodDesc := "用户登录"
methodAuthor := "tangping"
methodMendor := ""
@@ -101,7 +103,7 @@ func init() {
}
}`
remark.RegisterMethodRemark(moduleName, methodName, methodDesc, methodAuthor, methodMendor, methodDate, methodInParam, methodOutParam)
remark.RegisterMethodRemark(moduleName, methodName, methodDesc, methodAuthor, methodMendor, methodDate, methodInParam, methodOutParam, skipVerifyTokenPage)
}
func (a *UserApi) Login(account string, password string) (responseObj *webServer.ResponseObject) {
@@ -128,7 +130,7 @@ func (a *UserApi) Login(account string, password string) (responseObj *webServer
}
//添加登录用户
webServer.AddLoginUserToken(token, &webServer.TokenInfo{Id: userData.ID, Account: account})
webServer.AddLoginUserToken(token, &webServer.TokenInfo{Id: userData.ID, Account: account, UserInfo: userData})
//UserData映射成map
resultMap := make(map[string]any)