feat: update article & category host for url
This commit is contained in:
parent
af72ce00b6
commit
836ce563a5
|
|
@ -65,9 +65,9 @@ func (_i *articleCategoriesService) All(req request.ArticleCategoriesQueryReques
|
||||||
}
|
}
|
||||||
|
|
||||||
host := _i.Cfg.App.Domain
|
host := _i.Cfg.App.Domain
|
||||||
port := _i.Cfg.App.ExternalPort
|
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
articleCategoriess = append(articleCategoriess, mapper.ArticleCategoriesResponseMapper(result, host+port))
|
articleCategoriess = append(articleCategoriess, mapper.ArticleCategoriesResponseMapper(result, host))
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
@ -79,8 +79,7 @@ func (_i *articleCategoriesService) Show(id uint) (articleCategories *response.A
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
host := _i.Cfg.App.Domain
|
host := _i.Cfg.App.Domain
|
||||||
port := _i.Cfg.App.ExternalPort
|
return mapper.ArticleCategoriesResponseMapper(result, host), nil
|
||||||
return mapper.ArticleCategoriesResponseMapper(result, host+port), nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_i *articleCategoriesService) Save(req request.ArticleCategoriesCreateRequest, authToken string) (articleCategories *entity.ArticleCategories, err error) {
|
func (_i *articleCategoriesService) Save(req request.ArticleCategoriesCreateRequest, authToken string) (articleCategories *entity.ArticleCategories, err error) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ func ArticlesResponseMapper(
|
||||||
var articleCategoriesArr []*articleCategoriesResponse.ArticleCategoriesResponse
|
var articleCategoriesArr []*articleCategoriesResponse.ArticleCategoriesResponse
|
||||||
if articleCategories != nil && len(articleCategories) > 0 {
|
if articleCategories != nil && len(articleCategories) > 0 {
|
||||||
for _, result := range articleCategories {
|
for _, result := range articleCategories {
|
||||||
articleCategoriesArr = append(articleCategoriesArr, articleCategoriesMapper.ArticleCategoriesResponseMapper(result.Category, ""))
|
articleCategoriesArr = append(articleCategoriesArr, articleCategoriesMapper.ArticleCategoriesResponseMapper(result.Category, host))
|
||||||
}
|
}
|
||||||
log.Info().Interface("articleCategoriesArr", articleCategoriesArr).Msg("")
|
log.Info().Interface("articleCategoriesArr", articleCategoriesArr).Msg("")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,10 +89,9 @@ func (_i *articlesService) All(req request.ArticlesQueryRequest) (articless []*r
|
||||||
Interface("results", results).Msg("")
|
Interface("results", results).Msg("")
|
||||||
|
|
||||||
host := _i.Cfg.App.Domain
|
host := _i.Cfg.App.Domain
|
||||||
port := _i.Cfg.App.ExternalPort
|
|
||||||
|
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
articleRes := mapper.ArticlesResponseMapper(_i.Log, host+port, result, _i.ArticleCategoriesRepo, _i.ArticleCategoryDetailsRepo, _i.ArticleFilesRepo, _i.UsersRepo)
|
articleRes := mapper.ArticlesResponseMapper(_i.Log, host, result, _i.ArticleCategoriesRepo, _i.ArticleCategoryDetailsRepo, _i.ArticleFilesRepo, _i.UsersRepo)
|
||||||
articless = append(articless, articleRes)
|
articless = append(articless, articleRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -106,9 +105,8 @@ func (_i *articlesService) Show(id uint) (articles *response.ArticlesResponse, e
|
||||||
}
|
}
|
||||||
|
|
||||||
host := _i.Cfg.App.Domain
|
host := _i.Cfg.App.Domain
|
||||||
port := _i.Cfg.App.ExternalPort
|
|
||||||
|
|
||||||
return mapper.ArticlesResponseMapper(_i.Log, host+port, result, _i.ArticleCategoriesRepo, _i.ArticleCategoryDetailsRepo, _i.ArticleFilesRepo, _i.UsersRepo), nil
|
return mapper.ArticlesResponseMapper(_i.Log, host, result, _i.ArticleCategoriesRepo, _i.ArticleCategoryDetailsRepo, _i.ArticleFilesRepo, _i.UsersRepo), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_i *articlesService) Save(req request.ArticlesCreateRequest, authToken string) (articles *entity.Articles, err error) {
|
func (_i *articlesService) Save(req request.ArticlesCreateRequest, authToken string) (articles *entity.Articles, err error) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
name = "Fiber starter"
|
name = "Fiber starter"
|
||||||
host = "http://38.47.180.165"
|
host = "http://38.47.180.165"
|
||||||
port = ":8800"
|
port = ":8800"
|
||||||
domain = "http://38.47.180.165"
|
domain = "https://kontenhumas.com/api"
|
||||||
external-port = ":8802"
|
external-port = ":8802"
|
||||||
idle-timeout = 5 # As seconds
|
idle-timeout = 5 # As seconds
|
||||||
print-routes = false
|
print-routes = false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue