mirror of
https://github.com/m5stack/StackChan.git
synced 2026-04-28 03:22:39 +00:00
server code 4/27
This commit is contained in:
@@ -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)
|
||||
}
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user