c572fcfe04
Rename the Go module path from code.gitea.io/gitea to git.mokoconsulting.tech/MokoConsulting/MokoGitea across the entire codebase. Scope: - go.mod module declaration - 2,235 Go source files (import paths) - Dockerfile WORKDIR and COPY paths - Swagger API templates - golangci.yml linter config External dependencies (code.gitea.io/gitea-vet, code.gitea.io/sdk/gitea, gitea.com/gitea/act, etc.) are intentionally NOT renamed — they are separate upstream modules. Closes #132 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package convert
|
|
|
|
import (
|
|
project_model "git.mokoconsulting.tech/MokoConsulting/MokoGitea/models/project"
|
|
api "git.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/structs"
|
|
)
|
|
|
|
// ToAPIProject converts a Project to API format
|
|
func ToAPIProject(p *project_model.Project) *api.Project {
|
|
apiProject := &api.Project{
|
|
ID: p.ID,
|
|
Title: p.Title,
|
|
Description: p.Description,
|
|
OwnerID: p.OwnerID,
|
|
RepoID: p.RepoID,
|
|
CreatorID: p.CreatorID,
|
|
IsClosed: p.IsClosed,
|
|
Created: p.CreatedUnix.AsTime(),
|
|
Updated: p.UpdatedUnix.AsTime(),
|
|
}
|
|
if p.IsClosed && p.ClosedDateUnix > 0 {
|
|
apiProject.Closed = p.ClosedDateUnix.AsTimePtr()
|
|
}
|
|
return apiProject
|
|
}
|
|
|
|
// ToAPIProjectList converts a list of Projects to API format
|
|
func ToAPIProjectList(projects []*project_model.Project) []*api.Project {
|
|
result := make([]*api.Project, len(projects))
|
|
for i := range projects {
|
|
result[i] = ToAPIProject(projects[i])
|
|
}
|
|
return result
|
|
}
|