审查视图

pkg/infrastructure/service_gateway/allied_creation_user/param_user.go 14.7 KB
tangxuhui authored
1 2
package allied_creation_user
tangxuhui authored
3 4 5
import (
	"time"
)
tangxuhui authored
6
tangxuhui authored
7 8
//################用户模块##################
tangxuhui authored
9 10
//单体用户详情数据
type UserDetail struct {
tangxuhui authored
11 12
	UserId          int    `json:"userId"`
	UserBaseId      int    `json:"userBaseId"`
tangxuhui authored
13 14 15 16 17 18 19 20 21 22 23 24 25
	UserType        int    `json:"userType"`
	UserCode        string `json:"userCode"`
	EnableStatus    int    `json:"enableStatus"`
	CooperationInfo struct {
		CooperationCompany  string    `json:"cooperationCompany"`
		CooperationDeadline time.Time `json:"cooperationDeadline"`
	} `json:"cooperationInfo,omitempty"`
	UserInfo struct {
		Phone    string `json:"phone"`
		UserCode string `json:"userCode"`
		Email    string `json:"email"`
		UserName string `json:"userName"`
		Avatar   string `json:"avatar"`
yangfu authored
26 27 28 29
		// 员工类型  1:固定 2:派遣 3.临时
		EmployeeType int `json:"employeeType,omitempty"`
		// IC卡号
		IcCardNumber string `json:"icCardNumber,omitempty"`
tangxuhui authored
30 31
	} `json:"userInfo,omitempty"`
	Company *struct {
tangxuhui authored
32
		CompanyId        int       `json:"companyId"`
tangxuhui authored
33 34 35 36 37
		CompanyName      string    `json:"companyName"`
		Scale            string    `json:"scale"`
		IndustryCategory string    `json:"industryCategory"`
		RegisteredTime   time.Time `json:"registeredTime"`
		Status           int64     `json:"status"`
tangxuhui authored
38
		Logo             string    `json:"logo"`
39 40
		Address          string    `json:"address"`
		SystemName       string    `json:"systemName"`
tangxuhui authored
41 42
	} `json:"company,omitempty"`
	Org *struct {
tangxuhui authored
43
		OrgId   int    `json:"orgId"`
tangxuhui authored
44 45 46 47
		OrgCode string `json:"orgCode"`
		OrgName string `json:"orgName"`
	} `json:"org,omitempty"`
	Department *struct {
tangxuhui authored
48
		DepartmentId   int    `json:"departmentId"`
tangxuhui authored
49
		DepartmentName string `json:"departmentName"`
yangfu authored
50 51
		// 部门编号
		DepartmentNumber string `json:"departmentNumber"`
tangxuhui authored
52 53
	} `json:"department,omitempty"`
	UserRole []struct {
tangxuhui authored
54
		RoleID   int    `json:"roleId"`
tangxuhui authored
55
		RoleName string `json:"roleName"`
yangfu authored
56
		RoleType int    `json:"roleType"`
yangfu authored
57
		OrgId    int64  `json:"orgId"`
tangxuhui authored
58 59 60 61 62
		Ext      struct {
			OrgName string `json:"orgName"`
		} `json:"ext,omitempty"`
	} `json:"userRole"`
	UserOrg []struct {
tangxuhui authored
63
		OrgID     int       `json:"orgId"`
tangxuhui authored
64 65 66 67 68
		CreatedAt time.Time `json:"createdAt"`
		UpdatedAt time.Time `json:"updatedAt"`
		DeletedAt time.Time `json:"deletedAt"`
		OrgName   string    `json:"orgName"`
	} `json:"userOrg"`
69 70 71 72 73
	IM struct {
		Accid       string `json:"accid"`
		ImToken     string `json:"imToken"`
		CsAccountID string `json:"csAccountId"`
	} `json:"im"`
yangfu authored
74 75
	// 收藏的菜单(工作台)(菜单编码列表)
	FavoriteMenus []string `json:"favoriteMenus"`
yangfu authored
76 77 78 79 80
	Favorite      struct {
		OrgItems    []int64 `json:"orgItems"`
		Referer     string  `json:"referer"`
		LastLogInAt int64   `json:"lastLogInAt"`
	} `json:"favorite"`
81 82
	// 创建时间
	CreatedAt time.Time `json:"createdAt,omitempty"`
tangxuhui authored
83 84
}
85 86 87 88 89 90 91
//搜索用户列表
type (
	ReqUserSearch struct {
		// 查询偏离量
		Offset int `json:"offset"`
		// 查询限制
		Limit int `json:"limit"`
92 93
		// 用户基础id
		UserBaseId int64 ` json:"userBaseId"`
94 95 96 97 98 99 100 101
		// 企业id
		CompanyId int64 ` json:"companyId"`
		// 组织ID
		OrganizationId int64 `json:"organizationId"`
		// 部门编号
		DepartmentId int64 `json:"departmentId"`
		// 用户姓名
		UserName string `json:"userName"`
yangfu authored
102 103
		// 共创公司
		CooperationCompany string `cname:"共创公司" json:"cooperationCompany,omitempty"`
104 105 106 107
		// 部门名称
		DepName string `json:"depName"`
		// 手机号码
		Phone string `json:"phone"`
yangfu authored
108 109
		// 用户类型
		UserType int `cname:"用户类型 1:普通用户  2:共创用户  1024:企业注册用户" json:"userType,omitempty"`
yangfu authored
110 111
		// 匹配多个组织
		InOrgIds []int64 `cname:"匹配多个组织" json:"inOrgIds,omitempty"`
yangfu authored
112 113
		// 实时拉取数据 (获取最新的)
		PullRealTime bool `cname:"拉取最新数据" json:"pullRealTime,omitempty"`
114 115
		// 状态(1:启用  2:禁用  3:注销)
		EnableStatus int `cname:"状态(1:启用  2:禁用  3:注销)" json:"enableStatus,omitempty"`
yangfu authored
116 117
		// 状态(1:启用  2:禁用  3:注销)
		InEnableStatus []int `cname:"状态(1:启用  2:禁用  3:注销)" json:"inEnableStatus,omitempty"`
118 119
		// 匹配多个公司
		InCompanyIds []interface{} `json:"inCompanyIds,omitempty"`
yangfu authored
120 121

		// 自定义高级查询
yangfu authored
122
		AdvancedQuery string `json:"advancedQuery"`
123 124
	}
tangxuhui authored
125
	//DataUserSearch 搜索用户列表
126
	DataUserSearch struct {
tangxuhui authored
127 128
		Count int64        `json:"count"`
		Users []UserDetail `json:"users"`
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
	}
)

//创建用户
type (
	ReqCreateUser struct {
		// 企业id
		CompanyId int64 `json:"companyId"`
		// 用户类型  1:企业内部用户(内部添加) 2:共创用户   1024:企业注册用户(注册添加)
		UserType int `json:"userType"`
		// 用户编号 企业内标识
		UserCode string ` json:"userCode" `
		// 组织机构
		OrganizationId int64 `json:"organizationId,omitempty" `
		// 所属部门
		DepartmentId int64 `json:"departmentId,omitempty" `
		// 用户关联的组织
		UserOrg []int64 `json:"userOrg,omitempty"`
		// 用户关联的角色
		UserRole []int64 `json:"userRole,omitempty"`
		// 共创公司
		CooperationCompany string `json:"cooperationCompany,omitempty"`
		// 共创到期时间 (yyyy-MM-dd)
		CooperationDeadline time.Time ` json:"cooperationDeadline,omitempty"`
		// 启用状态(启用:1 禁用:2)
		EnableStatus int ` json:"enableStatus,omitempty"`
		// 密码
		Password string ` json:"password" `
		// 用户姓名
		UserName string `json:"userName"`
		// 手机号码
		Phone string `json:"phone" `
		// 头像
		Avatar string `json:"avatar"`
		// 邮箱
		Email string `json:"email"`
165 166 167 168
		// 员工类型  1:固定 2:派遣 3.临时
		EmployeeType int `cname:"员工类型" json:"employeeType" valid:"Required"`
		// IC卡号
		IcCardNumber string `cname:"IC卡号" json:"icCardNumber,omitempty"`
yangfu authored
169 170 171

		// 部门
		DepartmentName string `cname:"部门" json:"departmentName"`
172 173
	}
	DataCreateUser struct {
174
		UserId int `json:"userId"`
175 176 177 178 179 180
	}
)

//更新用户
type (
	ReqUpdateUser struct {
tangxuhui authored
181
		UserId int64
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
		// 企业id
		CompanyId int64 `json:"companyId"`
		// 用户编号 企业内标识
		UserCode string ` json:"userCode" `
		// 组织机构
		OrganizationId int64 `json:"organizationId,omitempty" `
		// 所属部门
		DepartmentId int64 `json:"departmentId,omitempty" `
		// 用户关联的组织
		UserOrg []int64 `json:"userOrg,omitempty"`
		// 用户关联的角色
		UserRole []int64 `json:"userRole,omitempty"`
		// 共创公司
		CooperationCompany string `json:"cooperationCompany,omitempty"`
		// 共创到期时间 (yyyy-MM-dd)
		CooperationDeadline time.Time ` json:"cooperationDeadline,omitempty"`
		// 启用状态(启用:1 禁用:2)
		EnableStatus int ` json:"enableStatus,omitempty"`
		// 用户姓名
		UserName string `json:"userName"`
		// 手机号码
		Phone string `json:"phone" `
		// 头像
		Avatar string `json:"avatar"`
		// 邮箱
		Email string `json:"email"`
208 209 210 211
		// 员工类型  1:固定 2:派遣 3.临时
		EmployeeType int `cname:"员工类型" json:"employeeType" valid:"Required"`
		// IC卡号
		IcCardNumber string `cname:"IC卡号" json:"icCardNumber,omitempty"`
yangfu authored
212 213 214
		// 运营管理扩展
		// 部门
		DepartmentName string `cname:"部门" json:"departmentName"`
215 216 217 218 219 220 221 222
	}

	DataUpdateUser struct {
	}
)

//获取用户
type (
yangfu authored
223
	ReqGetUser struct {
tangxuhui authored
224
		UserId int `json:"userId"`
225 226 227
	}

	DataGateUser struct {
tangxuhui authored
228
		UserDetail
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
	}
)

//删除用户
type (
	ReqDeleteUser struct {
		UserId int64 `json:"userId"`
	}

	DataDeleteUser struct {
	}
)

//批量修改用户启用状态
type (
	ReqBatchEnableUser struct {
245 246
		UserIds      []int64 `json:"userIds"`
		EnableStatus int     `json:"enableStatus"` //启用状态(启用:1 禁用:2 注销:3)
247 248 249 250 251 252 253 254 255
	}

	DataBatchEnableUser struct {
	}
)

//批量重置密码
type (
	ReqBatchResetPasswordUser struct {
256 257
		Password string  `json:"password"`
		UserIds  []int64 `json:"userIds"`
258 259 260 261 262 263 264 265
	}
	DataBatchResetPasswordUser struct {
	}
)

//创建共创用户
type (
	ReqCreateCooperatorUser struct {
266 267
		// 企业ID
		CompanyId int64 `cname:"企业ID" json:"companyId"`
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
		// 共创公司
		CooperationCompany string ` json:"cooperationCompany"`
		// 共创到期时间
		CooperationDeadline time.Time `json:"cooperationDeadline"`
		// 邮箱
		Email string `json:"email"`
		// 启用状态(启用:1 禁用:2 注销:3)
		EnableStatus int `json:"enableStatus" `
		// 用户编号 企业内标识
		UserCode string `json:"userCode"`
		// 用户姓名
		UserName string ` json:"userName"`
		// 头像
		Avatar string ` json:"avatar"`
		// 组织ID
		OrgId int64 `json:"orgId"`
		// 手机号码
		Phone string `json:"phone"`
		//密码
		Password string `json:"password"`
288 289
	}
	DataCreateCooperatorUser struct {
290
		UserId int `json:"userId"`
291 292 293 294 295 296 297
	}
)

//更新共创用户
type (
	ReqUpdateCooperatorUser struct {
		UserId int64 `json:"userId"`
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
		// 共创公司
		CooperationCompany string ` json:"cooperationCompany"`
		// 共创到期时间
		CooperationDeadline time.Time `json:"cooperationDeadline"`
		// 邮箱
		Email string `json:"email"`
		// 启用状态(启用:1 禁用:2 注销:3)
		EnableStatus int `json:"enableStatus" `
		// 用户编号 企业内标识
		UserCode string `json:"userCode" `
		// 用户姓名
		UserName string ` json:"userName"`
		// 头像
		Avatar string ` json:"avatar"`
		// 组织ID
		OrgId int64 `json:"orgId" `
		// 手机号码
		Phone string `json:"phone" `
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
	}
	DataUpdateCooperatorUser struct {
	}
)

//获取用户概要数据
type (
	ReqUserProfile struct {
		UserId int64 `json:"userId"`
	}
	DataUserProfile struct {
	}
)

//更新用户基础信息数据
type (
	ReqUserUpdateBaseInfo struct {
		UserId int64 `json:"userId"`
yangfu authored
334 335
		// 用户基础Id 用户唯一标识
		UserBaseId int64 `cname:"用户Id 用户唯一标识" json:"userBaseId" valid:"Required"`
yangfu authored
336 337 338 339 340 341 342 343
		// 用户姓名
		UserName string `cname:"用户姓名" json:"userName" valid:"Required"`
		// 头像
		Avatar string `cname:"头像" json:"avatar" valid:"Required"`
		// 手机号码
		Phone string `cname:"手机号码" json:"phone" valid:"Required"`
		// 邮箱
		Email string `cname:"邮箱" json:"email" valid:"Required"`
344 345 346 347 348 349 350 351
	}
	DataUserUpdateBaseInfo struct {
	}
)

//返回用户有权限的菜单
type (
	ReqUserAccessMenus struct {
tangxuhui authored
352
		UserId int `json:"userId"`
yangfu authored
353 354
		// 当前登录组织orgId
		OrgId int64 `cname:"当前登录组织Id" json:"orgId"`
yangfu authored
355 356 357 358
		// 菜单类别 web app
		MenuCategory string `cname:"菜单类别 web app" json:"menuCategory,omitempty"`
		// 返回所有不可以用的菜单
		ALLDisableMenu int `cname:"同时返回所有不可以用的菜单 1:包含不可用的菜单 0:过滤不可用的菜单 " json:"allDisableMenu"`
359 360
	}
	DataUserAccessMenus struct {
tangxuhui authored
361 362 363 364 365 366 367 368 369 370 371 372 373 374
		Menus []struct {
			AccessCode   string `json:"accessCode"`
			Category     string `json:"category"`
			Code         string `json:"code"`
			EnableStatus int    `json:"enableStatus"`
			Icon         string `json:"icon"`
			IsPublish    int    `json:"isPublish"`
			MenuID       int    `json:"menuId"`
			MenuName     string `json:"menuName"`
			MenuType     string `json:"menuType"`
			ParentID     int    `json:"parentId"`
			ParentPath   string `json:"parentPath"`
			Remark       string `json:"remark"`
			Sort         int    `json:"sort"`
yangfu authored
375
			Link         string `json:"link"`
tangxuhui authored
376
		} `json:"menus"`
377 378
	}
)
379 380 381 382 383

//批量修改用户启用状态
type (
	ReqBatchAddUser struct {
		Users    []BatchAddUserItem `json:"users"`
yangfu authored
384
		Password string             `json:"password"`
385 386
	}
yangfu authored
387 388
	DataImportResponse struct {
		FailRows []interface{} `json:"failRows"`
389 390
	}
yangfu authored
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410
	//BatchAddUserItem struct {
	//	CompanyID       int64                           `json:"companyId"`
	//	UserType        int                             `json:"userType"`
	//	UserCode        string                          `json:"userCode"`
	//	OrganizationID  int                             `json:"organizationId"`
	//	DepartmentID    int                             `json:"departmentId"`
	//	UserInfo        BatchAddUserItemUserInfo        `json:"userInfo"`
	//	CooperationInfo BatchAddUserItemCooperationInfo `json:"cooperationInfo"`
	//}
	//BatchAddUserItemUserInfo struct {
	//	Phone    string `json:"phone"`
	//	UserName string `json:"userName"`
	//	Email    string `json:"email"`
	//	Avatar   string `json:"avatar"`
	//}
	//BatchAddUserItemCooperationInfo struct {
	//	CooperationCompany  string    `json:"cooperationCompany"`
	//	CooperationDeadline time.Time `json:"cooperationDeadline"`
	//}
411
	BatchAddUserItem struct {
yangfu authored
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428
		// 企业id
		CompanyId int64 `json:"companyId,omitempty"`
		// 用户类型  1:企业内部用户(内部添加) 2:共创用户   1024:企业注册用户(注册添加)
		UserType int `json:"userType,omitempty"`
		// 用户姓名
		UserName string `json:"userName,omitempty"`
		// 手机号码
		Phone string `json:"phone,omitempty"`
		// 邮箱
		Email string `json:"email,omitempty"`
		// 用户编号 企业内标识
		UserCode string `json:"userCode,omitempty"`
		// 组织编码
		Org string `json:"org,omitempty"`
		// 部门编码
		Department string `json:"department,omitempty"`
		// 状态(1:启用  2:禁用  3:注销)
yangfu authored
429
		EnableStatus string `json:"enableStatus,omitempty"`
yangfu authored
430 431 432
		// 共创公司 cooperationCompany
		CooperationCompany string `json:"cooperationCompany"`
		// 共创到期时间 (yyyy-MM-dd) cooperationDeadline
yangfu authored
433
		CooperationDeadline string `json:"cooperationDeadline"`
434 435 436 437
		// 员工类型  1:固定 2:派遣 3.临时
		EmployeeType string `json:"employeeType,omitempty"`
		// IC卡号
		IcCardNumber string `json:"icCardNumber,omitempty"`
yangfu authored
438 439
		// 失败理由
		FailReason string `json:"failReason"`
440 441
	}
)
yangfu authored
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495

//搜索用户列表
type (
	ReqUserBaseSearch struct {
		// 查询偏离量
		Offset int `json:"offset"`
		// 查询限制
		Limit int `json:"limit"`
		// 用户姓名
		UserName string `cname:"用户姓名" json:"userName,omitempty"`
		// 在用户列表内
		InUserBaseIds []int64 `cname:"用户姓名" json:"inUserBaseIds,omitempty"`
		// 所属组织
		OrgName string `cname:"所属组织" json:"orgName,omitempty"`
		// 关闭查询限制
		DisableLimit bool `cname:"关闭查询限制" json:"disableLimit,omitempty"`
		// 获取组织
		FetchOrgBelong bool `cname:"获取组织" json:"fetchOrgBelong,omitempty"`
	}

	//DataUserSearch 搜索用户列表
	DataUserBaseSearch struct {
		Count int64            `json:"count"`
		Users []UserBaseDetail `json:"users"`
	}

	UserBaseDetail struct {
		UserBaseId int    `json:"userBaseId"`
		LastLogIn  string `json:"lastLogIn"`
		UserInfo   struct {
			UserName string `json:"userName"`
			Phone    string `json:"phone"`
			Avatar   string `json:"avatar"`
		} `json:"userInfo"`
		Status  int    `json:"status"`
		Referer string `json:"referer"`
		UserOrg []struct {
			OrgId   int    `json:"orgId"`
			OrgName string `json:"orgName"`
		} `json:"userOrg"`
		RegistrationDate string `json:"registrationDate"`
	}
)

type (
	ReqEnableUserBase struct {
		UserBaseIds []int64 `cname:"用户id列表" json:"userBaseIds" valid:"Required"`
		// 启用状态(启用:1 禁用:2 注销:3)
		EnableStatus int `cname:"启用状态(启用:1 禁用:2 注销:3)" json:"enableStatus" valid:"Required"`
	}

	//DataUserSearch 搜索用户列表
	DataEnableUserBase = interface{}
)