切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-gateway
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
yangfu
3 years ago
提交
615d31bdd2ce59bcb9b60811dab96a78ba53eb39
1 个父辈
90e723c7
版本更新优化
显示空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
24 行增加
和
83 行删除
deploy/k8s/dev/allied-creation-gateway.yaml
deploy/k8s/test/allied-creation-gateway.yaml
pkg/application/common/query/get_latest_versionInfo_query.go
pkg/application/common/service/service.go
pkg/constant/common.go
pkg/infrastructure/service_gateway/version_server/httplib_version_serve.go
deploy/k8s/dev/allied-creation-gateway.yaml
查看文件 @
615d31b
...
...
@@ -103,6 +103,8 @@ spec:
value
:
"
false"
-
name
:
HTTP_PORT
value
:
"
8082"
-
name
:
SUPLUS_ADMIN_BASE_HOST
value
:
"
http://suplus-admin-base-dev.fjmaimaimai.com"
-
name
:
ALLIED_CREATION_GATEWAY_HOST
value
:
"
https://allied-creation-gateway-dev.fjmaimaimai.com"
-
name
:
ALLIED_CREATION_USER_HOST
...
...
deploy/k8s/test/allied-creation-gateway.yaml
查看文件 @
615d31b
...
...
@@ -108,7 +108,7 @@ spec:
-
name
:
HTTP_PORT
value
:
"
8082"
-
name
:
SUPLUS_ADMIN_BASE_HOST
value
:
"
http://suplus-admin-base-
test
.fjmaimaimai.com"
value
:
"
http://suplus-admin-base-
dev
.fjmaimaimai.com"
-
name
:
ALLIED_CREATION_GATEWAY_HOST
value
:
"
https://allied-creation-gateway-test.fjmaimaimai.com"
-
name
:
ALLIED_CREATION_USER_HOST
...
...
pkg/application/common/query/get_latest_versionInfo_query.go
查看文件 @
615d31b
...
...
@@ -11,7 +11,7 @@ type GetLatestVersionQuery struct {
//操作人
//Operator domain.Operator `json:"-"`
DeviceType
string
`json:"-"`
VersionNo
int
`json:"versionNo"`
VersionNo
int
`json:"versionNo
,string
"`
Channel
int
`json:"channel"`
Request
*
http
.
Request
`json:"-"`
}
...
...
pkg/application/common/service/service.go
查看文件 @
615d31b
...
...
@@ -6,6 +6,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/version_server"
)
const
IOSPage
=
"http://fir.fjmaimaimai.com/pdvn"
...
...
@@ -28,95 +29,32 @@ func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDicti
return
nil
,
err
}
return
result
,
nil
//type dictItem struct {
// ItemCode string `json:"itemCode"`
// ItemValue string `json:"itemValue"`
//}
//dictionaries := make([]interface{}, 0)
//for i := range getDictionaryQuery.DictCode {
// switch getDictionaryQuery.DictCode[i] {
// case "MenuType":
// dictionaries = append(dictionaries, map[string]interface{}{
// "dictName": "菜单类型",
// "dictItems": []dictItem{
// {"目录", "catalog"},
// {"菜单", "menu"},
// {"按钮", "button"},
// },
// "dictCode": "MenuType",
// })
// case "XTZD-001":
// dictionaries = append(dictionaries, map[string]interface{}{
// "dictName": "规模",
// "dictItems": []dictItem{
// {"1", "0~100人"},
// {"2", "101~200人"},
// {"3", "201~500人"},
// {"4", "501~1000人"},
// {"5", "1000人以上"},
// },
// "dictCode": "XTZD-001",
// })
// case "XTZD-002":
// dictionaries = append(dictionaries, map[string]interface{}{
// "dictName": "产业类型",
// "dictItems": []dictItem{
// {"1", "食品行业"},
// {"2", "电子行业"},
// {"3", "纺织业"},
// },
// "dictCode": "XTZD-002",
// })
// }
//}
//return map[string]interface{}{"dictionarys": dictionaries}, nil
}
//LatestVersionInfo 版本升级
func
(
srv
*
CommonService
)
LatestVersionInfo
(
q
*
query
.
GetLatestVersionQuery
)
(
interface
{},
error
)
{
page
:=
IOSPage
if
q
.
DeviceType
==
"1"
{
// 安卓
page
=
ANDPage
vs
:=
version_server
.
NewHttpLibVersionServer
()
data
,
err
:=
vs
.
GetLatestVersion
(
q
.
Request
,
version_server
.
ReqLatestVersion
{
VersionNo
:
q
.
VersionNo
,
Channel
:
q
.
Channel
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
return
map
[
string
]
interface
{}{
"version"
:
map
[
string
]
interface
{}{
"downloadPage"
:
page
,
"downloadFile"
:
""
,
"updateType"
:
0
,
},
},
nil
//vs:= version_server.NewHttpLibVersionServer()
//data,err:= vs.GetLatestVersion(q.Request,version_server.ReqLatestVersion{
// VersionNo: q.VersionNo,
// Channel: q.Channel,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
//return data, nil
return
data
,
nil
}
//AppSharing 获取分享链接地址
func
(
srv
*
CommonService
)
AppSharing
(
q
*
query
.
GetLatestVersionQuery
)
(
interface
{},
error
)
{
page
:=
IOSPage
if
q
.
DeviceType
==
"1"
{
// 安卓
page
=
ANDPage
vs
:=
version_server
.
NewHttpLibVersionServer
()
data
,
err
:=
vs
.
GetLatestVersion
(
q
.
Request
,
version_server
.
ReqLatestVersion
{
VersionNo
:
q
.
VersionNo
,
Channel
:
q
.
Channel
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
err
.
Error
())
}
return
map
[
string
]
interface
{}{
"version"
:
map
[
string
]
interface
{}{
"downloadPage"
:
page
,
"downloadFile"
:
""
,
},
},
nil
//vs:= version_server.NewHttpLibVersionServer()
//data,err:= vs.GetLatestVersion(q.Request,version_server.ReqLatestVersion{
// VersionNo: q.VersionNo,
// Channel: q.Channel,
//})
//if err != nil {
// return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
//}
//return data, nil
return
data
,
nil
}
// AdvancedSetting 高级查询 配置
...
...
pkg/constant/common.go
查看文件 @
615d31b
...
...
@@ -26,7 +26,7 @@ var ALLIED_CREATION_USER_HOST = "http://localhost:8081" //"http://allied-creatio
var
ALLIED_CREATION_COOPERATION_HOST
=
"http://localhost:8082"
// "http://allied-creation-cooperation-dev.fjmaimaimai.com"
// 版本更新模块
var
SUPLUS_ADMIN_BASE_HOST
=
"http://suplus-admin-base-
test
.fjmaimaimai.com"
var
SUPLUS_ADMIN_BASE_HOST
=
"http://suplus-admin-base-
dev
.fjmaimaimai.com"
//通用模块短信服务
var
SMS_SERVE_HOST
=
"https://sms.fjmaimaimai.com:9897"
...
...
pkg/infrastructure/service_gateway/version_server/httplib_version_serve.go
查看文件 @
615d31b
...
...
@@ -48,7 +48,8 @@ func (gateway HttpLibVersionServer) GetLatestVersion(rc *http.Request, param Req
req
.
Header
(
k
,
vs
[
i
])
}
}
req
.
Header
(
"X-MMM-AppProject"
,
"AlliedCreation"
)
req
.
Header
(
"X-MMM-AppName"
,
"com.mmm.alliedcreation"
)
byteResult
,
err
:=
req
.
Bytes
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"获取版本失败:%w"
,
err
)
...
...
请
注册
或
登录
后发表评论