mirror of
https://github.com/m5stack/StackChan.git
synced 2026-04-28 11:27:59 +00:00
server code 4/27
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"stackChan/api/admin/v1"
|
||||
)
|
||||
|
||||
type IAdminV1 interface {
|
||||
AdminLogin(ctx context.Context, req *v1.AdminLoginReq) (res *v1.AdminLoginRes, err error)
|
||||
AddApp(ctx context.Context, req *v1.AddAppReq) (res *v1.AddAppRes, err error)
|
||||
GetAppList(ctx context.Context, req *v1.GetAppListReq) (res *v1.GetAppListRes, err error)
|
||||
DeleteApp(ctx context.Context, req *v1.DeleteAppReq) (res *v1.DeleteAppRes, err error)
|
||||
UpdateApp(ctx context.Context, req *v1.UpdateAppReq) (res *v1.UpdateAppRes, err error)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
|
||||
SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type AdminLoginReq struct {
|
||||
g.Meta `path:"/login" method:"post" tags:"Info" summary:"admin login info"`
|
||||
UserName string `json:"user_name" description:"Admin username"`
|
||||
Password string `json:"pass_word" description:"Admin password"`
|
||||
}
|
||||
|
||||
type AdminLoginRes struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
|
||||
SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"stackChan/internal/model"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
type AddAppReq struct {
|
||||
g.Meta `path:"/app/add" method:"post" tags:"App" summary:"App add request"`
|
||||
AppName string `json:"appName" orm:"app_name" v:"required" d:"" description:"App name (required)"`
|
||||
AppIconUrl string `json:"appIconUrl" orm:"app_icon_url" d:"" description:"App icon URL (optional)"`
|
||||
Description string `json:"description" orm:"description" d:"" description:"App description (optional)"`
|
||||
FirmwareUrl string `json:"firmwareUrl" orm:"firmware_url" d:"" description:"Firmware / installation package download URL (optional)"`
|
||||
}
|
||||
|
||||
type AddAppRes model.AppInfo
|
||||
|
||||
type GetAppListReq struct {
|
||||
g.Meta `path:"/apps" method:"get" tags:"App" summary:"App List Get"`
|
||||
}
|
||||
|
||||
type GetAppListRes []model.AppInfo
|
||||
|
||||
type DeleteAppReq struct {
|
||||
g.Meta `path:"/app/delete" method:"delete" tags:"App" summary:"App delete"`
|
||||
Id int64 `json:"id" orm:"id" description:"App ID"` // App ID
|
||||
}
|
||||
|
||||
type DeleteAppRes struct{}
|
||||
|
||||
type UpdateAppReq struct {
|
||||
g.Meta `path:"/app/update" method:"put" tags:"App" summary:"App put"`
|
||||
Id int64 `json:"id" orm:"id" v:"required" description:"App ID (required)"`
|
||||
AppName string `json:"appName" orm:"app_name" d:"" description:"App name (optional)"`
|
||||
AppIconUrl string `json:"appIconUrl" orm:"app_icon_url" d:"" description:"App icon URL (optional)"`
|
||||
Description string `json:"description" orm:"description" d:"" description:"App description (optional)"`
|
||||
FirmwareUrl string `json:"firmwareUrl" orm:"firmware_url" d:"" description:"Firmware / installation package download URL (optional)"`
|
||||
}
|
||||
|
||||
type UpdateAppRes model.AppInfo
|
||||
Reference in New Issue
Block a user