org_league.go 2.35 KB
Newer Older
haoyanbin's avatar
1  
haoyanbin committed
1 2 3
package dto

import (
haoyanbin's avatar
1  
haoyanbin committed
4
	"go-admin/app/operate/models"
haoyanbin's avatar
1  
haoyanbin committed
5 6 7 8 9 10
	"go-admin/common/dto"
	common "go-admin/common/models"
	"time"
)

type OrgLeagueGetPageReq struct {
haoyanbin's avatar
1  
haoyanbin committed
11 12
	dto.Pagination `search:"-"`
	OrgLeagueOrder
haoyanbin's avatar
1  
haoyanbin committed
13 14
}

haoyanbin's avatar
1  
haoyanbin committed
15 16 17 18 19 20 21 22 23
type OrgLeagueOrder struct {
	Id         int       `form:"idOrder"  search:"type:order;column:id;table:org_league"`
	LeagueName string    `form:"leagueNameOrder"  search:"type:order;column:league_name;table:org_league"`
	Status     string    `form:"statusOrder"  search:"type:order;column:status;table:org_league"`
	CreateBy   string    `form:"createByOrder"  search:"type:order;column:create_by;table:org_league"`
	UpdateBy   string    `form:"updateByOrder"  search:"type:order;column:update_by;table:org_league"`
	CreatedAt  time.Time `form:"createdAtOrder"  search:"type:order;column:created_at;table:org_league"`
	UpdatedAt  time.Time `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:org_league"`
	DeletedAt  time.Time `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:org_league"`
haoyanbin's avatar
1  
haoyanbin committed
24 25 26 27 28 29 30
}

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

type OrgLeagueInsertReq struct {
haoyanbin's avatar
1  
haoyanbin committed
31 32 33 34
	Id         int    `json:"-" comment:""` //
	LeagueName string `json:"leagueName" comment:"联赛级别"`
	Status     string `json:"status" comment:"联赛开启状态 1 是 0 否"`
	common.ControlBy
haoyanbin's avatar
1  
haoyanbin committed
35 36
}

haoyanbin's avatar
1  
haoyanbin committed
37 38 39 40 41 42
func (s *OrgLeagueInsertReq) Generate(model *models.OrgLeague) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LeagueName = s.LeagueName
	model.Status = s.Status
haoyanbin's avatar
1  
haoyanbin committed
43 44 45 46 47 48 49
}

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

type OrgLeagueUpdateReq struct {
haoyanbin's avatar
1  
haoyanbin committed
50 51 52 53
	Id         int    `uri:"id" comment:""` //
	LeagueName string `json:"leagueName" comment:"联赛级别"`
	Status     string `json:"status" comment:"联赛开启状态 1 是 0 否"`
	common.ControlBy
haoyanbin's avatar
1  
haoyanbin committed
54 55
}

haoyanbin's avatar
1  
haoyanbin committed
56 57 58 59 60 61
func (s *OrgLeagueUpdateReq) Generate(model *models.OrgLeague) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.LeagueName = s.LeagueName
	model.Status = s.Status
haoyanbin's avatar
1  
haoyanbin committed
62 63 64 65 66 67 68 69
}

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

// OrgLeagueGetReq 功能获取请求参数
type OrgLeagueGetReq struct {
haoyanbin's avatar
1  
haoyanbin committed
70
	Id int `uri:"id"`
haoyanbin's avatar
1  
haoyanbin committed
71
}
haoyanbin's avatar
1  
haoyanbin committed
72

haoyanbin's avatar
1  
haoyanbin committed
73 74 75 76 77 78 79 80 81 82 83
func (s *OrgLeagueGetReq) GetId() interface{} {
	return s.Id
}

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

func (s *OrgLeagueDeleteReq) GetId() interface{} {
	return s.Ids
haoyanbin's avatar
1  
haoyanbin committed
84
}