切换导航条
此项目
正在载入...
登录
mmm-go
/
partnermg
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
唐旭辉
5 years ago
提交
482e03d7fb535d79fafb9c897019721dc5990196
1 个父辈
d17ac109
bug 修复
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
19 行增加
和
5 行删除
conf/app.conf
pkg/application/users/service/service.go
pkg/infrastructure/repository/pg_company_reponsitory.go
pkg/infrastructure/serviceGateway/httplib_usercenter_service.go
conf/app.conf
查看文件 @
482e03d
appname
=
partnermg
runmode
=
"${RUN_MODE||
dev
}"
runmode
=
"${RUN_MODE||
test
}"
httpport
=
"${HTTP_PORT||8082}"
#开启监控
...
...
pkg/application/users/service/service.go
查看文件 @
482e03d
...
...
@@ -31,6 +31,11 @@ func (service UsersService) UserLoginBySecretKey(cmd command.LoginBySecretKeyCom
e
:=
fmt
.
Sprintf
(
"通过密钥(code=%s)从统一用户中心获取数据失败:%s"
,
cmd
.
Code
,
err
.
Error
())
return
nil
,
lib
.
ThrowError
(
lib
.
INTERNAL_SERVER_ERROR
,
e
)
}
err
=
loginResp
.
IsOK
()
if
err
!=
nil
{
e
:=
fmt
.
Sprintf
(
"登录失败:%s"
,
err
)
return
nil
,
lib
.
ThrowError
(
lib
.
BUSINESS_ERROR
,
e
)
}
var
(
transactionContext
,
_
=
factory
.
CreateTransactionContext
(
nil
)
)
...
...
pkg/infrastructure/repository/pg_company_reponsitory.go
查看文件 @
482e03d
package
repository
import
(
"errors"
"fmt"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
...
...
@@ -86,15 +87,24 @@ func (reponsitory CompanyRepository) Edit(m *domain.Company) error {
func
(
reponsitory
CompanyRepository
)
FindOne
(
queryOptions
domain
.
CompanyFindOneOptions
)
(
domain
.
Company
,
error
)
{
var
(
err
error
tx
=
reponsitory
.
transactionContext
.
PgTx
m
models
.
Company
err
error
tx
=
reponsitory
.
transactionContext
.
PgTx
m
models
.
Company
hasCondition
bool
)
query
:=
tx
.
Model
(
&
m
)
if
queryOptions
.
Id
>
0
{
hasCondition
=
true
query
=
query
.
Where
(
"id=?"
,
queryOptions
.
Id
)
}
if
queryOptions
.
AdminCompanyId
>
0
{
hasCondition
=
true
query
=
query
.
Where
(
"admin_company_id=?"
,
queryOptions
.
Id
)
}
if
!
hasCondition
{
return
domain
.
Company
{},
errors
.
New
(
"findOne 必须要有查询条件"
)
}
err
=
query
.
First
()
if
err
!=
nil
{
return
domain
.
Company
{},
err
...
...
pkg/infrastructure/serviceGateway/httplib_usercenter_service.go
查看文件 @
482e03d
...
...
@@ -102,7 +102,6 @@ func (gateway MmmUserCenterServiceGateway) RequestUCenterLoginBySecret(secret st
if
err
!=
nil
{
return
nil
,
err
}
respData
:=
&
ResponseLogin
{}
err
=
json
.
Unmarshal
(
byteData
,
respData
)
if
err
!=
nil
{
...
...
请
注册
或
登录
后发表评论