提交 3260156f authored 作者: mooncake's avatar mooncake

整理代码

上级 0db6a4ac
...@@ -49,7 +49,7 @@ func ParseConf() (err error) { ...@@ -49,7 +49,7 @@ func ParseConf() (err error) {
if confType == "nacos" { if confType == "nacos" {
nacosConf() nacosConf()
nc := NewNacos(&Cfg.ConfCenter.Nacos, func(content []byte) (err error) { nc := NewNacos(&Cfg.ConfCenter.Nacos, func(content []byte) (err error) {
if bytes.Compare(content, Cfg.GetContent()) == 0 { if bytes.Equal(content, Cfg.GetContent()) {
return nil return nil
} }
Cfg.SetContent(content) Cfg.SetContent(content)
......
...@@ -12,7 +12,6 @@ import ( ...@@ -12,7 +12,6 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jinzhu/copier" "github.com/jinzhu/copier"
"github.com/spf13/cast"
"gitlab.wanzhuangkj.com/tush/xpkg/pkg/httpcli/entity" "gitlab.wanzhuangkj.com/tush/xpkg/pkg/httpcli/entity"
"gitlab.wanzhuangkj.com/tush/xpkg/pkg/logger" "gitlab.wanzhuangkj.com/tush/xpkg/pkg/logger"
merge "gitlab.wanzhuangkj.com/tush/xpkg/pkg/merger" merge "gitlab.wanzhuangkj.com/tush/xpkg/pkg/merger"
...@@ -184,14 +183,6 @@ func (x *webLogDao) CreateSlice(ctx context.Context, ors []*WebLog) error { ...@@ -184,14 +183,6 @@ func (x *webLogDao) CreateSlice(ctx context.Context, ors []*WebLog) error {
return x.db.WithContext(ctx).Create(ors).Error return x.db.WithContext(ctx).Create(ors).Error
} }
func getUserType(c *gin.Context) int {
val := c.Value(ctxUtils.KeyUType)
if val != nil {
return cast.ToInt(val)
}
return 0
}
type WebLog struct { type WebLog struct {
ID xsf.ID `json:"id" form:"id" swaggertype:"string" gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement;comment:主键" example:"1000"` //主键 ID xsf.ID `json:"id" form:"id" swaggertype:"string" gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement;comment:主键" example:"1000"` //主键
CompanyID xsf.ID `json:"companyID" form:"companyID" swaggertype:"string" gorm:"column:company_id;type:bigint(20) unsigned;comment:公司ID" example:"1008"` //公司ID CompanyID xsf.ID `json:"companyID" form:"companyID" swaggertype:"string" gorm:"column:company_id;type:bigint(20) unsigned;comment:公司ID" example:"1008"` //公司ID
......
...@@ -198,8 +198,12 @@ func pgSql(driver string, t *resolveSearchTag, condition Condition, qValue refle ...@@ -198,8 +198,12 @@ func pgSql(driver string, t *resolveSearchTag, condition Condition, qValue refle
return return
case JOIN: case JOIN:
//左关联 //左关联
// join := condition.SetJoinOn(t.Type, fmt.Sprintf(
// "left join %s on `%s`.`%s` = `%s`.`%s`", t.Join, t.Join, t.On[0], t.Table, t.On[1],
// ))
join := condition.SetJoinOn(t.Type, fmt.Sprintf( join := condition.SetJoinOn(t.Type, fmt.Sprintf(
"left join %s on %s.%s = %s.%s", t.Join, t.Join, t.On[0], t.Table, t.On[1], "%s",
t.Join,
)) ))
ResolveSearchQuery(driver, qValue.Field(i).Interface(), join, tname) ResolveSearchQuery(driver, qValue.Field(i).Interface(), join, tname)
return return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论