im 管理后台
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// Package model
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 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"`
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 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"`
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 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:"当前时间"`
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// TableEditInp 修改/新增
|
||||
type TableEditInp struct {
|
||||
entity.AddonHgexampleTable
|
||||
}
|
||||
|
||||
type TableEditModel struct{}
|
||||
|
||||
func (in *TableEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Map.IsNil() {
|
||||
in.Map = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Flag.IsNil() {
|
||||
in.Flag = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Images.IsNil() {
|
||||
in.Images = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Attachfiles.IsNil() {
|
||||
in.Attachfiles = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
if in.Hobby.IsNil() {
|
||||
in.Hobby = gjson.New(consts.NilJsonToString)
|
||||
}
|
||||
|
||||
if in.Title == "" {
|
||||
return errors.New("标题不能为空")
|
||||
}
|
||||
|
||||
if in.Email != "" && !validate.IsEmail(in.Email) {
|
||||
return errors.New("邮箱格式不正确")
|
||||
}
|
||||
|
||||
if err := g.Validator().Rules("float|between:0,5").Messages("请输入一个浮点数|推荐星只能是0~5星").Data(in.Star).Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// TableDeleteInp 删除类型
|
||||
type TableDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#表格ID不能为空" dc:"表格ID"`
|
||||
}
|
||||
|
||||
type TableDeleteModel struct{}
|
||||
|
||||
// TableViewInp 获取信息
|
||||
type TableViewInp struct {
|
||||
Id int64 `json:"id" v:"required#表格ID不能为空" dc:"表格ID"`
|
||||
}
|
||||
|
||||
type TableViewModel struct {
|
||||
entity.AddonHgexampleTable
|
||||
}
|
||||
|
||||
// TableListInp 获取列表
|
||||
type TableListInp struct {
|
||||
form.PageReq
|
||||
form.Sorters
|
||||
Id int64 `json:"id" description:""`
|
||||
Flag *gjson.Json `json:"flag" description:"标签"`
|
||||
Title string `json:"title" description:"标题"`
|
||||
Content string `json:"content" description:"内容"`
|
||||
Price []float64 `json:"price" description:"价格"`
|
||||
ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"`
|
||||
Switch int `json:"switch" description:"开关"`
|
||||
Hobby *gjson.Json `json:"hobby" description:"爱好"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
}
|
||||
|
||||
type TableListModel struct {
|
||||
entity.AddonHgexampleTable
|
||||
TableCategoryName string `json:"TableCategoryName" description:"分类名称"`
|
||||
TableCategoryDescription string `json:"TableCategoryDescription" description:"分类描述"`
|
||||
TableCategoryRemark string `json:"TableCategoryRemark" description:"分类备注"`
|
||||
SysProvincesTitle string `json:"sysProvincesTitle" description:""`
|
||||
}
|
||||
|
||||
func (in *TableListInp) Filter(ctx context.Context) (err error) {
|
||||
if !in.Flag.IsNil() {
|
||||
in.Flag = gjson.New(in.Flag.Var().Ints())
|
||||
}
|
||||
if !in.Hobby.IsNil() {
|
||||
in.Hobby = gjson.New(in.Hobby.Var().Ints())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type TableExportModel struct {
|
||||
Id int64 `json:"id" description:""`
|
||||
CategoryId int64 `json:"categoryId" description:"分类ID"`
|
||||
Flag *gjson.Json `json:"flag" description:"标签"`
|
||||
Title string `json:"title" description:"标题"`
|
||||
Star float64 `json:"star" description:"推荐星"`
|
||||
Price float64 `json:"price" description:"价格"`
|
||||
Views int64 `json:"views" description:"浏览次数"`
|
||||
ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"`
|
||||
StartAt *gtime.Time `json:"startAt" description:"开启时间"`
|
||||
EndAt *gtime.Time `json:"endAt" description:"结束时间"`
|
||||
Switch int `json:"switch" description:"开关"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Avatar string `json:"avatar" description:"头像"`
|
||||
Sex int `json:"sex" description:"性别"`
|
||||
Qq string `json:"qq" description:"qq"`
|
||||
Email string `json:"email" description:"邮箱"`
|
||||
Mobile string `json:"mobile" description:"手机号码"`
|
||||
Hobby *gjson.Json `json:"hobby" description:"爱好"`
|
||||
Channel int `json:"channel" description:"渠道"`
|
||||
Pid int64 `json:"pid" description:"上级ID"`
|
||||
Level int `json:"level" description:"树等级"`
|
||||
Tree string `json:"tree" description:"关系树"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedBy int64 `json:"createdBy" description:"创建者"`
|
||||
UpdatedBy int64 `json:"updatedBy" description:"更新者"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"修改时间"`
|
||||
DeletedAt *gtime.Time `json:"deletedAt" description:"删除时间"`
|
||||
}
|
||||
|
||||
// TableMaxSortInp 最大排序
|
||||
type TableMaxSortInp struct{}
|
||||
|
||||
type TableMaxSortModel struct {
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// TableStatusInp 更新状态
|
||||
type TableStatusInp struct {
|
||||
Id int64 `json:"id" v:"required#表格ID不能为空" dc:"表格ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
func (in *TableStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type TableStatusModel struct{}
|
||||
|
||||
// TableSwitchInp 更新开关状态
|
||||
type TableSwitchInp struct {
|
||||
form.SwitchReq
|
||||
Id int64 `json:"id" v:"required#表格ID不能为空" dc:"表格ID"`
|
||||
}
|
||||
|
||||
type TableSwitchModel struct{}
|
||||
@@ -0,0 +1,123 @@
|
||||
// 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
|
||||
// @AutoGenerate Version 2.13.1
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// TenantOrderUpdateFields 修改多租户功能演示字段过滤
|
||||
type TenantOrderUpdateFields struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
MerchantId int64 `json:"merchantId" dc:"商户ID"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
ProductName string `json:"productName" dc:"购买产品"`
|
||||
OrderSn string `json:"orderSn" dc:"关联订单号"`
|
||||
Money float64 `json:"money" dc:"充值金额"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
Status int `json:"status" dc:"支付状态"`
|
||||
}
|
||||
|
||||
// TenantOrderInsertFields 新增多租户功能演示字段过滤
|
||||
type TenantOrderInsertFields struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
MerchantId int64 `json:"merchantId" dc:"商户ID"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
ProductName string `json:"productName" dc:"购买产品"`
|
||||
OrderSn string `json:"orderSn" dc:"关联订单号"`
|
||||
Money float64 `json:"money" dc:"充值金额"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
Status int `json:"status" dc:"支付状态"`
|
||||
}
|
||||
|
||||
// TenantOrderEditInp 修改/新增多租户功能演示
|
||||
type TenantOrderEditInp struct {
|
||||
entity.AddonHgexampleTenantOrder
|
||||
}
|
||||
|
||||
func (in *TenantOrderEditInp) Filter(ctx context.Context) (err error) {
|
||||
// 验证充值金额
|
||||
if err := g.Validator().Rules("required").Data(in.Money).Messages("充值金额不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type TenantOrderEditModel struct{}
|
||||
|
||||
// TenantOrderDeleteInp 删除多租户功能演示
|
||||
type TenantOrderDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#主键不能为空" dc:"主键"`
|
||||
}
|
||||
|
||||
func (in *TenantOrderDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type TenantOrderDeleteModel struct{}
|
||||
|
||||
// TenantOrderViewInp 获取指定多租户功能演示信息
|
||||
type TenantOrderViewInp struct {
|
||||
Id int64 `json:"id" v:"required#主键不能为空" dc:"主键"`
|
||||
}
|
||||
|
||||
func (in *TenantOrderViewInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type TenantOrderViewModel struct {
|
||||
entity.AddonHgexampleTenantOrder
|
||||
}
|
||||
|
||||
// TenantOrderListInp 获取多租户功能演示列表
|
||||
type TenantOrderListInp struct {
|
||||
form.PageReq
|
||||
Id int64 `json:"id" dc:"主键"`
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
MerchantId int64 `json:"merchantId" dc:"商户ID"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
OrderSn string `json:"orderSn" dc:"关联订单号"`
|
||||
Status int `json:"status" dc:"支付状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *TenantOrderListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type TenantOrderListModel struct {
|
||||
Id int64 `json:"id" dc:"主键"`
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
MerchantId int64 `json:"merchantId" dc:"商户ID"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
ProductName string `json:"productName" dc:"购买产品"`
|
||||
OrderSn string `json:"orderSn" dc:"关联订单号"`
|
||||
Money float64 `json:"money" dc:"充值金额"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
Status int `json:"status" dc:"支付状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
// TenantOrderExportModel 导出多租户功能演示
|
||||
type TenantOrderExportModel struct {
|
||||
Id int64 `json:"id" dc:"主键"`
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
MerchantId int64 `json:"merchantId" dc:"商户ID"`
|
||||
UserId int64 `json:"userId" dc:"用户ID"`
|
||||
ProductName string `json:"productName" dc:"购买产品"`
|
||||
OrderSn string `json:"orderSn" dc:"关联订单号"`
|
||||
Money float64 `json:"money" dc:"充值金额"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
Status int `json:"status" dc:"支付状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// TreeTableListInp 获取列表
|
||||
type TreeTableListInp struct {
|
||||
form.PageReq
|
||||
form.Sorters
|
||||
Id int64 `json:"id" description:""`
|
||||
Flag *gjson.Json `json:"flag" description:"标签"`
|
||||
Title string `json:"title" description:"标题"`
|
||||
Content string `json:"content" description:"内容"`
|
||||
Price []float64 `json:"price" description:"价格"`
|
||||
ActivityAt *gtime.Time `json:"activityAt" description:"活动时间"`
|
||||
Switch int `json:"switch" description:"开关"`
|
||||
Hobby *gjson.Json `json:"hobby" description:"爱好"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" description:"创建时间"`
|
||||
Pid int64 `json:"pid" description:"上级ID"`
|
||||
}
|
||||
|
||||
type TreeTableListModel struct {
|
||||
entity.AddonHgexampleTable
|
||||
TableCategoryName string `json:"TableCategoryName" description:"分类名称"`
|
||||
TableCategoryDescription string `json:"TableCategoryDescription" description:"分类描述"`
|
||||
TableCategoryRemark string `json:"TableCategoryRemark" description:"分类备注"`
|
||||
SysProvincesTitle string `json:"sysProvincesTitle" description:""`
|
||||
}
|
||||
|
||||
// TableTree 树
|
||||
type TableTree struct {
|
||||
entity.AddonHgexampleTable
|
||||
Key int64 `json:"key" dc:"key"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Children []*TableTree `json:"children"`
|
||||
}
|
||||
Reference in New Issue
Block a user