first commit
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package com.qiaoba.module.tenant.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.qiaoba.common.base.enums.BaseEnum;
|
||||
import com.qiaoba.common.base.result.AjaxResult;
|
||||
import com.qiaoba.common.base.validate.AddGroup;
|
||||
import com.qiaoba.common.base.validate.EditGroup;
|
||||
@ -19,7 +18,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
/**
|
||||
* 租户管理 Web层
|
||||
@ -37,7 +38,6 @@ public class SysTenantController {
|
||||
private final SysTenantService sysTenantService;
|
||||
private final MysqlHandler mysqlHandler;
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('tenant:add')")
|
||||
@PostMapping
|
||||
@Operation(summary = "新增租户")
|
||||
@ -68,12 +68,8 @@ public class SysTenantController {
|
||||
|
||||
@GetMapping("/normal-list")
|
||||
@Operation(summary = "获取正常列表")
|
||||
public TableDataInfo<SysTenant> normalPageList(SysTenantParam param, PageQuery pageQuery) {
|
||||
param.setTime(new Date());
|
||||
param.setStatus(BaseEnum.NORMAL.getCode());
|
||||
param.setType(SysTenantParam.TYPE_NOT_EXPIRED);
|
||||
param.setIsLogin(true);
|
||||
return sysTenantService.selectPageList(param, pageQuery);
|
||||
public TableDataInfo<SysTenant> normalPageList(PageQuery pageQuery) {
|
||||
return sysTenantService.selectPageList(SysTenantParam.buildNormalSelectParam(), pageQuery);
|
||||
}
|
||||
|
||||
@GetMapping("/getSetting/{tenantId}")
|
||||
@ -90,4 +86,24 @@ public class SysTenantController {
|
||||
return AjaxResult.success(sysTenantService.update(BeanUtil.copyProperties(dto, SysTenant.class)));
|
||||
}
|
||||
|
||||
@GetMapping("/test")
|
||||
public void test(HttpServletResponse response) throws Exception {
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
PrintWriter writer = response.getWriter();
|
||||
int i = 0;
|
||||
while (i < 101) {
|
||||
String text = null;
|
||||
if (i == 100) {
|
||||
text = "<div style=\"color:#00FF00\"><h3>恭喜!升级完成</h3></div>";
|
||||
} else {
|
||||
text = "<div style=\"color:#FF0000\"><h3>升级进度:[" + i + "]</h3></div>";
|
||||
}
|
||||
writer.write(text);
|
||||
writer.flush();
|
||||
i = i + 10;
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.qiaoba.module.tenant.entity.param;
|
||||
|
||||
import com.qiaoba.common.base.enums.BaseEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -40,5 +41,17 @@ public class SysTenantParam implements Serializable {
|
||||
@Schema(description = "类型(1正常 2过期)")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否是登陆接口
|
||||
*/
|
||||
private Boolean isLogin = false;
|
||||
|
||||
public static SysTenantParam buildNormalSelectParam() {
|
||||
SysTenantParam param = new SysTenantParam();
|
||||
param.setTime(new Date());
|
||||
param.setStatus(BaseEnum.NORMAL.getCode());
|
||||
param.setType(SysTenantParam.TYPE_NOT_EXPIRED);
|
||||
param.setIsLogin(true);
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ public class SysTenantServiceImpl implements SysTenantService {
|
||||
wrapper.lambda().lt(Objects.nonNull(param.getTime()), SysTenant::getExpireTime, param.getTime());
|
||||
}
|
||||
|
||||
// 登录接口
|
||||
// 登录接口, 只返回ID和名字两个字段
|
||||
if (param.getIsLogin()) {
|
||||
wrapper.lambda()
|
||||
.select(SysTenant::getCompanyName, SysTenant::getTenantId);
|
||||
|
Reference in New Issue
Block a user