param_user.go 11.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 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 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 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 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408
package allied_creation_user

import (
	"time"
)

//################用户模块##################

//单体用户详情数据
type UserDetail struct {
	UserId          int    `json:"userId"`
	UserBaseId      int    `json:"userBaseId"`
	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"`
	} `json:"userInfo,omitempty"`
	Company *struct {
		CompanyId        int       `json:"companyId"`
		CompanyName      string    `json:"companyName"`
		Scale            string    `json:"scale"`
		IndustryCategory string    `json:"industryCategory"`
		RegisteredTime   time.Time `json:"registeredTime"`
		Status           int64     `json:"status"`
		Logo             string    `json:"logo"`
		Address          string    `json:"address"`
		SystemName       string    `json:"systemName"`
	} `json:"company,omitempty"`
	Org *struct {
		OrgId   int    `json:"orgId"`
		OrgCode string `json:"orgCode"`
		OrgName string `json:"orgName"`
	} `json:"org,omitempty"`
	Department *struct {
		DepartmentId   int    `json:"departmentId"`
		DepartmentName string `json:"departmentName"`
		// 部门编号
		DepartmentNumber string `json:"departmentNumber"`
	} `json:"department,omitempty"`
	UserRole []struct {
		RoleID   int    `json:"roleId"`
		RoleName string `json:"roleName"`
		RoleType int    `json:"roleType"`
		OrgId    int64  `json:"orgId"`
		Ext      struct {
			OrgName string `json:"orgName"`
		} `json:"ext,omitempty"`
	} `json:"userRole"`
	UserOrg []struct {
		OrgID     int       `json:"orgId"`
		CreatedAt time.Time `json:"createdAt"`
		UpdatedAt time.Time `json:"updatedAt"`
		DeletedAt time.Time `json:"deletedAt"`
		OrgName   string    `json:"orgName"`
	} `json:"userOrg"`
	IM struct {
		Accid       string `json:"accid"`
		ImToken     string `json:"imToken"`
		CsAccountID string `json:"csAccountId"`
	} `json:"im"`
	// 收藏的菜单(工作台)(菜单编码列表)
	FavoriteMenus []string `json:"favoriteMenus"`
	// 创建时间
	CreatedAt time.Time `json:"createdAt,omitempty"`
}

//搜索用户列表
type (
	ReqUserSearch struct {
		// 查询偏离量
		Offset int `json:"offset"`
		// 查询限制
		Limit int `json:"limit"`
		// 用户基础id
		UserBaseId int64 ` json:"userBaseId"`
		// 企业id
		CompanyId int64 ` json:"companyId"`
		// 组织ID
		OrganizationId int64 `json:"organizationId"`
		// 部门编号
		DepartmentId int64 `json:"departmentId"`
		// 用户姓名
		UserName string `json:"userName"`
		// 共创公司
		CooperationCompany string `cname:"共创公司" json:"cooperationCompany,omitempty"`
		// 部门名称
		DepName string `json:"depName"`
		// 手机号码
		Phone string `json:"phone"`
		// 用户类型
		UserType int `cname:"用户类型 1:普通用户  2:共创用户  1024:企业注册用户" json:"userType,omitempty"`
		// 匹配多个组织
		InOrgIds []int64 `cname:"匹配多个组织" json:"inOrgIds,omitempty"`
		// 实时拉取数据 (获取最新的)
		PullRealTime bool `cname:"拉取最新数据" json:"pullRealTime,omitempty"`
		// 状态(1:启用  2:禁用  3:注销)
		EnableStatus int `cname:"状态(1:启用  2:禁用  3:注销)" json:"enableStatus,omitempty"`
		// 状态(1:启用  2:禁用  3:注销)
		InEnableStatus []int `cname:"状态(1:启用  2:禁用  3:注销)" json:"inEnableStatus,omitempty"`
	}

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

//创建用户
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"`
	}
	DataCreateUser struct {
		UserId int `json:"userId"`
	}
)

//更新用户
type (
	ReqUpdateUser struct {
		UserId int64
		// 企业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"`
	}

	DataUpdateUser struct {
	}
)

//获取用户
type (
	ReqGetUser struct {
		UserId int `json:"userId"`
	}

	DataGateUser struct {
		UserDetail
	}
)

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

	DataDeleteUser struct {
	}
)

//批量修改用户启用状态
type (
	ReqBatchEnableUser struct {
		UserIds      []int64 `json:"userIds"`
		EnableStatus int     `json:"enableStatus"` //启用状态(启用:1 禁用:2 注销:3)
	}

	DataBatchEnableUser struct {
	}
)

//批量重置密码
type (
	ReqBatchResetPasswordUser struct {
		Password string  `json:"password"`
		UserIds  []int64 `json:"userIds"`
	}
	DataBatchResetPasswordUser struct {
	}
)

//创建共创用户
type (
	ReqCreateCooperatorUser struct {
		// 企业ID
		CompanyId int64 `cname:"企业ID" json:"companyId"`
		// 共创公司
		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"`
	}
	DataCreateCooperatorUser struct {
		UserId int `json:"userId"`
	}
)

//更新共创用户
type (
	ReqUpdateCooperatorUser struct {
		UserId int64 `json:"userId"`
		// 共创公司
		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" `
	}
	DataUpdateCooperatorUser struct {
	}
)

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

//更新用户基础信息数据
type (
	ReqUserUpdateBaseInfo struct {
		UserId int64 `json:"userId"`
		// 用户基础Id 用户唯一标识
		UserBaseId int64 `cname:"用户Id 用户唯一标识" json:"userBaseId" valid:"Required"`
		// 用户姓名
		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"`
	}
	DataUserUpdateBaseInfo struct {
	}
)

//返回用户有权限的菜单
type (
	ReqUserAccessMenus struct {
		UserId int `json:"userId"`
		// 当前登录组织orgId
		OrgId int64 `cname:"当前登录组织Id" json:"orgId"`
		// 菜单类别 web app
		MenuCategory string `cname:"菜单类别 web app" json:"menuCategory,omitempty"`
		// 返回所有不可以用的菜单
		ALLDisableMenu int `cname:"同时返回所有不可以用的菜单 1:包含不可用的菜单 0:过滤不可用的菜单 " json:"allDisableMenu"`
	}
	DataUserAccessMenus struct {
		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"`
		} `json:"menus"`
	}
)

//批量修改用户启用状态
type (
	ReqBatchAddUser struct {
		Users    []BatchAddUserItem `json:"users"`
		Password string             `json:"password"`
	}

	DataImportResponse struct {
		FailRows []interface{} `json:"failRows"`
	}

	//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"`
	//}

	BatchAddUserItem struct {
		// 企业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:注销)
		EnableStatus string `json:"enableStatus,omitempty"`
		// 共创公司 cooperationCompany
		CooperationCompany string `json:"cooperationCompany"`
		// 共创到期时间 (yyyy-MM-dd) cooperationDeadline
		CooperationDeadline string `json:"cooperationDeadline"`
		// 失败理由
		FailReason string `json:"failReason"`
	}
)