Files
windows_lock_go/app/admin/service/dto/mm_alarm_log.go
hucan 180e0e6957 1、google验证器
2、导出告警去重
3、去掉提示音
2025-07-16 18:22:11 +08:00

99 lines
3.2 KiB
Go

package dto
import (
"go-admin/app/admin/models"
"go-admin/common/dto"
common "go-admin/common/models"
)
type MmAlarmLogGetPageReq struct {
dto.Pagination `search:"-"`
MachineId string `form:"machineId" search:"type:exact;column:machine_id;table:mm_alarm_log" comment:"设备id"`
BiosId string `form:"biosId" search:"type:exact;column:bios_id;table:mm_alarm_log" comment:"设备码"`
MmAlarmLogOrder
}
type MmAlarmLogOrder struct {
Id string `form:"idOrder" search:"type:order;column:id;table:mm_alarm_log"`
MachineId string `form:"machineIdOrder" search:"type:order;column:machine_id;table:mm_alarm_log"`
BiosId string `form:"biosIdOrder" search:"type:order;column:bios_id;table:mm_alarm_log"`
Content string `form:"contentOrder" search:"type:order;column:content;table:mm_alarm_log"`
CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:mm_alarm_log"`
UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:mm_alarm_log"`
DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:mm_alarm_log"`
CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:mm_alarm_log"`
UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:mm_alarm_log"`
}
func (m *MmAlarmLogGetPageReq) GetNeedSearch() interface{} {
return *m
}
type MmAlarmLogInsertReq struct {
Id int `json:"-" comment:"主键id"` // 主键id
MachineId string `json:"machineId" comment:"设备id"`
BiosId string `json:"biosId" comment:"设备码"`
Content string `json:"content" comment:"内容"`
common.ControlBy
}
func (s *MmAlarmLogInsertReq) Generate(model *models.MmAlarmLog) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.MachineId = s.MachineId
model.BiosId = s.BiosId
model.Content = s.Content
model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
}
func (s *MmAlarmLogInsertReq) GetId() interface{} {
return s.Id
}
type MmAlarmLogUpdateReq struct {
Id int `uri:"id" comment:"主键id"` // 主键id
MachineId string `json:"machineId" comment:"设备id"`
BiosId string `json:"biosId" comment:"设备码"`
Content string `json:"content" comment:"内容"`
common.ControlBy
}
func (s *MmAlarmLogUpdateReq) Generate(model *models.MmAlarmLog) {
if s.Id == 0 {
model.Model = common.Model{Id: s.Id}
}
model.MachineId = s.MachineId
model.BiosId = s.BiosId
model.Content = s.Content
model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
}
func (s *MmAlarmLogUpdateReq) GetId() interface{} {
return s.Id
}
// MmAlarmLogGetReq 功能获取请求参数
type MmAlarmLogGetReq struct {
Id int `uri:"id"`
}
func (s *MmAlarmLogGetReq) GetId() interface{} {
return s.Id
}
// MmAlarmLogDeleteReq 功能删除请求参数
type MmAlarmLogDeleteReq struct {
Ids []int `json:"ids"`
}
func (s *MmAlarmLogDeleteReq) GetId() interface{} {
return s.Ids
}
type MmAlarmLogExportResp struct {
MachineId string `json:"machineId" comment:"设备id" excel:"设备id"`
BiosId string `json:"biosId" comment:"设备码" excel:"设备码"`
Content string `json:"content" comment:"内容" excel:"内容"`
}