update to v2.0.0,新增搜索中心,并集成用户中心和日志中心;首页新增流量统计
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.zlt</groupId>
|
||||
<artifactId>zlt-business</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<artifactId>user-center</artifactId>
|
||||
<description>用户中心</description>
|
||||
@@ -39,6 +39,10 @@
|
||||
<groupId>com.zlt</groupId>
|
||||
<artifactId>zlt-swagger2-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zlt</groupId>
|
||||
<artifactId>search-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.central;
|
||||
|
||||
import com.central.common.annotation.EnableLoginArgResolver;
|
||||
import com.central.search.annotation.EnableSearchClient;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
@@ -12,7 +13,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
*/
|
||||
@EnableLoginArgResolver
|
||||
@EnableDiscoveryClient
|
||||
@EnableFeignClients
|
||||
@EnableSearchClient
|
||||
@EnableTransactionManagement
|
||||
@SpringBootApplication
|
||||
public class UserCenterApp {
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.central.user.config;
|
||||
|
||||
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
|
||||
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
|
||||
import com.central.db.config.DefaultMybatisPlusConfig;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
@@ -14,11 +11,4 @@ import org.springframework.context.annotation.Configuration;
|
||||
@Configuration
|
||||
@MapperScan({"com.central.user.mapper*"})
|
||||
public class MybatisPlusConfig extends DefaultMybatisPlusConfig {
|
||||
/**
|
||||
* 逻辑删除注入器
|
||||
*/
|
||||
@Bean
|
||||
public ISqlInjector sqlInjector(){
|
||||
return new LogicSqlInjector();
|
||||
}
|
||||
}
|
||||
|
||||
+25
@@ -7,10 +7,14 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.central.common.annotation.LoginUser;
|
||||
import com.central.common.constant.CommonConstant;
|
||||
import com.central.common.model.*;
|
||||
import com.central.common.utils.ExcelUtil;
|
||||
import com.central.search.client.service.IQueryService;
|
||||
import com.central.search.model.LogicDelDto;
|
||||
import com.central.search.model.SearchDto;
|
||||
import com.central.user.model.SysUserExcel;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -40,9 +44,17 @@ import javax.servlet.http.HttpServletResponse;
|
||||
public class SysUserController {
|
||||
private static final String ADMIN_CHANGE_MSG = "超级管理员不给予修改";
|
||||
|
||||
/**
|
||||
* 全文搜索逻辑删除Dto
|
||||
*/
|
||||
private static final LogicDelDto SEARCH_LOGIC_DEL_DTO = new LogicDelDto("isDel", "否");
|
||||
|
||||
@Autowired
|
||||
private ISysUserService appUserService;
|
||||
|
||||
@Autowired
|
||||
private IQueryService queryService;
|
||||
|
||||
/**
|
||||
* 当前登录用户 LoginAppUser
|
||||
*
|
||||
@@ -255,6 +267,19 @@ public class SysUserController {
|
||||
return Result.succeed("导入数据成功,一共【"+rowNum+"】行");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户全文搜索列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "queryStr", value = "搜索关键字", dataType = "String")
|
||||
})
|
||||
@GetMapping("/users/search")
|
||||
public PageResult<JSONObject> search(SearchDto searchDto) {
|
||||
searchDto.setIsHighlighter(true);
|
||||
searchDto.setSortCol("createTime");
|
||||
return queryService.strQuery("sys_user", searchDto, SEARCH_LOGIC_DEL_DTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否超级管理员
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.central.user.model;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.central.common.constant.CommonConstant;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -26,9 +27,9 @@ public class SysUserExcel implements Serializable {
|
||||
@Excel(name = "学生性别", replace = { "男_0", "女_1" }, suffix = "生", isImportField = "true_st")
|
||||
private Integer sex;
|
||||
|
||||
@Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss", isImportField = "true_st", width = 20)
|
||||
@Excel(name = "创建时间", format = CommonConstant.DATETIME_FORMAT, isImportField = "true_st", width = 20)
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "修改时间", format = "yyyy-MM-dd HH:mm:ss", isImportField = "true_st", width = 20)
|
||||
@Excel(name = "修改时间", format = CommonConstant.DATETIME_FORMAT, isImportField = "true_st", width = 20)
|
||||
private Date updateTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user