mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-23 09:26:48 +08:00
🎨 🔥 ✨ 🚑 集成前端代码的&兼容容器化部署插件的插件改造&提供了一个新的轮播图插件
This commit is contained in:
11
server/addons/flashbanner/model/config.go
Normal file
11
server/addons/flashbanner/model/config.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// Package model
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package model
|
||||
|
||||
// BasicConfig 基础配置
|
||||
type BasicConfig struct {
|
||||
Test string `json:"basicTest"`
|
||||
}
|
||||
22
server/addons/flashbanner/model/entity/banner.go
Normal file
22
server/addons/flashbanner/model/entity/banner.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// Banner is the golang structure for table banner.
|
||||
type Banner struct {
|
||||
Id int `json:"id" orm:"id" description:""`
|
||||
Name string `json:"name" orm:"name" description:"轮播图名称"`
|
||||
Cover string `json:"cover" orm:"cover" description:"图片URL"`
|
||||
Link string `json:"link" orm:"link" description:"跳转链接,小程序内用相对地址"`
|
||||
Type int `json:"type" orm:"type" description:"类型默认不传"`
|
||||
Status uint `json:"status" orm:"status" description:"1可用"`
|
||||
Sort int `json:"sort" orm:"sort" description:"排序,数字越大越靠前"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:""`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:""`
|
||||
}
|
||||
98
server/addons/flashbanner/model/input/sysin/banner.go
Normal file
98
server/addons/flashbanner/model/input/sysin/banner.go
Normal file
@@ -0,0 +1,98 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/addons/flashbanner/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
)
|
||||
|
||||
// BannerCreateInp 创建轮播图
|
||||
type BannerCreateInp struct {
|
||||
Name string `json:"name" v:"required#轮播图名称不能为空" dc:"轮播图名称"`
|
||||
Cover string `json:"cover" v:"required#轮播图封面不能为空" dc:"轮播图封面"`
|
||||
Link string `json:"link" dc:"轮播图链接"`
|
||||
Type int `json:"type" dc:"轮播图类型"`
|
||||
Sort int `json:"sort" dc:"排序,数字越大越靠前"`
|
||||
}
|
||||
|
||||
func (in *BannerCreateInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type BannerCreateModel struct{}
|
||||
|
||||
// BannerEditInp 修改/新增轮播图
|
||||
type BannerEditInp struct {
|
||||
entity.Banner
|
||||
}
|
||||
|
||||
func (in *BannerEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Name == "" {
|
||||
err = gerror.New("轮播图名称不能为空")
|
||||
return
|
||||
}
|
||||
if in.Cover == "" {
|
||||
err = gerror.New("轮播图封面不能为空")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type BannerEditModel struct{}
|
||||
|
||||
// BannerDeleteInp 删除轮播图
|
||||
type BannerDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#轮播图ID不能为空" dc:"轮播图ID"`
|
||||
}
|
||||
|
||||
func (in *BannerDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type BannerDeleteModel struct{}
|
||||
|
||||
// BannerViewInp 获取指定轮播图信息
|
||||
type BannerViewInp struct {
|
||||
Id int64 `json:"id" v:"required#轮播图ID不能为空" dc:"轮播图ID"`
|
||||
}
|
||||
|
||||
func (in *BannerViewInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type BannerViewModel struct {
|
||||
entity.Banner
|
||||
}
|
||||
|
||||
// BannerListInp 获取轮播图列表
|
||||
type BannerListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name" dc:"轮播图名称"`
|
||||
Type int `json:"type" dc:"轮播图类型"`
|
||||
}
|
||||
|
||||
func (in *BannerListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type BannerListModel struct {
|
||||
entity.Banner
|
||||
}
|
||||
|
||||
// BannerStatusInp 更新轮播图状态
|
||||
type BannerStatusInp struct {
|
||||
Id int64 `json:"id" v:"required#轮播图ID不能为空" dc:"轮播图ID"`
|
||||
Status int `json:"status" v:"required#状态不能为空" dc:"状态"`
|
||||
}
|
||||
|
||||
func (in *BannerStatusInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type BannerStatusModel struct{}
|
||||
24
server/addons/flashbanner/model/input/sysin/config.go
Normal file
24
server/addons/flashbanner/model/input/sysin/config.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
)
|
||||
|
||||
// UpdateConfigInp 更新指定配置
|
||||
type UpdateConfigInp struct {
|
||||
sysin.UpdateAddonsConfigInp
|
||||
}
|
||||
|
||||
type GetConfigInp struct {
|
||||
sysin.GetAddonsConfigInp
|
||||
}
|
||||
|
||||
type GetConfigModel struct {
|
||||
List g.Map `json:"list"`
|
||||
}
|
||||
27
server/addons/flashbanner/model/input/sysin/index.go
Normal file
27
server/addons/flashbanner/model/input/sysin/index.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// IndexTestInp 测试
|
||||
type IndexTestInp struct {
|
||||
Name string `json:"name" d:"HotGo" dc:"名称"`
|
||||
}
|
||||
|
||||
func (in *IndexTestInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type IndexTestModel struct {
|
||||
Name string `json:"name" dc:"名称"`
|
||||
Module string `json:"module" dc:"当前插件模块"`
|
||||
Time *gtime.Time `json:"time" dc:"当前时间"`
|
||||
}
|
||||
Reference in New Issue
Block a user