作者 陈志颖

feat:修改用户管理列表

... ... @@ -280,7 +280,13 @@ func (service UsersService) GetUserList(queryOption query.UserListQuery) (int, [
return cnt, result, nil
}
//buildGetUserList 组装构建前端需要的用户列表数据
/**
* @Author SteveChan
* @Description // 组装构建前端需要的用户列表数据
* @Date 00:22 2021/1/8
* @Param
* @return
**/
func (service UsersService) buildGetUserList(usersData []domain.Users, permissionData []domain.AdminPermission) []map[string]interface{} {
result := make([]map[string]interface{}, 0, len(usersData))
permissionMap := map[int64]domain.AdminPermission{}
... ... @@ -313,9 +319,11 @@ func (service UsersService) buildGetUserList(usersData []domain.Users, permissio
"permission": permissionTypes,
"isAdmin": 0,
"partnership": len(usersData[i].AccessPartners),
"isSenior": usersData[i].IsSenior,
}
if usersData[i].IsSuperAdmin() {
m["isAdmin"] = 1
m["name"] = m["name"].(string) + "(管理员)"
}
result = append(result, m)
}
... ...
... ... @@ -14,7 +14,7 @@ var KafkaCfg KafkaConfig
func init() {
KafkaCfg = KafkaConfig{
Servers: []string{"127.0.0.1:9092"},
Servers: []string{"106.52.15.41:9092"},
ConsumerId: "partnermg_dev",
}
if os.Getenv("KAFKA_HOST") != "" {
... ...
... ... @@ -183,7 +183,8 @@ func (reponsitory UsersRepository) Find(queryOption domain.UsersFindQuery) (int,
usersReturn = make([]domain.Users, 0)
cnt int
)
query = query.Order("id DESC")
//query = query.Order("id DESC")
query = query.Order("admin_type DESC")
cnt, err = query.SelectAndCount()
if err != nil {
return 0, usersReturn, err
... ...