mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Move repository model into models/repo (#17933)
* Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
This commit is contained in:
		| @@ -7,7 +7,6 @@ package ldap | ||||
| import ( | ||||
| 	"strings" | ||||
|  | ||||
| 	"code.gitea.io/gitea/models" | ||||
| 	"code.gitea.io/gitea/models/login" | ||||
| 	"code.gitea.io/gitea/modules/json" | ||||
| 	"code.gitea.io/gitea/modules/secret" | ||||
| @@ -62,7 +61,7 @@ type Source struct { | ||||
|  | ||||
| // FromDB fills up a LDAPConfig from serialized format. | ||||
| func (source *Source) FromDB(bs []byte) error { | ||||
| 	err := models.JSONUnmarshalHandleDoubleEncode(bs, &source) | ||||
| 	err := json.UnmarshalHandleDoubleEncode(bs, &source) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|   | ||||
| @@ -5,7 +5,6 @@ | ||||
| package oauth2 | ||||
|  | ||||
| import ( | ||||
| 	"code.gitea.io/gitea/models" | ||||
| 	"code.gitea.io/gitea/models/login" | ||||
| 	"code.gitea.io/gitea/modules/json" | ||||
| ) | ||||
| @@ -33,7 +32,7 @@ type Source struct { | ||||
|  | ||||
| // FromDB fills up an OAuth2Config from serialized format. | ||||
| func (source *Source) FromDB(bs []byte) error { | ||||
| 	return models.JSONUnmarshalHandleDoubleEncode(bs, &source) | ||||
| 	return json.UnmarshalHandleDoubleEncode(bs, &source) | ||||
| } | ||||
|  | ||||
| // ToDB exports an SMTPConfig to a serialized format. | ||||
|   | ||||
| @@ -5,7 +5,6 @@ | ||||
| package pam | ||||
|  | ||||
| import ( | ||||
| 	"code.gitea.io/gitea/models" | ||||
| 	"code.gitea.io/gitea/models/login" | ||||
| 	"code.gitea.io/gitea/modules/json" | ||||
| ) | ||||
| @@ -29,7 +28,7 @@ type Source struct { | ||||
|  | ||||
| // FromDB fills up a PAMConfig from serialized format. | ||||
| func (source *Source) FromDB(bs []byte) error { | ||||
| 	return models.JSONUnmarshalHandleDoubleEncode(bs, &source) | ||||
| 	return json.UnmarshalHandleDoubleEncode(bs, &source) | ||||
| } | ||||
|  | ||||
| // ToDB exports a PAMConfig to a serialized format. | ||||
|   | ||||
| @@ -5,7 +5,6 @@ | ||||
| package smtp | ||||
|  | ||||
| import ( | ||||
| 	"code.gitea.io/gitea/models" | ||||
| 	"code.gitea.io/gitea/models/login" | ||||
| 	"code.gitea.io/gitea/modules/json" | ||||
| ) | ||||
| @@ -35,7 +34,7 @@ type Source struct { | ||||
|  | ||||
| // FromDB fills up an SMTPConfig from serialized format. | ||||
| func (source *Source) FromDB(bs []byte) error { | ||||
| 	return models.JSONUnmarshalHandleDoubleEncode(bs, &source) | ||||
| 	return json.UnmarshalHandleDoubleEncode(bs, &source) | ||||
| } | ||||
|  | ||||
| // ToDB exports an SMTPConfig to a serialized format. | ||||
|   | ||||
| @@ -5,7 +5,6 @@ | ||||
| package sspi | ||||
|  | ||||
| import ( | ||||
| 	"code.gitea.io/gitea/models" | ||||
| 	"code.gitea.io/gitea/models/login" | ||||
| 	"code.gitea.io/gitea/modules/json" | ||||
| ) | ||||
| @@ -28,7 +27,7 @@ type Source struct { | ||||
|  | ||||
| // FromDB fills up an SSPIConfig from serialized format. | ||||
| func (cfg *Source) FromDB(bs []byte) error { | ||||
| 	return models.JSONUnmarshalHandleDoubleEncode(bs, &cfg) | ||||
| 	return json.UnmarshalHandleDoubleEncode(bs, &cfg) | ||||
| } | ||||
|  | ||||
| // ToDB exports an SSPIConfig to a serialized format. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user