feat: 统一sql命名、函数命名

This commit is contained in:
2026-08-02 12:02:04 +08:00
parent d39342ce5f
commit 0e674e9d56
68 changed files with 1985 additions and 1720 deletions

View File

@@ -42,13 +42,13 @@ func (q *Queries) CreatePostTag(ctx context.Context, arg []CreatePostTagParams)
return q.db.CopyFrom(ctx, []string{"post_tag"}, []string{"post_id", "tag_id"}, &iteratorForCreatePostTag{rows: arg})
}
// iteratorForCreateSysRolePermission implements pgx.CopyFromSource.
type iteratorForCreateSysRolePermission struct {
rows []CreateSysRolePermissionParams
// iteratorForCreateRolePermission implements pgx.CopyFromSource.
type iteratorForCreateRolePermission struct {
rows []CreateRolePermissionParams
skippedFirstNextCall bool
}
func (r *iteratorForCreateSysRolePermission) Next() bool {
func (r *iteratorForCreateRolePermission) Next() bool {
if len(r.rows) == 0 {
return false
}
@@ -60,28 +60,28 @@ func (r *iteratorForCreateSysRolePermission) Next() bool {
return len(r.rows) > 0
}
func (r iteratorForCreateSysRolePermission) Values() ([]interface{}, error) {
func (r iteratorForCreateRolePermission) Values() ([]interface{}, error) {
return []interface{}{
r.rows[0].RoleID,
r.rows[0].PermissionID,
}, nil
}
func (r iteratorForCreateSysRolePermission) Err() error {
func (r iteratorForCreateRolePermission) Err() error {
return nil
}
func (q *Queries) CreateSysRolePermission(ctx context.Context, arg []CreateSysRolePermissionParams) (int64, error) {
return q.db.CopyFrom(ctx, []string{"sys_role_permission"}, []string{"role_id", "permission_id"}, &iteratorForCreateSysRolePermission{rows: arg})
func (q *Queries) CreateRolePermission(ctx context.Context, arg []CreateRolePermissionParams) (int64, error) {
return q.db.CopyFrom(ctx, []string{"sys_role_permission"}, []string{"role_id", "permission_id"}, &iteratorForCreateRolePermission{rows: arg})
}
// iteratorForCreateSysUserRole implements pgx.CopyFromSource.
type iteratorForCreateSysUserRole struct {
rows []CreateSysUserRoleParams
// iteratorForCreateUserRole implements pgx.CopyFromSource.
type iteratorForCreateUserRole struct {
rows []CreateUserRoleParams
skippedFirstNextCall bool
}
func (r *iteratorForCreateSysUserRole) Next() bool {
func (r *iteratorForCreateUserRole) Next() bool {
if len(r.rows) == 0 {
return false
}
@@ -93,17 +93,17 @@ func (r *iteratorForCreateSysUserRole) Next() bool {
return len(r.rows) > 0
}
func (r iteratorForCreateSysUserRole) Values() ([]interface{}, error) {
func (r iteratorForCreateUserRole) Values() ([]interface{}, error) {
return []interface{}{
r.rows[0].UserID,
r.rows[0].RoleID,
}, nil
}
func (r iteratorForCreateSysUserRole) Err() error {
func (r iteratorForCreateUserRole) Err() error {
return nil
}
func (q *Queries) CreateSysUserRole(ctx context.Context, arg []CreateSysUserRoleParams) (int64, error) {
return q.db.CopyFrom(ctx, []string{"sys_user_role"}, []string{"user_id", "role_id"}, &iteratorForCreateSysUserRole{rows: arg})
func (q *Queries) CreateUserRole(ctx context.Context, arg []CreateUserRoleParams) (int64, error) {
return q.db.CopyFrom(ctx, []string{"sys_user_role"}, []string{"user_id", "role_id"}, &iteratorForCreateUserRole{rows: arg})
}