作者 唐旭辉

bug 修复

appname = partnermg
runmode = "${RUN_MODE||dev}"
runmode = "${RUN_MODE||test}"
httpport = "${HTTP_PORT||8082}"
#开启监控
... ...
... ... @@ -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)
)
... ...
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
... ...
... ... @@ -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 {
... ...