implemented mongo gridFS for file upload

This commit is contained in:
m.nazemi
2026-04-21 19:07:51 +03:30
parent 74d9269a19
commit 3aabd95b1c
16 changed files with 1941 additions and 17 deletions
+6
View File
@@ -24,6 +24,8 @@ type (
// Contact information
Phone *string `json:"phone,omitempty" valid:"optional,length(10|20)" example:"+1234567890"`
Email *string `json:"email,omitempty" valid:"optional,email" example:"info@opplens.com"`
// GridFS document references (uploaded via /api/v1/files/upload or /admin/v1/files/upload)
DocumentFileIDs []string `json:"document_file_ids,omitempty" valid:"optional"`
// Tags for categorization and search
Tags *CompanyTagsForm `json:"tags,omitempty"`
@@ -122,6 +124,7 @@ type (
Address *Address `json:"address,omitempty"`
Phone *string `json:"phone,omitempty"`
Email *string `json:"email,omitempty"`
DocumentFileIDs []string `json:"document_file_ids,omitempty"`
Tags *CompanyTagsResponse `json:"tags,omitempty"`
IsVerified bool `json:"is_verified"`
IsCompliant bool `json:"is_compliant"`
@@ -160,6 +163,7 @@ func (c *Company) ToResponse(categories []*CategoryResponse) *CompanyResponse {
Address: c.Address,
Phone: c.Phone,
Email: c.Email,
DocumentFileIDs: c.DocumentFileIDs,
Tags: c.Tags.ToResponse(categories),
IsVerified: c.IsVerified,
IsCompliant: c.IsCompliant,
@@ -189,6 +193,7 @@ type CompanyProfileResponse struct {
RegistrationNumber string `json:"registration_number"`
Industry string `json:"industry"`
FoundedYear *int `json:"founded_year,omitempty"`
DocumentFileIDs []string `json:"document_file_ids,omitempty"`
CreatedAt int64 `json:"created_at"`
}
@@ -200,6 +205,7 @@ func (c *Company) ToProfileResponse() *CompanyProfileResponse {
RegistrationNumber: c.RegistrationNumber,
Industry: c.Industry,
FoundedYear: c.FoundedYear,
DocumentFileIDs: c.DocumentFileIDs,
CreatedAt: c.CreatedAt,
}
}