...
|
...
|
@@ -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 高级查询 配置
|
...
|
...
|
|