server code 4/27

This commit is contained in:
袁智鸿
2026-04-27 10:35:03 +08:00
parent f0fa33cd67
commit 2ccbcd01c0
143 changed files with 5812 additions and 756 deletions
+17
View File
@@ -0,0 +1,17 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package user
import (
"context"
"stackChan/api/user/v2"
)
type IUserV2 interface {
Login(ctx context.Context, req *v2.LoginReq) (res *v2.LoginRes, err error)
GetUserInfo(ctx context.Context, req *v2.GetUserInfoReq) (res *v2.GetUserInfoRes, err error)
Registration(ctx context.Context, req *v2.RegistrationReq) (res *v2.RegistrationRes, err error)
}
+37
View File
@@ -0,0 +1,37 @@
/*
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
SPDX-License-Identifier: MIT
*/
package v2
import (
"stackChan/internal/model"
"github.com/gogf/gf/v2/frame/g"
)
type LoginReq struct {
g.Meta `path:"user/login" method:"post" tags:"Info" summary:"user login info"`
Username string `json:"username" v:"required" description:"Account or email"`
Password string `json:"password" v:"required" description:"Password"`
}
type LoginRes struct {
Token string `json:"token"`
}
type GetUserInfoReq struct {
g.Meta `path:"user" method:"get" tags:"Info" summary:"user get info"`
}
type GetUserInfoRes model.User
type RegistrationReq struct {
g.Meta `path:"user/registration" method:"post" tags:"Info" summary:"user registration"`
UserName string `json:"username" v:"required" description:"Username"`
Email string `json:"email" v:"required" description:"Email address"`
Password string `json:"password" v:"required" description:"Password"`
}
type RegistrationRes *model.RegistrationResponse