作者 tangxuhui

更新

{"F:\\go\\src\\allied-creation\\allied-creation-gateway\\pkg\\port\\beego\\routers":1627719981417605200}
\ No newline at end of file
{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1627890131470525700}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/common/command"
"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/allied_creation_user"
)
... ... @@ -17,7 +18,7 @@ func NewCommonService(options map[string]interface{}) *CommonService {
//GetDictionaryByCode 根据code获取字典数据
func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDictionaryByCodeQuery) (interface{}, error) {
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(0, 0, 0)
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(domain.Operator{})
result, err := creationBasicGateway.GetDictionarysByCode(allied_creation_basic.ReqGetDictionaryByCode{
DictCode: getDictionaryQuery.DictCode,
})
... ... @@ -33,7 +34,7 @@ func (srv *CommonService) CompanySignUp(signUpCommand *command.CompanySignUpComm
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
//校验验证码
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
_, err := creationUserGateway.AuthCompanySignUp(allied_creation_user.ReqAuthCompanySignUp{
CompanyName: signUpCommand.CompanyName,
Contacts: signUpCommand.Contacts,
... ...
... ... @@ -36,7 +36,7 @@ func (srv AuthService) AuthLogin(loginCommand *command.LoginCommand) (interface{
//SignInPassword 使用账号密码校验
func (srv AuthService) SignInPassword(account string, password string) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
_, err := creationUserGateway.AuthCheckPassword(allied_creation_user.ReqAuthCheckPassword{
Password: password,
Phone: account,
... ... @@ -94,7 +94,7 @@ func (srv AuthService) GetAuthAccessToken(accessTokenCommand *command.AccessToke
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
phone := ltoken.Account
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
Phone: phone,
})
... ... @@ -226,7 +226,7 @@ func (srv AuthService) RefreshAuthAccessToken(refreshTokenCommand *command.Refre
return nil, application.ThrowError(application.TRANSACTION_ERROR, "refreshToken 不可用,"+err.Error())
}
phone := ltoken.Account
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
userSeachResult, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
Phone: phone,
})
... ...
... ... @@ -14,9 +14,8 @@ type MenuService struct {
// 设置收藏菜单
func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFavoriteCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
menuFavoriteCommand.Operator.CompanyId,
menuFavoriteCommand.Operator.OrgId,
menuFavoriteCommand.Operator.UserId)
menuFavoriteCommand.Operator,
)
result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{
CompanyId: menuFavoriteCommand.Operator.CompanyId,
})
... ... @@ -29,9 +28,8 @@ func (menuService *MenuService) MenuFavorite(menuFavoriteCommand *command.MenuFa
// 返回菜单列表
func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
menuListQuery.Operator.CompanyId,
menuListQuery.Operator.OrgId,
menuListQuery.Operator.UserId)
menuListQuery.Operator,
)
result, err := creationUserGateway.CompanyGetCustomizeMenus(allied_creation_user.ReqCompanyGetCustomizeMenus{
CompanyId: menuListQuery.Operator.CompanyId,
MenuCategory: menuListQuery.MenuCategory,
... ... @@ -47,9 +45,8 @@ func (menuService *MenuService) MenuList(menuListQuery *query.MenuListQuery) (in
// 更新自定义菜单
func (menuService *MenuService) MenuUpdate(menuUpdateCommand *command.MenuUpdateCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
menuUpdateCommand.Operator.CompanyId,
menuUpdateCommand.Operator.OrgId,
menuUpdateCommand.Operator.UserId)
menuUpdateCommand.Operator,
)
_, err := creationUserGateway.CompanySetCustomizeMenus(allied_creation_user.ReqCompanySetCustomizeMenus{
CompanyId: menuUpdateCommand.Operator.CompanyId,
MenuAlias: menuUpdateCommand.MenuAlias,
... ...
... ... @@ -19,9 +19,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
noticeSettingListQuery.Operator.CompanyId,
noticeSettingListQuery.Operator.OrgId,
noticeSettingListQuery.Operator.UserId)
noticeSettingListQuery.Operator,
)
result, err := creationBasicGateway.NoticeSettingSearch(allied_creation_basic.ReqNoticeSettingSearch{
PageIndex: noticeSettingListQuery.PageNumber,
PageSize: noticeSettingListQuery.PageSize,
... ... @@ -39,7 +38,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingProfile(noticeSet
if err := noticeSettingProfileQuery.ValidateQuery(); err != nil {
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
//TODO
return nil, nil
}
... ... @@ -49,9 +48,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingUpdate(noticeSett
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
noticeSettingUpdateCommand.Operator.CompanyId,
noticeSettingUpdateCommand.Operator.OrgId,
noticeSettingUpdateCommand.Operator.UserId)
noticeSettingUpdateCommand.Operator,
)
noticeSettingID, _ := strconv.Atoi(noticeSettingUpdateCommand.NoticeSettingId)
_, err := creationBasicGateway.NoticeSettingUpdate(allied_creation_basic.ReqNoticeSettingUpdate{
... ... @@ -75,9 +73,8 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
noticeSettingAddCommand.Operator.CompanyId,
noticeSettingAddCommand.Operator.OrgId,
noticeSettingAddCommand.Operator.UserId)
noticeSettingAddCommand.Operator,
)
result, err := creationBasicGateway.NoticeSettingAdd(allied_creation_basic.ReqNoticeSettingAdd{
CompanyID: int(noticeSettingAddCommand.Operator.CompanyId),
Content: noticeSettingAddCommand.Content,
... ...
... ... @@ -17,9 +17,7 @@ type OrgsService struct {
// 创建组织管理
func (orgsService *OrgsService) OrgAdd(orgAddCommand *command.OrgAddCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
orgAddCommand.Operator.CompanyId,
orgAddCommand.Operator.OrgId,
orgAddCommand.Operator.UserId)
orgAddCommand.Operator)
parentId, _ := strconv.Atoi(orgAddCommand.ParentId)
result, err := creationUserGateway.OrgCreate(allied_creation_user.ReqOrgCreate{
CompanyId: int(orgAddCommand.Operator.CompanyId),
... ... @@ -44,9 +42,7 @@ func (orgsService *OrgsService) OrgAdd(orgAddCommand *command.OrgAddCommand) (in
// 禁用、启用组织管理
func (orgsService *OrgsService) OrgEnable(orgEnableCommand *command.OrgEnableCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
orgEnableCommand.Operator.CompanyId,
orgEnableCommand.Operator.OrgId,
orgEnableCommand.Operator.UserId)
orgEnableCommand.Operator)
orgId, _ := strconv.Atoi(orgEnableCommand.OrgId)
_, err := creationUserGateway.OrgEnable(allied_creation_user.ReqOrgEnable{
OrgId: orgId,
... ... @@ -61,9 +57,7 @@ func (orgsService *OrgsService) OrgEnable(orgEnableCommand *command.OrgEnableCom
// 返回组织管理
func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
orgGetQuery.Operator.CompanyId,
orgGetQuery.Operator.OrgId,
orgGetQuery.Operator.UserId)
orgGetQuery.Operator)
orgId, _ := strconv.Atoi(orgGetQuery.OrgId)
result, err := creationUserGateway.OrgGet(allied_creation_user.ReqOrgGet{
OrgId: orgId,
... ... @@ -85,9 +79,7 @@ func (orgsService *OrgsService) OrgGet(orgGetQuery *query.OrgGetQuery) (interfac
// 返回组织管理列表
func (orgsService *OrgsService) OrgList(orgListQuery *query.OrgListQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
orgListQuery.Operator.CompanyId,
orgListQuery.Operator.OrgId,
orgListQuery.Operator.UserId)
orgListQuery.Operator)
parentOrgId, _ := strconv.Atoi(orgListQuery.ParentId)
result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
CompanyId: int(orgListQuery.Operator.CompanyId),
... ... @@ -123,9 +115,7 @@ func (orgsService *OrgsService) OrgList(orgListQuery *query.OrgListQuery) (inter
// 更新组织管理
func (orgsService *OrgsService) OrgUpdate(orgUpdateCommand *command.OrgUpdateCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
orgUpdateCommand.Operator.CompanyId,
orgUpdateCommand.Operator.OrgId,
orgUpdateCommand.Operator.UserId)
orgUpdateCommand.Operator)
parentId, _ := strconv.Atoi(orgUpdateCommand.ParentId)
orgId, _ := strconv.Atoi(orgUpdateCommand.OrgId)
_, err := creationUserGateway.OrgUpdate(allied_creation_user.ReqOrgUpdate{
... ...
... ... @@ -17,9 +17,7 @@ type RolesService struct {
// 创建role
func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleAddCommand.Operator.CompanyId,
roleAddCommand.Operator.OrgId,
roleAddCommand.Operator.UserId)
roleAddCommand.Operator)
result, err := creationUserGateway.RoleCreate(allied_creation_user.ReqRoleCreate{
RoleName: roleAddCommand.RoleName,
Desc: roleAddCommand.Desc,
... ... @@ -40,9 +38,7 @@ func (rolesService *RolesService) RoleAdd(roleAddCommand *command.RoleAddCommand
// 编辑role
func (rolesService *RolesService) RoleEdit(roleUpdateCommand *command.RoleUpdateCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleUpdateCommand.Operator.CompanyId,
roleUpdateCommand.Operator.OrgId,
roleUpdateCommand.Operator.UserId)
roleUpdateCommand.Operator)
roleId, _ := strconv.Atoi(roleUpdateCommand.RoleId)
_, err := creationUserGateway.RoleUpdate(allied_creation_user.ReqRoleUpdate{
RoleId: int64(roleId),
... ... @@ -58,9 +54,7 @@ func (rolesService *RolesService) RoleEdit(roleUpdateCommand *command.RoleUpdate
// 返单个角色
func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleGetQuery.Operator.CompanyId,
roleGetQuery.Operator.OrgId,
roleGetQuery.Operator.UserId)
roleGetQuery.Operator)
roleId, _ := strconv.Atoi(roleGetQuery.RoleId)
roleData, err := creationUserGateway.RoleGet(allied_creation_user.ReqRoleGet{
RoleId: int64(roleId),
... ... @@ -91,9 +85,7 @@ func (rolesService *RolesService) RoleGet(roleGetQuery *query.RoleGetQuery) (int
// 返回role列表
func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (int64, interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleListQuery.Operator.CompanyId,
roleListQuery.Operator.OrgId,
roleListQuery.Operator.UserId)
roleListQuery.Operator)
roleList, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
Offset: (roleListQuery.PageNumber - 1) * roleListQuery.PageSize,
Limit: roleListQuery.PageSize,
... ... @@ -122,9 +114,7 @@ func (rolesService *RolesService) RoleList(roleListQuery *query.RoleListQuery) (
// 编辑角色关联权限菜单的前置准备数据
func (rolesService *RolesService) RoleMenuBeforeEdit(roleMenuBeforeEditQuery *query.RoleMenuBeforeEditQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleMenuBeforeEditQuery.Operator.CompanyId,
roleMenuBeforeEditQuery.Operator.OrgId,
roleMenuBeforeEditQuery.Operator.UserId)
roleMenuBeforeEditQuery.Operator)
roleId, _ := strconv.Atoi(roleMenuBeforeEditQuery.RoleId)
roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
OrgId: roleMenuBeforeEditQuery.Operator.OrgId,
... ... @@ -151,9 +141,7 @@ func (rolesService *RolesService) RoleMenuBeforeEdit(roleMenuBeforeEditQuery *qu
// 编辑角色关联用户的前置准备数据
func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *query.RoleUserBeforeEditQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleUserBeforeEditQuery.Operator.CompanyId,
roleUserBeforeEditQuery.Operator.OrgId,
roleUserBeforeEditQuery.Operator.UserId)
roleUserBeforeEditQuery.Operator)
roleId, _ := strconv.Atoi(roleUserBeforeEditQuery.RoleId)
roles, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
OrgId: roleUserBeforeEditQuery.Operator.OrgId,
... ... @@ -192,9 +180,7 @@ func (rolesService *RolesService) RoleUserBeforeEdit(roleUserBeforeEditQuery *qu
// 角色编辑关联菜单权限
func (rolesService *RolesService) RoleMenuEdit(roleMenuEditCommand *command.RoleMenuEditCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleMenuEditCommand.Operator.CompanyId,
roleMenuEditCommand.Operator.OrgId,
roleMenuEditCommand.Operator.UserId)
roleMenuEditCommand.Operator)
roleId, _ := strconv.Atoi(roleMenuEditCommand.RoleId)
var menuIds []int64
for _, v := range roleMenuEditCommand.MenuId {
... ... @@ -216,9 +202,7 @@ func (rolesService *RolesService) RoleMenuEdit(roleMenuEditCommand *command.Role
// 移除role
func (rolesService *RolesService) RoleRemove(roleRemoveCommand *command.RoleRemoveCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleRemoveCommand.Operator.CompanyId,
roleRemoveCommand.Operator.OrgId,
roleRemoveCommand.Operator.UserId)
roleRemoveCommand.Operator)
var roleIds []int64
for _, v := range roleRemoveCommand.RoleIds {
... ... @@ -239,9 +223,7 @@ func (rolesService *RolesService) RoleRemove(roleRemoveCommand *command.RoleRemo
// 角色添加关联用户
func (rolesService *RolesService) RoleUserAdd(roleUserAddCommand *command.RoleUserAddCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleUserAddCommand.Operator.CompanyId,
roleUserAddCommand.Operator.OrgId,
roleUserAddCommand.Operator.UserId)
roleUserAddCommand.Operator)
roleId, _ := strconv.Atoi(roleUserAddCommand.RoleId)
var userIds []int64
for _, v := range roleUserAddCommand.UserId {
... ... @@ -263,9 +245,7 @@ func (rolesService *RolesService) RoleUserAdd(roleUserAddCommand *command.RoleUs
// 角色添加关联用户
func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command.RoleUserDeleteCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleUserDeleteCommand.Operator.CompanyId,
roleUserDeleteCommand.Operator.OrgId,
roleUserDeleteCommand.Operator.UserId)
roleUserDeleteCommand.Operator)
roleId, _ := strconv.Atoi(roleUserDeleteCommand.RoleId)
var userIds []int64
for _, v := range roleUserDeleteCommand.UserId {
... ... @@ -287,9 +267,7 @@ func (rolesService *RolesService) RoleUserDelete(roleUserDeleteCommand *command.
// 角色下关联用户的数据 (暂时不需要这个)
func (rolesService *RolesService) RoleUserInfo(roleUserInfoQuery *query.RoleUserInfoQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
roleUserInfoQuery.Operator.CompanyId,
roleUserInfoQuery.Operator.OrgId,
roleUserInfoQuery.Operator.UserId)
roleUserInfoQuery.Operator)
relatedUser, err := creationUserGateway.RoleGetRelatedUser(allied_creation_user.ReqRoleGetRelatedUser{
RoleId: roleUserInfoQuery.RoleId,
})
... ...
... ... @@ -8,6 +8,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/users/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_user"
)
... ... @@ -24,9 +25,7 @@ func NewUsersService(options map[string]interface{}) *UsersService {
// 获取公司用户信息
func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.CompanyUserGetQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
companyUserGetQuery.Operator.CompanyId,
companyUserGetQuery.Operator.OrgId,
companyUserGetQuery.Operator.UserId)
companyUserGetQuery.Operator)
userid, _ := strconv.Atoi(companyUserGetQuery.UsersId)
resultUser, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{
UserId: userid,
... ... @@ -96,9 +95,7 @@ func (usersService *UsersService) CompanyUserGet(companyUserGetQuery *query.Comp
// 创建公司用户信息
func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.CompanyUserAddCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
companyUserAddCommand.Operator.CompanyId,
companyUserAddCommand.Operator.OrgId,
companyUserAddCommand.Operator.UserId)
companyUserAddCommand.Operator)
departmentId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
orgId, _ := strconv.Atoi(companyUserAddCommand.OrgId)
userOrg := []int64{}
... ... @@ -146,9 +143,7 @@ func (usersService *UsersService) CompanyUserAdd(companyUserAddCommand *command.
// 启用禁用公司用户信息
func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *command.CompanyUserEnableCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
companyUserEnableCommand.Operator.CompanyId,
companyUserEnableCommand.Operator.OrgId,
companyUserEnableCommand.Operator.UserId)
companyUserEnableCommand.Operator)
var userIds []int64
for i := range companyUserEnableCommand.UsersIds {
... ... @@ -167,7 +162,7 @@ func (usersService *UsersService) CompanyUserEnable(companyUserEnableCommand *co
// 返回公司用户信息列表
func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.CompanyUserListQuery) (int64, interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
Offset: (companyUserListQuery.PageNumber - 1) * companyUserListQuery.PageSize,
Limit: companyUserListQuery.PageSize,
... ... @@ -206,9 +201,7 @@ func (usersService *UsersService) CompanyUserList(companyUserListQuery *query.Co
// 批量重置密码
func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPasswordCommand *command.CompanyUserResetPasswordCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
companyUserResetPasswordCommand.Operator.CompanyId,
companyUserResetPasswordCommand.Operator.OrgId,
companyUserResetPasswordCommand.Operator.UserId)
companyUserResetPasswordCommand.Operator)
var userIds []int64
for i := range companyUserResetPasswordCommand.UserIds {
id, _ := strconv.Atoi(companyUserResetPasswordCommand.UserIds[i])
... ... @@ -227,9 +220,7 @@ func (usersService *UsersService) CompanyUserResetPassword(companyUserResetPassw
// 更新公司用户信息
func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *command.CompanyUserUpdateCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
companyUserUpdateCommand.Operator.CompanyId,
companyUserUpdateCommand.Operator.OrgId,
companyUserUpdateCommand.Operator.UserId)
companyUserUpdateCommand.Operator)
departmentId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
orgId, _ := strconv.Atoi(companyUserUpdateCommand.OrganizationId)
userOrg := []int64{}
... ... @@ -270,9 +261,7 @@ func (usersService *UsersService) CompanyUserUpdate(companyUserUpdateCommand *co
// 创建共创用户信息
func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *command.CooperationUserAddCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
cooperationUserAddCommand.Operator.CompanyId,
cooperationUserAddCommand.Operator.OrgId,
cooperationUserAddCommand.Operator.UserId)
cooperationUserAddCommand.Operator)
result, err := creationUserGateway.CooperatorUserCreate(allied_creation_user.ReqCreateCooperatorUser{
CompanyId: cooperationUserAddCommand.Operator.CompanyId,
CooperationCompany: cooperationUserAddCommand.CooperationCompany,
... ... @@ -302,9 +291,7 @@ func (usersService *UsersService) CooperationUserAdd(cooperationUserAddCommand *
// 启用禁用共创用户信息
func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCommand *command.CooperationUserEnableCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
cooperationUserEnableCommand.Operator.CompanyId,
cooperationUserEnableCommand.Operator.OrgId,
cooperationUserEnableCommand.Operator.UserId)
cooperationUserEnableCommand.Operator)
var userIds []int64
for i := range cooperationUserEnableCommand.UsersIds {
id, _ := strconv.Atoi(cooperationUserEnableCommand.UsersIds[i])
... ... @@ -323,9 +310,7 @@ func (usersService *UsersService) CooperationUserEnable(cooperationUserEnableCom
// 获取共创用户信息
func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *query.CooperationUserGetQuery) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
cooperationUserGetQuery.Operator.CompanyId,
cooperationUserGetQuery.Operator.OrgId,
cooperationUserGetQuery.Operator.UserId)
cooperationUserGetQuery.Operator)
userId, _ := strconv.Atoi(cooperationUserGetQuery.UserId)
result, err := creationUserGateway.UserGet(allied_creation_user.ReqGateUser{
UserId: userId,
... ... @@ -350,7 +335,7 @@ func (usersService *UsersService) CooperationUserGet(cooperationUserGetQuery *qu
// 返回共创用户信息列表
func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *query.CooperationUserListQuery) (int64, interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(0, 0, 0)
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(domain.Operator{})
result, err := creationUserGateway.UserSearch(allied_creation_user.ReqUserSearch{
Offset: (cooperationUserListQuery.PageNumber - 1) * cooperationUserListQuery.PageSize,
Limit: cooperationUserListQuery.PageSize,
... ... @@ -388,9 +373,7 @@ func (usersService *UsersService) CooperationUserList(cooperationUserListQuery *
// 批量重置密码
func (usersService *UsersService) CooperationUserResetPassword(cooperationUserResetPasswordCommand *command.CooperationUserResetPasswordCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
cooperationUserResetPasswordCommand.Operator.CompanyId,
cooperationUserResetPasswordCommand.Operator.OrgId,
cooperationUserResetPasswordCommand.Operator.UserId)
cooperationUserResetPasswordCommand.Operator)
var userIds []int64
for i := range cooperationUserResetPasswordCommand.UserIds {
id, _ := strconv.Atoi(cooperationUserResetPasswordCommand.UserIds[i])
... ... @@ -410,9 +393,7 @@ func (usersService *UsersService) CooperationUserResetPassword(cooperationUserRe
// 编辑共创用户信息
func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCommand *command.CooperationUserUpdateCommand) (interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
cooperationUserUpdateCommand.Operator.CompanyId,
cooperationUserUpdateCommand.Operator.OrgId,
cooperationUserUpdateCommand.Operator.UserId)
cooperationUserUpdateCommand.Operator)
_, err := creationUserGateway.CooperatorUserUpdate(allied_creation_user.ReqUpdateCooperatorUser{
UserId: cooperationUserUpdateCommand.UserId,
CooperationCompany: cooperationUserUpdateCommand.CooperationCompany,
... ... @@ -434,9 +415,7 @@ func (usersService *UsersService) CooperationUserUpdate(cooperationUserUpdateCom
//CompanyOrgSelector 获取公司组织的下拉列表
func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
selectorQuery.Operator.CompanyId,
selectorQuery.Operator.OrgId,
selectorQuery.Operator.UserId)
selectorQuery.Operator)
result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
CompanyId: int(selectorQuery.Operator.CompanyId),
DepName: selectorQuery.OrgName,
... ... @@ -468,9 +447,7 @@ func (usersService *UsersService) SelectorCompanyOrg(selectorQuery *query.Compan
//SelectorCompanyRole 获取公司角色的下拉列表
func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.CompanyRoleSelectorQuery) (int64, interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
selectorQuery.Operator.CompanyId,
selectorQuery.Operator.OrgId,
selectorQuery.Operator.UserId)
selectorQuery.Operator)
result, err := creationUserGateway.RoleSearch(allied_creation_user.ReqRoleSearch{
Limit: selectorQuery.PageSize,
Offset: (selectorQuery.PageNumber - 1) * selectorQuery.PageSize,
... ... @@ -498,9 +475,7 @@ func (usersService *UsersService) SelectorCompanyRole(selectorQuery *query.Compa
//CompanyOrgSelector 获取公司全组织部门的下拉列表
func (usersService *UsersService) SelectorCompanyOrgAll(selectorQuery *query.CompanyOrgSelectorQuery) (int64, interface{}, error) {
creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser(
selectorQuery.Operator.CompanyId,
selectorQuery.Operator.OrgId,
selectorQuery.Operator.UserId)
selectorQuery.Operator)
result, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{
CompanyId: int(selectorQuery.Operator.CompanyId),
DepName: "",
... ...
... ... @@ -3,9 +3,9 @@ package allied_creation_basic
import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
)
type HttplibAlliedCreationBasic struct {
... ... @@ -13,14 +13,15 @@ type HttplibAlliedCreationBasic struct {
baseUrL string
}
func NewHttplibAlliedCreationBasic(companyId int64, orgId int64, userId int64) *HttplibAlliedCreationBasic {
func NewHttplibAlliedCreationBasic(operator domain.Operator) *HttplibAlliedCreationBasic {
return &HttplibAlliedCreationBasic{
BaseServiceGateway: service_gateway.BaseServiceGateway{
ConnectTimeout: 100 * time.Second,
ReadWriteTimeout: 30 * time.Second,
CompanyId: companyId,
OrgId: orgId,
UserId: userId,
CompanyId: operator.CompanyId,
OrgId: operator.OrgId,
UserId: operator.UserId,
UserBaseId: operator.UserBaseId,
},
baseUrL: constant.ALLIED_CREATION_USER_HOST,
}
... ...
... ... @@ -11,7 +11,7 @@ import (
// NoticeSettingUpdate 更新消息模板
func (gateway HttplibAlliedCreationBasic) NoticeSettingUpdate(param ReqNoticeSettingUpdate) (*DataNoticeSettingUpdate, error) {
url := gateway.baseUrL + "/notice-setting"
url := gateway.baseUrL + "/notice-setting" + strconv.Itoa(param.NoticeSettingID)
method := "PUT"
req := gateway.CreateRequest(url, method)
log.Logger.Debug("向基础模块请求数据:更新消息模板。", map[string]interface{}{
... ...
... ... @@ -4,6 +4,7 @@ import (
"time"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
)
... ... @@ -13,14 +14,15 @@ type HttplibAlliedCreationUser struct {
baseUrL string
}
func NewHttplibAlliedCreationUser(companyId int64, orgId int64, userId int64) *HttplibAlliedCreationUser {
func NewHttplibAlliedCreationUser(operator domain.Operator) *HttplibAlliedCreationUser {
return &HttplibAlliedCreationUser{
BaseServiceGateway: service_gateway.BaseServiceGateway{
ConnectTimeout: 100 * time.Second,
ReadWriteTimeout: 30 * time.Second,
CompanyId: companyId,
OrgId: orgId,
UserId: userId,
CompanyId: operator.CompanyId,
OrgId: operator.OrgId,
UserId: operator.UserId,
UserBaseId: operator.UserBaseId,
},
baseUrL: constant.ALLIED_CREATION_USER_HOST,
}
... ...
... ... @@ -26,6 +26,7 @@ type BaseServiceGateway struct {
CompanyId int64
OrgId int64
UserId int64
UserBaseId int64
}
func (gateway BaseServiceGateway) CreateRequest(url string, method string) *httplib.BeegoHTTPRequest {
... ...