feat: update fixing json request to camelCase, update db
This commit is contained in:
parent
f1b49d0c63
commit
cd3ac6d340
|
|
@ -11,16 +11,16 @@ type ArticleCategoryDetailsGeneric interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArticleCategoryDetailsQueryRequest struct {
|
type ArticleCategoryDetailsQueryRequest struct {
|
||||||
ArticleId int `json:"article_id" validate:"required"`
|
ArticleId int `json:"articleId" validate:"required"`
|
||||||
CategoryId int `json:"category_id" validate:"required"`
|
CategoryId int `json:"categoryId" validate:"required"`
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
IsActive bool `json:"isActive" validate:"required"`
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArticleCategoryDetailsCreateRequest struct {
|
type ArticleCategoryDetailsCreateRequest struct {
|
||||||
ArticleId uint `json:"article_id" validate:"required"`
|
ArticleId uint `json:"articleId" validate:"required"`
|
||||||
CategoryId int `json:"category_id" validate:"required"`
|
CategoryId int `json:"categoryId" validate:"required"`
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
IsActive bool `json:"isActive" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req ArticleCategoryDetailsCreateRequest) ToEntity() *article_category_details.ArticleCategoryDetails {
|
func (req ArticleCategoryDetailsCreateRequest) ToEntity() *article_category_details.ArticleCategoryDetails {
|
||||||
|
|
@ -33,11 +33,11 @@ func (req ArticleCategoryDetailsCreateRequest) ToEntity() *article_category_deta
|
||||||
|
|
||||||
type ArticleCategoryDetailsUpdateRequest struct {
|
type ArticleCategoryDetailsUpdateRequest struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
ArticleId uint `json:"article_id" validate:"required"`
|
ArticleId uint `json:"articleId" validate:"required"`
|
||||||
CategoryId int `json:"category_id" validate:"required"`
|
CategoryId int `json:"categoryId" validate:"required"`
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
IsActive bool `json:"isActive" validate:"required"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req ArticleCategoryDetailsUpdateRequest) ToEntity() *article_category_details.ArticleCategoryDetails {
|
func (req ArticleCategoryDetailsUpdateRequest) ToEntity() *article_category_details.ArticleCategoryDetails {
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import "time"
|
||||||
|
|
||||||
type ArticleCategoryDetailsResponse struct {
|
type ArticleCategoryDetailsResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
ArticleId uint `json:"article_id"`
|
ArticleId uint `json:"articleId"`
|
||||||
CategoryId int `json:"category_id"`
|
CategoryId int `json:"categoryId"`
|
||||||
IsActive bool `json:"is_active"`
|
IsActive bool `json:"isActive"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,21 +4,21 @@ import "time"
|
||||||
|
|
||||||
type ArticleFilesResponse struct {
|
type ArticleFilesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
ArticleId uint `json:"article_id"`
|
ArticleId uint `json:"articleId"`
|
||||||
FilePath *string `json:"file_path"`
|
FilePath *string `json:"filePath"`
|
||||||
FileUrl *string `json:"file_url"`
|
FileUrl *string `json:"fileUrl"`
|
||||||
FileName *string `json:"file_name"`
|
FileName *string `json:"fileName"`
|
||||||
FileThumbnail *string `json:"file_thumbnail"`
|
FileThumbnail *string `json:"fileThumbnail"`
|
||||||
FileAlt *string `json:"file_alt"`
|
FileAlt *string `json:"fileAlt"`
|
||||||
WidthPixel *string `json:"width_pixel"`
|
WidthPixel *string `json:"widthPixel"`
|
||||||
HeightPixel *string `json:"height_pixel"`
|
HeightPixel *string `json:"heightPixel"`
|
||||||
Size *string `json:"size"`
|
Size *string `json:"size"`
|
||||||
DownloadCount *int `json:"download_count"`
|
DownloadCount *int `json:"downloadCount"`
|
||||||
CreatedById int `json:"created_by_id"`
|
CreatedById int `json:"createdById"`
|
||||||
StatusId int `json:"status_id"`
|
StatusId int `json:"statusId"`
|
||||||
IsPublish *bool `json:"is_publish"`
|
IsPublish *bool `json:"isPublish"`
|
||||||
PublishedAt *time.Time `json:"published_at"`
|
PublishedAt *time.Time `json:"publishedAt"`
|
||||||
IsActive bool `json:"is_active"`
|
IsActive bool `json:"isActive"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,16 @@ import (
|
||||||
|
|
||||||
// Chat History Sessions Request DTOs
|
// Chat History Sessions Request DTOs
|
||||||
type ChatHistorySessionsQueryRequest struct {
|
type ChatHistorySessionsQueryRequest struct {
|
||||||
UserID *uint `json:"user_id"`
|
UserID *uint `json:"userId"`
|
||||||
AgentID *string `json:"agent_id"`
|
AgentID *string `json:"agentId"`
|
||||||
SessionID *string `json:"session_id"`
|
SessionID *string `json:"sessionId"`
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatHistorySessionsCreateRequest struct {
|
type ChatHistorySessionsCreateRequest struct {
|
||||||
UserID uint `json:"user_id" validate:"required"`
|
UserID uint `json:"userId" validate:"required"`
|
||||||
AgentID string `json:"agent_id" validate:"required"`
|
AgentID string `json:"agentId" validate:"required"`
|
||||||
SessionID string `json:"session_id" validate:"required"`
|
SessionID string `json:"sessionId" validate:"required"`
|
||||||
Title *string `json:"title"`
|
Title *string `json:"title"`
|
||||||
Messages []ChatMessageRequest `json:"messages"`
|
Messages []ChatMessageRequest `json:"messages"`
|
||||||
}
|
}
|
||||||
|
|
@ -62,13 +62,13 @@ func (req ChatHistorySessionsUpdateRequest) ToEntity() *entity.ChatSessions {
|
||||||
|
|
||||||
// Chat History Messages Request DTOs
|
// Chat History Messages Request DTOs
|
||||||
type ChatHistoryMessagesQueryRequest struct {
|
type ChatHistoryMessagesQueryRequest struct {
|
||||||
SessionID string `json:"session_id" validate:"required"`
|
SessionID string `json:"sessionId" validate:"required"`
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatHistoryMessagesCreateRequest struct {
|
type ChatHistoryMessagesCreateRequest struct {
|
||||||
SessionID string `json:"session_id" validate:"required"`
|
SessionID string `json:"sessionId" validate:"required"`
|
||||||
MessageType string `json:"message_type" validate:"required,oneof=user assistant"`
|
MessageType string `json:"messageType" validate:"required,oneof=user assistant"`
|
||||||
Content string `json:"content" validate:"required"`
|
Content string `json:"content" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,9 +92,9 @@ func (req ChatHistoryMessagesUpdateRequest) ToEntity() *entity.ChatMessagesNew {
|
||||||
|
|
||||||
// Context Request DTOs for query parameters
|
// Context Request DTOs for query parameters
|
||||||
type ChatHistorySessionsQueryRequestContext struct {
|
type ChatHistorySessionsQueryRequestContext struct {
|
||||||
UserID string `json:"user_id"`
|
UserID string `json:"userId"`
|
||||||
AgentID string `json:"agent_id"`
|
AgentID string `json:"agentId"`
|
||||||
SessionID string `json:"session_id"`
|
SessionID string `json:"sessionId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req ChatHistorySessionsQueryRequestContext) ToParamRequest() ChatHistorySessionsQueryRequest {
|
func (req ChatHistorySessionsQueryRequestContext) ToParamRequest() ChatHistorySessionsQueryRequest {
|
||||||
|
|
@ -117,7 +117,7 @@ func (req ChatHistorySessionsQueryRequestContext) ToParamRequest() ChatHistorySe
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatHistoryMessagesQueryRequestContext struct {
|
type ChatHistoryMessagesQueryRequestContext struct {
|
||||||
SessionID string `json:"session_id"`
|
SessionID string `json:"sessionId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req ChatHistoryMessagesQueryRequestContext) ToParamRequest() ChatHistoryMessagesQueryRequest {
|
func (req ChatHistoryMessagesQueryRequestContext) ToParamRequest() ChatHistoryMessagesQueryRequest {
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,23 @@ import (
|
||||||
// Chat History Sessions Response DTOs
|
// Chat History Sessions Response DTOs
|
||||||
type ChatHistorySessionsResponse struct {
|
type ChatHistorySessionsResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
SessionID string `json:"session_id"`
|
SessionID string `json:"sessionId"`
|
||||||
UserID uint `json:"user_id"`
|
UserID uint `json:"userId"`
|
||||||
AgentID string `json:"agent_id"`
|
AgentID string `json:"agentId"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
MessageCount int `json:"message_count"`
|
MessageCount int `json:"messageCount"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chat History Messages Response DTOs
|
// Chat History Messages Response DTOs
|
||||||
type ChatHistoryMessagesResponse struct {
|
type ChatHistoryMessagesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
SessionID string `json:"session_id"`
|
SessionID string `json:"sessionId"`
|
||||||
MessageType string `json:"message_type"`
|
MessageType string `json:"messageType"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combined Response for Session with Messages
|
// Combined Response for Session with Messages
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@ type CitiesGeneric interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CitiesQueryRequest struct {
|
type CitiesQueryRequest struct {
|
||||||
CityName string `json:"city_name" validate:"required"`
|
CityName string `json:"cityName" validate:"required"`
|
||||||
ProvId int `json:"prov_id" validate:"required"`
|
ProvId int `json:"provId" validate:"required"`
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CitiesCreateRequest struct {
|
type CitiesCreateRequest struct {
|
||||||
CityName string `json:"city_name" validate:"required"`
|
CityName string `json:"cityName" validate:"required"`
|
||||||
ProvId int `json:"prov_id" validate:"required"`
|
ProvId int `json:"provId" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req CitiesCreateRequest) ToEntity() *entity.Cities {
|
func (req CitiesCreateRequest) ToEntity() *entity.Cities {
|
||||||
|
|
@ -29,8 +29,8 @@ func (req CitiesCreateRequest) ToEntity() *entity.Cities {
|
||||||
|
|
||||||
type CitiesUpdateRequest struct {
|
type CitiesUpdateRequest struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
CityName string `json:"city_name" validate:"required"`
|
CityName string `json:"cityName" validate:"required"`
|
||||||
ProvId int `json:"prov_id" validate:"required"`
|
ProvId int `json:"provId" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req CitiesUpdateRequest) ToEntity() *entity.Cities {
|
func (req CitiesUpdateRequest) ToEntity() *entity.Cities {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@ package response
|
||||||
|
|
||||||
type CitiesResponse struct {
|
type CitiesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
CityName string `json:"city_name"`
|
CityName string `json:"cityName"`
|
||||||
ProvId int `json:"prov_id"`
|
ProvId int `json:"provId"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ type CustomStaticPagesUpdateRequest struct {
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Slug string `json:"slug" validate:"required"`
|
Slug string `json:"slug" validate:"required"`
|
||||||
HtmlBody string `json:"htmlBody" validate:"required"`
|
HtmlBody string `json:"htmlBody" validate:"required"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req CustomStaticPagesUpdateRequest) ToEntity() *entity.CustomStaticPages {
|
func (req CustomStaticPagesUpdateRequest) ToEntity() *entity.CustomStaticPages {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@ package response
|
||||||
|
|
||||||
type DistrictsResponse struct {
|
type DistrictsResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
DisNam string `json:"dis_nam"`
|
DisNam string `json:"disNam"`
|
||||||
CityId int `json:"city_id"`
|
CityId int `json:"cityId"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ type MasterMenusResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
ModuleId int `json:"module_id"`
|
ModuleId int `json:"moduleId"`
|
||||||
ParentMenuId *int `json:"parent_menu_id"`
|
ParentMenuId *int `json:"parentMenuId"`
|
||||||
Icon *string `json:"icon"`
|
Icon *string `json:"icon"`
|
||||||
Position *int `json:"position"`
|
Position *int `json:"position"`
|
||||||
StatusId int `json:"status_id"`
|
StatusId int `json:"statusId"`
|
||||||
IsActive *bool `json:"is_active"`
|
IsActive *bool `json:"isActive"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ type MasterModulesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
PathUrl string `json:"path_url"`
|
PathUrl string `json:"pathUrl"`
|
||||||
StatusId int `json:"status_id"`
|
StatusId int `json:"statusId"`
|
||||||
IsActive *bool `json:"is_active"`
|
IsActive *bool `json:"isActive"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@ type MasterStatusesGeneric interface {
|
||||||
|
|
||||||
type MasterStatusesQueryRequest struct {
|
type MasterStatusesQueryRequest struct {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
IsActive bool `json:"isActive" validate:"required"`
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MasterStatusesCreateRequest struct {
|
type MasterStatusesCreateRequest struct {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
IsActive bool `json:"isActive" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req MasterStatusesCreateRequest) ToEntity() *entity.MasterStatuses {
|
func (req MasterStatusesCreateRequest) ToEntity() *entity.MasterStatuses {
|
||||||
|
|
@ -30,7 +30,7 @@ func (req MasterStatusesCreateRequest) ToEntity() *entity.MasterStatuses {
|
||||||
type MasterStatusesUpdateRequest struct {
|
type MasterStatusesUpdateRequest struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
IsActive bool `json:"isActive" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req MasterStatusesUpdateRequest) ToEntity() *entity.MasterStatuses {
|
func (req MasterStatusesUpdateRequest) ToEntity() *entity.MasterStatuses {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package response
|
package response
|
||||||
|
|
||||||
type MasterStatusesResponse struct {
|
type MasterStatusesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
IsActive bool `json:"is_active"`
|
IsActive bool `json:"isActive"`
|
||||||
}
|
}
|
||||||
|
|
@ -10,16 +10,16 @@ type ProvincesGeneric interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProvincesQueryRequest struct {
|
type ProvincesQueryRequest struct {
|
||||||
ProvName string `json:"prov_name" validate:"required"`
|
ProvName string `json:"provName" validate:"required"`
|
||||||
LocationId int `json:"location_id" validate:"required"`
|
LocationId int `json:"locationId" validate:"required"`
|
||||||
Status int `json:"status" validate:"required"`
|
Status int `json:"status" validate:"required"`
|
||||||
Timezone string `json:"timezone" validate:"required"`
|
Timezone string `json:"timezone" validate:"required"`
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProvincesCreateRequest struct {
|
type ProvincesCreateRequest struct {
|
||||||
ProvName string `json:"prov_name" validate:"required"`
|
ProvName string `json:"provName" validate:"required"`
|
||||||
LocationId int `json:"location_id" validate:"required"`
|
LocationId int `json:"locationId" validate:"required"`
|
||||||
Status int `json:"status" validate:"required"`
|
Status int `json:"status" validate:"required"`
|
||||||
Timezone string `json:"timezone" validate:"required"`
|
Timezone string `json:"timezone" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
@ -35,8 +35,8 @@ func (req ProvincesCreateRequest) ToEntity() *entity.Provinces {
|
||||||
|
|
||||||
type ProvincesUpdateRequest struct {
|
type ProvincesUpdateRequest struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
ProvName string `json:"prov_name" validate:"required"`
|
ProvName string `json:"provName" validate:"required"`
|
||||||
LocationId int `json:"location_id" validate:"required"`
|
LocationId int `json:"locationId" validate:"required"`
|
||||||
Status int `json:"status" validate:"required"`
|
Status int `json:"status" validate:"required"`
|
||||||
Timezone string `json:"timezone" validate:"required"`
|
Timezone string `json:"timezone" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ package response
|
||||||
|
|
||||||
type ProvincesResponse struct {
|
type ProvincesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
ProvName string `json:"prov_name"`
|
ProvName string `json:"provName"`
|
||||||
LocationId int `json:"location_id"`
|
LocationId int `json:"locationId"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
Timezone string `json:"timezone"`
|
Timezone string `json:"timezone"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,16 @@ package entity
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type UserRoleAccesses struct {
|
type UserRoleAccesses struct {
|
||||||
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
||||||
UserRoleId int `json:"user_role_id" gorm:"type:int4"`
|
UserRoleId int `json:"userRoleId" gorm:"type:int4"`
|
||||||
MenuId int `json:"menu_id" gorm:"type:int4"`
|
MenuId int `json:"menuId" gorm:"type:int4"`
|
||||||
IsViewEnabled bool `json:"is_view_enabled" gorm:"type:bool"`
|
IsViewEnabled bool `json:"isViewEnabled" gorm:"type:bool"`
|
||||||
IsInsertEnabled bool `json:"is_insert_enabled" gorm:"type:bool"`
|
IsInsertEnabled bool `json:"isInsertEnabled" gorm:"type:bool"`
|
||||||
IsUpdateEnabled bool `json:"is_update_enabled" gorm:"type:bool"`
|
IsUpdateEnabled bool `json:"isUpdateEnabled" gorm:"type:bool"`
|
||||||
IsDeleteEnabled bool `json:"is_delete_enabled" gorm:"type:bool"`
|
IsDeleteEnabled bool `json:"isDeleteEnabled" gorm:"type:bool"`
|
||||||
IsApprovalEnabled bool `json:"is_approval_enabled" gorm:"type:bool"`
|
IsApprovalEnabled bool `json:"isApprovalEnabled" gorm:"type:bool"`
|
||||||
IsAdminEnabled bool `json:"is_admin_enabled" gorm:"type:bool"`
|
IsAdminEnabled bool `json:"isAdminEnabled" gorm:"type:bool"`
|
||||||
IsActive bool `json:"is_active" gorm:"type:bool"`
|
IsActive bool `json:"isActive" gorm:"type:bool"`
|
||||||
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
CreatedAt time.Time `json:"createdAt" gorm:"default:now()"`
|
||||||
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
UpdatedAt time.Time `json:"updatedAt" gorm:"default:now()"`
|
||||||
}
|
}
|
||||||
|
|
@ -42,14 +42,14 @@ func (req UserRoleAccessesCreateRequest) ToEntity() *entity.UserRoleAccesses {
|
||||||
|
|
||||||
type UserRoleAccessesUpdateRequest struct {
|
type UserRoleAccessesUpdateRequest struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
UserRoleId uint `json:"user_role_id" validate:"required"`
|
UserRoleId uint `json:"userRoleId" validate:"required"`
|
||||||
MenuId int `json:"menu_id" validate:"required"`
|
MenuId int `json:"menuId" validate:"required"`
|
||||||
IsViewEnabled bool `json:"is_view_enabled" validate:"required"`
|
IsViewEnabled bool `json:"isViewEnabled" validate:"required"`
|
||||||
IsInsertEnabled bool `json:"is_insert_enabled" validate:"required"`
|
IsInsertEnabled bool `json:"isInsertEnabled" validate:"required"`
|
||||||
IsUpdateEnabled bool `json:"is_update_enabled" validate:"required"`
|
IsUpdateEnabled bool `json:"isUpdateEnabled" validate:"required"`
|
||||||
IsDeleteEnabled bool `json:"is_delete_enabled" validate:"required"`
|
IsDeleteEnabled bool `json:"isDeleteEnabled" validate:"required"`
|
||||||
IsApprovalEnabled bool `json:"is_approval_enabled" validate:"required"`
|
IsApprovalEnabled bool `json:"isApprovalEnabled" validate:"required"`
|
||||||
IsAdminEnabled bool `json:"is_admin_enabled" validate:"required"`
|
IsAdminEnabled bool `json:"isAdminEnabled" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req UserRoleAccessesUpdateRequest) ToEntity() *entity.UserRoleAccesses {
|
func (req UserRoleAccessesUpdateRequest) ToEntity() *entity.UserRoleAccesses {
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,15 @@ import "time"
|
||||||
|
|
||||||
type UserRoleAccessesResponse struct {
|
type UserRoleAccessesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
UserRoleId uint `json:"user_role_id"`
|
UserRoleId uint `json:"userRoleId"`
|
||||||
MenuId int `json:"menu_id"`
|
MenuId int `json:"menuId"`
|
||||||
IsViewEnabled bool `json:"is_view_enabled"`
|
IsViewEnabled bool `json:"isViewEnabled"`
|
||||||
IsInsertEnabled bool `json:"is_insert_enabled"`
|
IsInsertEnabled bool `json:"isInsertEnabled"`
|
||||||
IsUpdateEnabled bool `json:"is_update_enabled"`
|
IsUpdateEnabled bool `json:"isUpdateEnabled"`
|
||||||
IsDeleteEnabled bool `json:"is_delete_enabled"`
|
IsDeleteEnabled bool `json:"isDeleteEnabled"`
|
||||||
IsApprovalEnabled bool `json:"is_approval_enabled"`
|
IsApprovalEnabled bool `json:"isApprovalEnabled"`
|
||||||
IsAdminEnabled bool `json:"is_admin_enabled"`
|
IsAdminEnabled bool `json:"isAdminEnabled"`
|
||||||
IsActive *bool `json:"is_active"`
|
IsActive *bool `json:"isActive"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,15 +11,15 @@ type UserRoleLevelDetailsGeneric interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserRoleLevelDetailsQueryRequest struct {
|
type UserRoleLevelDetailsQueryRequest struct {
|
||||||
UserRoleId uint `json:"user_role_id" validate:"required"`
|
UserRoleId uint `json:"userRoleId" validate:"required"`
|
||||||
UserLevelId uint `json:"user_level_id" validate:"required"`
|
UserLevelId uint `json:"userLevelId" validate:"required"`
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserRoleLevelDetailsCreateRequest struct {
|
type UserRoleLevelDetailsCreateRequest struct {
|
||||||
UserRoleId uint `json:"user_role_id" validate:"required"`
|
UserRoleId uint `json:"userRoleId" validate:"required"`
|
||||||
UserLevelId uint `json:"user_level_id" validate:"required"`
|
UserLevelId uint `json:"userLevelId" validate:"required"`
|
||||||
IsActive *bool `json:"is_active" validate:"required"`
|
IsActive *bool `json:"isActive" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req UserRoleLevelDetailsCreateRequest) ToEntity() *entity.UserRoleLevelDetails {
|
func (req UserRoleLevelDetailsCreateRequest) ToEntity() *entity.UserRoleLevelDetails {
|
||||||
|
|
@ -32,11 +32,11 @@ func (req UserRoleLevelDetailsCreateRequest) ToEntity() *entity.UserRoleLevelDet
|
||||||
|
|
||||||
type UserRoleLevelDetailsUpdateRequest struct {
|
type UserRoleLevelDetailsUpdateRequest struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
ID uint `json:"id" validate:"required"`
|
||||||
UserRoleId uint `json:"user_role_id" validate:"required"`
|
UserRoleId uint `json:"userRoleId" validate:"required"`
|
||||||
UserLevelId uint `json:"user_level_id" validate:"required"`
|
UserLevelId uint `json:"userLevelId" validate:"required"`
|
||||||
IsActive *bool `json:"is_active" validate:"required"`
|
IsActive *bool `json:"isActive" validate:"required"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req UserRoleLevelDetailsUpdateRequest) ToEntity() *entity.UserRoleLevelDetails {
|
func (req UserRoleLevelDetailsUpdateRequest) ToEntity() *entity.UserRoleLevelDetails {
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import "time"
|
||||||
|
|
||||||
type UserRoleLevelDetailsResponse struct {
|
type UserRoleLevelDetailsResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
UserRoleId uint `json:"user_role_id"`
|
UserRoleId uint `json:"userRoleId"`
|
||||||
UserLevelId uint `json:"user_level_id"`
|
UserLevelId uint `json:"userLevelId"`
|
||||||
IsActive *bool `json:"is_active"`
|
IsActive *bool `json:"isActive"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ type UserRolesUpdateRequest struct {
|
||||||
Name string `json:"name" validate:"required"`
|
Name string `json:"name" validate:"required"`
|
||||||
Description string `json:"description" validate:"required"`
|
Description string `json:"description" validate:"required"`
|
||||||
Code string `json:"code" validate:"required"`
|
Code string `json:"code" validate:"required"`
|
||||||
LevelNumber int `json:"level_number" validate:"required"`
|
LevelNumber int `json:"levelNumber" validate:"required"`
|
||||||
UserLevelIds []uint `json:"userLevelIds" validate:"required"`
|
UserLevelIds []uint `json:"userLevelIds" validate:"required"`
|
||||||
StatusId int `json:"status_id" validate:"required"`
|
StatusId int `json:"statusId" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req UserRolesUpdateRequest) ToEntity() *entity.UserRoles {
|
func (req UserRolesUpdateRequest) ToEntity() *entity.UserRoles {
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ type UserRolesResponse struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
UserLevelId uint `json:"user_level_id"`
|
UserLevelId uint `json:"userLevelId"`
|
||||||
StatusId int `json:"status_id"`
|
StatusId int `json:"statusId"`
|
||||||
CreatedById *uint `json:"created_by_id"`
|
CreatedById *uint `json:"createdById"`
|
||||||
IsActive *bool `json:"is_active"`
|
IsActive *bool `json:"isActive"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
name = "Fiber starter"
|
name = "Fiber starter"
|
||||||
host = "http://38.47.180.165"
|
host = "http://38.47.180.165"
|
||||||
port = ":8800"
|
port = ":8800"
|
||||||
domain = "https://dev.mikulnews.com/api"
|
domain = "https://narasiahli.com/api"
|
||||||
external-port = ":8802"
|
external-port = ":8801"
|
||||||
idle-timeout = 5 # As seconds
|
idle-timeout = 5 # As seconds
|
||||||
print-routes = false
|
print-routes = false
|
||||||
prefork = true
|
prefork = true
|
||||||
|
|
@ -12,7 +12,7 @@ production = false
|
||||||
body-limit = 1048576000 # "100 * 1024 * 1024"
|
body-limit = 1048576000 # "100 * 1024 * 1024"
|
||||||
|
|
||||||
[db.postgres]
|
[db.postgres]
|
||||||
dsn = "postgresql://medols_user:MedolsDB@2025@38.47.180.165:5432/medols_db" # <driver>://<username>:<password>@<host>:<port>/<database>
|
dsn = "postgresql://narasiahli_user:NarasiAhliDB@2025@38.47.180.165:5432/narasiahli_db" # <driver>://<username>:<password>@<host>:<port>/<database>
|
||||||
log-mode = "NONE"
|
log-mode = "NONE"
|
||||||
migrate = true
|
migrate = true
|
||||||
seed = true
|
seed = true
|
||||||
|
|
@ -28,7 +28,7 @@ endpoint = "38.47.180.165:9009"
|
||||||
access-key-id = "lBtjqWidHz1ktBbduwGy"
|
access-key-id = "lBtjqWidHz1ktBbduwGy"
|
||||||
secret-access-key = "nsedJIa2FI7SqsEVcSFqJrlP4JuFRWGLauNpzD0i"
|
secret-access-key = "nsedJIa2FI7SqsEVcSFqJrlP4JuFRWGLauNpzD0i"
|
||||||
use-ssl = false
|
use-ssl = false
|
||||||
bucket-name = "mikulnews"
|
bucket-name = "narasiahli"
|
||||||
location = "us-east-1"
|
location = "us-east-1"
|
||||||
|
|
||||||
[middleware.compress]
|
[middleware.compress]
|
||||||
|
|
@ -67,9 +67,9 @@ retention = 30
|
||||||
|
|
||||||
[keycloak]
|
[keycloak]
|
||||||
endpoint = "http://38.47.180.165:8008"
|
endpoint = "http://38.47.180.165:8008"
|
||||||
realm = "medols"
|
realm = "narasi-ahli"
|
||||||
client-id = "medols-app"
|
client-id = "narasi-ahli-app"
|
||||||
client-secret = "iyonEpZbAUs20quwaNFLMwRX7MUgPRlS"
|
client-secret = "IoU4CkzWkWmg6PrC2Ruh8d76QArb0UzJ"
|
||||||
admin-username = "developer-admin"
|
admin-username = "developer-admin"
|
||||||
admin-password = "P@ssw0rd.1"
|
admin-password = "P@ssw0rd.1"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue