1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package dto
import (
"go-admin/app/operate/models"
"go-admin/common/dto"
common "go-admin/common/models"
)
type OrgNewsGetPageReq struct {
dto.Pagination `search:"-"`
NewsName string `form:"newsName" search:"type:contains;column:news_name;table:org_news"` //新闻名称
StartTime string `form:"startTime" search:"type:gte;column:created_at;table:org_news" comment:"开始时间"` //开始时间
EndTime string `form:"endTime" search:"type:lte;column:created_at;table:org_news" comment:"结束时间"` //结束时间
Status string `form:"status" search:"type:exact;column:status;table:org_news"` //新闻状态
}
func (m *OrgNewsGetPageReq) GetNeedSearch() interface{} {
return *m
}
type OrgNewsInsertReq struct {
Id int `json:"-" comment:""` //
NewsName string `json:"newsName" comment:""`
NewsTitle string `json:"newsTitle" comment:""`
NewsContent string `json:"newsContent" comment:""`
NewsImg string `json:"newsImg" comment:""`
Status string `json:"status" comment:""`
common.ControlBy
}
func (s *OrgNewsInsertReq) Generate(model *models.OrgNews) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.NewsName = s.NewsName
model.NewsTitle = s.NewsTitle
model.NewsContent = s.NewsContent
model.NewsImg = s.NewsImg
model.Status = s.Status
}
func (s *OrgNewsInsertReq) GetId() interface{} {
return s.Id
}
type OrgNewsUpdateReq struct {
Id int `uri:"id" comment:""` //
NewsName string `json:"newsName" comment:""`
NewsTitle string `json:"newsTitle" comment:""`
NewsContent string `json:"newsContent" comment:""`
NewsImg string `json:"newsImg" comment:""`
Status string `json:"status" comment:""`
common.ControlBy
}
func (s *OrgNewsUpdateReq) Generate(model *models.OrgNews) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.NewsName = s.NewsName
model.NewsTitle = s.NewsTitle
model.NewsContent = s.NewsContent
model.NewsImg = s.NewsImg
model.Status = s.Status
}
func (s *OrgNewsUpdateReq) GetId() interface{} {
return s.Id
}
// OrgNewsGetReq 功能获取请求参数
type OrgNewsGetReq struct {
Id int `uri:"id"`
}
func (s *OrgNewsGetReq) GetId() interface{} {
return s.Id
}
// OrgNewsDeleteReq 功能删除请求参数
type OrgNewsDeleteReq struct {
Ids []int `json:"ids"`
}
func (s *OrgNewsDeleteReq) GetId() interface{} {
return s.Ids
}