// Package sysin
// @Link  https://github.com/bufanyun/hotgo
// @Copyright  Copyright (c) 2025 HotGo CLI
// @Author  Ms <133814250@qq.com>
// @License  https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.17.8
package sysin

import (
	"context"
	"hotgo/internal/model/entity"
	"hotgo/internal/model/input/form"

	"github.com/gogf/gf/v2/frame/g"
)

// LessonCategoryUpdateFields 修改课程分类字段过滤
type LessonCategoryUpdateFields struct {
	Name      string `json:"name"      dc:"分类名"`
	SortOrder int    `json:"sortOrder" dc:"排序"`
	UpdatedBy int    `json:"updatedBy" dc:"更新人"`
}

// LessonCategoryInsertFields 新增课程分类字段过滤
type LessonCategoryInsertFields struct {
	Name      string `json:"name"      dc:"分类名"`
	SortOrder int    `json:"sortOrder" dc:"排序"`
	CreatedBy int    `json:"createdBy" dc:"创建人"`
}

// LessonCategoryEditInp 修改/新增课程分类
type LessonCategoryEditInp struct {
	entity.LessonCategory
}

func (in *LessonCategoryEditInp) Filter(ctx context.Context) (err error) {
	// 验证分类名
	if err := g.Validator().Rules("required").Data(in.Name).Messages("分类名不能为空").Run(ctx); err != nil {
		return err.Current()
	}

	return
}

type LessonCategoryEditModel struct{}

// LessonCategoryDeleteInp 删除课程分类
type LessonCategoryDeleteInp struct {
	Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *LessonCategoryDeleteInp) Filter(ctx context.Context) (err error) {
	return
}

type LessonCategoryDeleteModel struct{}

// LessonCategoryViewInp 获取指定课程分类信息
type LessonCategoryViewInp struct {
	Id int `json:"id" v:"required#id不能为空" dc:"id"`
}

func (in *LessonCategoryViewInp) Filter(ctx context.Context) (err error) {
	return
}

type LessonCategoryViewModel struct {
	entity.LessonCategory
}

// LessonCategoryListInp 获取课程分类列表
type LessonCategoryListInp struct {
	form.PageReq
	Name string `json:"name" dc:"分类名"`
}

func (in *LessonCategoryListInp) Filter(ctx context.Context) (err error) {
	return
}

type LessonCategoryListModel struct {
	Id        int    `json:"id"        dc:"id"`
	Name      string `json:"name"      dc:"分类名"`
	SortOrder int    `json:"sortOrder" dc:"排序"`
}

// LessonCategoryExportModel 导出课程分类
type LessonCategoryExportModel struct {
	Name      string `json:"name"      dc:"分类名"`
	SortOrder int    `json:"sortOrder" dc:"排序"`
}