You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* @Title:
* @Description:
* @Author: Yuki Wong(iyuki0430@msn.com)
* @Update:
* @Date: 2020/7/20 11:49
* @File: DataerrorDAO.go
* @Software: GoLand
**/
package DataerrorDAO
import (
"dsDataex/GenXorm/models"
"dsDataex/MyModel/MySwagger"
"dsDataex/Utils/CacheUtil"
"dsDataex/Utils/DbUtil"
"dsDataex/Utils/ErrorConst"
"dsDataex/Utils/LogUtil"
"fmt"
)
//数据库
var db = DbUtil.Engine
func GetDataerrorResults (query MySwagger.DataerrorQuery) (bool, string, int32, []map[string]interface{}, error){
sql := "SELECT id FROM t_dataex_error WHERE 1 = 1" + query.Conditions
fmt.Println("sql = ", sql)
//通过SQL获取带缓存的数据
list, count, _ := CacheUtil.Page(sql, 100, query.Page)
if count >0 {
return true, "数据获取成功", count, list, nil
}else {
return false, "数据获取失败systemID对应的数据源类型不存在", count, nil, nil
}
}
func RemoveDataerror (id string, model *models.TDataexError) (bool, string, error){
_, err := db.Where(" id = ?", id ).Update(model)
if err != nil {
LogUtil.Error(ErrorConst.SqlUpdateError, "接入系统authToken Update数据库操作发生严重错误"+err.Error())
return false, "数据库操作失败", err
}
return true, "删除成功!", nil
}