package dto

import (
	"go-admin/app/operate/models"
	"go-admin/common/dto"
	common "go-admin/common/models"
	"time"
)

type OrgMatchEvaluateWonderfulGetPageReq struct {
	dto.Pagination `search:"-"`
	OrgMatchEvaluateWonderfulOrder
}

type OrgMatchEvaluateWonderfulOrder struct {
	Id              int       `form:"idOrder"  search:"type:order;column:id;table:org_match_evaluate_wonderful"`
	MatchEvaluateId string    `form:"matchEvaluateIdOrder"  search:"type:order;column:match_evaluate_id;table:org_match_evaluate_wonderful"`
	WonderfulUrl    string    `form:"wonderfulUrlOrder"  search:"type:order;column:wonderful_url;table:org_match_evaluate_wonderful"`
	WonderfulTitle  string    `form:"wonderfulTitleOrder"  search:"type:order;column:wonderful_title;table:org_match_evaluate_wonderful"`
	Type            string    `form:"typeOrder"  search:"type:order;column:type;table:org_match_evaluate_wonderful"`
	CreateBy        string    `form:"createByOrder"  search:"type:order;column:create_by;table:org_match_evaluate_wonderful"`
	UpdateBy        string    `form:"updateByOrder"  search:"type:order;column:update_by;table:org_match_evaluate_wonderful"`
	CreatedAt       time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_match_evaluate_wonderful"`
	UpdatedAt       time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_match_evaluate_wonderful"`
	DeletedAt       time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_match_evaluate_wonderful"`
}

func (m *OrgMatchEvaluateWonderfulGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type OrgMatchEvaluateWonderfulInsertReq struct {
	Id              int    `json:"-" comment:""` //
	MatchEvaluateId string `json:"matchEvaluateId" comment:""`
	WonderfulUrl    string `json:"wonderfulUrl" comment:"精彩时刻url"`
	WonderfulTitle  string `json:"wonderfulTitle" comment:"精彩时刻标题"`
	FileId          string `json:"fileId" comment:"文件id"`
	Type            string `json:"type" comment:"1 图片 2 视频"`
	common.ControlBy
}

func (s *OrgMatchEvaluateWonderfulInsertReq) Generate(model *models.OrgMatchEvaluateWonderful) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.MatchEvaluateId = s.MatchEvaluateId
	model.WonderfulUrl = s.WonderfulUrl
	model.WonderfulTitle = s.WonderfulTitle
	model.FileId = s.FileId
	model.Type = s.Type
}

func (s *OrgMatchEvaluateWonderfulInsertReq) GetId() interface{} {
	return s.Id
}

type OrgMatchEvaluateWonderfulUpdateReq struct {
	Id              int    `uri:"id" comment:""` //
	MatchEvaluateId string `json:"matchEvaluateId" comment:""`
	WonderfulUrl    string `json:"wonderfulUrl" comment:"精彩时刻url"`
	WonderfulTitle  string `json:"wonderfulTitle" comment:"精彩时刻标题"`
	FileId          string `json:"fileId" comment:"文件id"`
	Type            string `json:"type" comment:"1 图片 2 视频"`
	common.ControlBy
}

func (s *OrgMatchEvaluateWonderfulUpdateReq) Generate(model *models.OrgMatchEvaluateWonderful) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.MatchEvaluateId = s.MatchEvaluateId
	model.WonderfulUrl = s.WonderfulUrl
	model.WonderfulTitle = s.WonderfulTitle
	model.FileId = s.FileId
	model.Type = s.Type
}

func (s *OrgMatchEvaluateWonderfulUpdateReq) GetId() interface{} {
	return s.Id
}

// OrgMatchEvaluateWonderfulGetReq 功能获取请求参数
type OrgMatchEvaluateWonderfulGetReq struct {
	Id int `uri:"id"`
}

func (s *OrgMatchEvaluateWonderfulGetReq) GetId() interface{} {
	return s.Id
}

// OrgMatchEvaluateWonderfulDeleteReq 功能删除请求参数
type OrgMatchEvaluateWonderfulDeleteReq struct {
	Ids []int `json:"ids"`
	EId int   `json:"eId"`
}

func (s *OrgMatchEvaluateWonderfulDeleteReq) GetId() interface{} {
	return s.Ids
}
