feat: 添加角色类型常量及用户主角色获取方法
This commit is contained in:
1 parent
c5977ce354
commit
20ad8115da
14 files changed
+123
-64
No files matched your search
@@ -55,7 +55,7 @@ func IDLTE(id int) predicate.Role {
|
||||
}
|
||||
|
||||
// Code applies equality check predicate on the "code" field. It's identical to CodeEQ.
|
||||
func Code(v string) predicate.Role {
|
||||
func Code(v int) predicate.Role {
|
||||
return predicate.Role(sql.FieldEQ(FieldCode, v))
|
||||
}
|
||||
|
||||
@@ -65,70 +65,45 @@ func Name(v string) predicate.Role {
|
||||
}
|
||||
|
||||
// CodeEQ applies the EQ predicate on the "code" field.
|
||||
func CodeEQ(v string) predicate.Role {
|
||||
func CodeEQ(v int) predicate.Role {
|
||||
return predicate.Role(sql.FieldEQ(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeNEQ applies the NEQ predicate on the "code" field.
|
||||
func CodeNEQ(v string) predicate.Role {
|
||||
func CodeNEQ(v int) predicate.Role {
|
||||
return predicate.Role(sql.FieldNEQ(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeIn applies the In predicate on the "code" field.
|
||||
func CodeIn(vs ...string) predicate.Role {
|
||||
func CodeIn(vs ...int) predicate.Role {
|
||||
return predicate.Role(sql.FieldIn(FieldCode, vs...))
|
||||
}
|
||||
|
||||
// CodeNotIn applies the NotIn predicate on the "code" field.
|
||||
func CodeNotIn(vs ...string) predicate.Role {
|
||||
func CodeNotIn(vs ...int) predicate.Role {
|
||||
return predicate.Role(sql.FieldNotIn(FieldCode, vs...))
|
||||
}
|
||||
|
||||
// CodeGT applies the GT predicate on the "code" field.
|
||||
func CodeGT(v string) predicate.Role {
|
||||
func CodeGT(v int) predicate.Role {
|
||||
return predicate.Role(sql.FieldGT(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeGTE applies the GTE predicate on the "code" field.
|
||||
func CodeGTE(v string) predicate.Role {
|
||||
func CodeGTE(v int) predicate.Role {
|
||||
return predicate.Role(sql.FieldGTE(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeLT applies the LT predicate on the "code" field.
|
||||
func CodeLT(v string) predicate.Role {
|
||||
func CodeLT(v int) predicate.Role {
|
||||
return predicate.Role(sql.FieldLT(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeLTE applies the LTE predicate on the "code" field.
|
||||
func CodeLTE(v string) predicate.Role {
|
||||
func CodeLTE(v int) predicate.Role {
|
||||
return predicate.Role(sql.FieldLTE(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeContains applies the Contains predicate on the "code" field.
|
||||
func CodeContains(v string) predicate.Role {
|
||||
return predicate.Role(sql.FieldContains(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeHasPrefix applies the HasPrefix predicate on the "code" field.
|
||||
func CodeHasPrefix(v string) predicate.Role {
|
||||
return predicate.Role(sql.FieldHasPrefix(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeHasSuffix applies the HasSuffix predicate on the "code" field.
|
||||
func CodeHasSuffix(v string) predicate.Role {
|
||||
return predicate.Role(sql.FieldHasSuffix(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeEqualFold applies the EqualFold predicate on the "code" field.
|
||||
func CodeEqualFold(v string) predicate.Role {
|
||||
return predicate.Role(sql.FieldEqualFold(FieldCode, v))
|
||||
}
|
||||
|
||||
// CodeContainsFold applies the ContainsFold predicate on the "code" field.
|
||||
func CodeContainsFold(v string) predicate.Role {
|
||||
return predicate.Role(sql.FieldContainsFold(FieldCode, v))
|
||||
}
|
||||
|
||||
// NameEQ applies the EQ predicate on the "name" field.
|
||||
func NameEQ(v string) predicate.Role {
|
||||
return predicate.Role(sql.FieldEQ(FieldName, v))
|
||||
|
||||
Reference in new issue
Block a user