mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 05:12:32 +08:00
golangci-lint run
This commit is contained in:
@@ -112,19 +112,6 @@ func (s *sSysAddonsConfig) UpdateConfigByGroup(ctx context.Context, in *sysin.Up
|
||||
row := s.getConfigByKey(k, models)
|
||||
// 新增
|
||||
if row == nil {
|
||||
//row.Id = 0
|
||||
//row.Key = k
|
||||
//row.Value = gconv.String(v)
|
||||
//row.Group = in.Group
|
||||
//row.Status = consts.StatusEnabled
|
||||
//row.CreatedAt = gtime.Now()
|
||||
//row.UpdatedAt = gtime.Now()
|
||||
//_, err := dao.SysAddonsConfig.Ctx(ctx).Data(row).Insert()
|
||||
//if err != nil {
|
||||
// err = gerror.Wrap(err, consts.ErrorORM)
|
||||
// return err
|
||||
//}
|
||||
//continue
|
||||
return gerror.Newf("暂不支持从前台添加变量,请先在数据库表[%v]中配置变量:%v", dao.SysAddonsConfig.Table(), k)
|
||||
}
|
||||
|
||||
|
@@ -249,19 +249,6 @@ func (s *sSysConfig) UpdateConfigByGroup(ctx context.Context, in *sysin.UpdateCo
|
||||
row := s.getConfigByKey(k, models)
|
||||
// 新增
|
||||
if row == nil {
|
||||
//row.Id = 0
|
||||
//row.Key = k
|
||||
//row.Value = gconv.String(v)
|
||||
//row.Group = in.Group
|
||||
//row.Status = consts.StatusEnabled
|
||||
//row.CreatedAt = gtime.Now()
|
||||
//row.UpdatedAt = gtime.Now()
|
||||
//_, err := dao.SysConfig.Ctx(ctx).Data(row).Insert()
|
||||
//if err != nil {
|
||||
// err = gerror.Wrap(err, consts.ErrorORM)
|
||||
// return err
|
||||
//}
|
||||
//continue
|
||||
err = gerror.Newf("暂不支持从前台添加变量,请先在数据库表[%v]中配置变量:%v", dao.SysConfig.Table(), k)
|
||||
return
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ func (s *sSysCurdDemo) List(ctx context.Context, in *sysin.CurdDemoListInp) (lis
|
||||
return
|
||||
}
|
||||
|
||||
//关联表select
|
||||
// 关联表select
|
||||
fields, err := hgorm.GenJoinSelect(ctx, sysin.CurdDemoListModel{}, &dao.SysGenCurdDemo, []*hgorm.Join{
|
||||
{Dao: &dao.TestCategory, Alias: "testCategory"},
|
||||
})
|
||||
|
@@ -7,7 +7,6 @@ package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@@ -168,7 +167,8 @@ func (s *sSysLog) AnalysisLog(ctx context.Context) entity.SysLog {
|
||||
}
|
||||
|
||||
// 请求头
|
||||
if reqHeadersBytes, _ := json.Marshal(request.Header); len(gconv.String(reqHeadersBytes)) > 0 {
|
||||
|
||||
if reqHeadersBytes, _ := gjson.New(request.Header).MarshalJSON(); len(reqHeadersBytes) > 0 {
|
||||
headerData = gjson.New(reqHeadersBytes)
|
||||
}
|
||||
|
||||
@@ -322,26 +322,13 @@ func (s *sSysLog) List(ctx context.Context, in *sysin.LogListInp) (list []*sysin
|
||||
list[i].MemberName = memberName.String()
|
||||
}
|
||||
|
||||
//// 接口
|
||||
//if list[i].AppId == consts.AppApi {
|
||||
// //memberName, err = dao.Member.Ctx(ctx).Fields("realname").Where("id", res.List[i].MemberId).Value()
|
||||
// //if err != nil {
|
||||
// // err = gerror.Wrap(err, consts.ErrorORM)
|
||||
// // return nil, err
|
||||
// //}
|
||||
//}
|
||||
// 接口
|
||||
// ...
|
||||
|
||||
if list[i].MemberName == "" {
|
||||
list[i].MemberName = "游客"
|
||||
}
|
||||
|
||||
//// 获取省市编码对应的地区名称
|
||||
//region, err := dao.SysProvinces.GetRegion(ctx, list[i].ProvinceId, list[i].CityId)
|
||||
//if err != nil {
|
||||
// return list, totalCount, err
|
||||
//}
|
||||
//list[i].Region = region
|
||||
|
||||
// 截取请求url路径
|
||||
if gstr.Contains(list[i].Url, "?") {
|
||||
list[i].Url = gstr.StrTillEx(list[i].Url, "?")
|
||||
@@ -354,7 +341,6 @@ func (s *sSysLog) List(ctx context.Context, in *sysin.LogListInp) (list []*sysin
|
||||
]
|
||||
}`)
|
||||
}
|
||||
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ func (s *sSysLoginLog) List(ctx context.Context, in *sysin.LoginLogListInp) (lis
|
||||
return
|
||||
}
|
||||
|
||||
//关联表select
|
||||
// 关联表select
|
||||
fields, err := hgorm.GenJoinSelect(ctx, sysin.LoginLogListModel{}, &dao.SysLoginLog, []*hgorm.Join{
|
||||
{Dao: &dao.SysLog, Alias: "sysLog"},
|
||||
})
|
||||
@@ -98,12 +98,6 @@ func (s *sSysLoginLog) List(ctx context.Context, in *sysin.LoginLogListInp) (lis
|
||||
}
|
||||
|
||||
for _, v := range list {
|
||||
//// 获取省市编码对应的地区名称
|
||||
//region, err := location.ParseRegion(ctx, v.SysLogProvinceId, v.SysLogCityId, 0)
|
||||
//if err != nil {
|
||||
// return list, totalCount, err
|
||||
//}
|
||||
//v.Region = region
|
||||
v.Os = useragent.GetOs(v.SysLogUserAgent)
|
||||
v.Browser = useragent.GetBrowser(v.SysLogUserAgent)
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ func (s *sSysServeLog) List(ctx context.Context, in *sysin.ServeLogListInp) (lis
|
||||
return
|
||||
}
|
||||
|
||||
//关联表select
|
||||
// 关联表select
|
||||
fields, err := hgorm.GenJoinSelect(ctx, sysin.ServeLogListModel{}, &dao.SysServeLog, []*hgorm.Join{
|
||||
{Dao: &dao.SysLog, Alias: "sysLog"},
|
||||
})
|
||||
|
Reference in New Issue
Block a user