1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

[F3] upgrade to gof3 50a6e740ac04

Add new methods GetIDString() & SetIDString() & ToFormatInterface()
Change the prototype of the fixture function
This commit is contained in:
Earl Warren 2023-06-28 15:57:57 +02:00
parent 4446e9f98a
commit d7b263ff8b
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
16 changed files with 154 additions and 4 deletions

View file

@ -29,10 +29,18 @@ func (o User) GetID() int64 {
return o.ID
}
func (o User) GetIDString() string {
return fmt.Sprintf("%d", o.GetID())
}
func (o *User) SetID(id int64) {
o.ID = id
}
func (o *User) SetIDString(id string) {
o.SetID(f3_util.ParseInt(id))
}
func (o *User) IsNil() bool {
return o.ID == 0
}
@ -41,6 +49,10 @@ func (o *User) Equals(other *User) bool {
return (o.Name == other.Name)
}
func (o *User) ToFormatInterface() format.Interface {
return o.ToFormat()
}
func (o *User) ToFormat() *format.User {
return &format.User{
Common: format.NewCommon(o.ID),