保存当前版本号
This commit is contained in:
@@ -58,7 +58,8 @@ public class MybatisPlusConfig {
|
|||||||
"sys_dictionary_data",
|
"sys_dictionary_data",
|
||||||
"sys_user_oauth",
|
"sys_user_oauth",
|
||||||
"sys_email_record",
|
"sys_email_record",
|
||||||
"sys_plug"
|
"sys_plug",
|
||||||
|
"sys_version"
|
||||||
).contains(tableName);
|
).contains(tableName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -73,10 +73,10 @@ public class SocketIOConfig implements InitializingBean {
|
|||||||
config.setKeyStorePassword("123456"); // 设置证书密码
|
config.setKeyStorePassword("123456"); // 设置证书密码
|
||||||
|
|
||||||
// 启动socket服务
|
// 启动socket服务
|
||||||
// SocketIOServer server = new SocketIOServer(config);
|
SocketIOServer server = new SocketIOServer(config);
|
||||||
// server.addListeners(socketIOHandler);
|
server.addListeners(socketIOHandler);
|
||||||
// server.start();
|
server.start();
|
||||||
// ClientCache.setSocketIOServer(server);
|
ClientCache.setSocketIOServer(server);
|
||||||
// logger.debug("Netty SocketIO启动:{}:{}",host,port);
|
logger.debug("Netty SocketIO启动:{}:{}",host,port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
package com.gxwebsoft.common.system.controller;
|
package com.gxwebsoft.common.system.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
import com.gxwebsoft.common.core.web.*;
|
import com.gxwebsoft.common.core.web.*;
|
||||||
import com.gxwebsoft.common.system.entity.Company;
|
import com.gxwebsoft.common.system.entity.Company;
|
||||||
import com.gxwebsoft.common.system.entity.Menu;
|
import com.gxwebsoft.common.system.entity.Menu;
|
||||||
|
import com.gxwebsoft.common.system.entity.Version;
|
||||||
import com.gxwebsoft.common.system.param.MenuParam;
|
import com.gxwebsoft.common.system.param.MenuParam;
|
||||||
|
import com.gxwebsoft.common.system.param.VersionParam;
|
||||||
import com.gxwebsoft.common.system.service.CompanyService;
|
import com.gxwebsoft.common.system.service.CompanyService;
|
||||||
import com.gxwebsoft.common.system.service.MenuService;
|
import com.gxwebsoft.common.system.service.MenuService;
|
||||||
|
import com.gxwebsoft.common.system.service.VersionService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -29,6 +34,8 @@ public class MenuController extends BaseController {
|
|||||||
private MenuService menuService;
|
private MenuService menuService;
|
||||||
@Resource
|
@Resource
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
|
@Resource
|
||||||
|
private VersionService versionService;
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('sys:menu:list')")
|
@PreAuthorize("hasAuthority('sys:menu:list')")
|
||||||
@OperationLog
|
@OperationLog
|
||||||
@@ -136,7 +143,16 @@ public class MenuController extends BaseController {
|
|||||||
Company company = new Company();
|
Company company = new Company();
|
||||||
company.setCompanyId(companyId);
|
company.setCompanyId(companyId);
|
||||||
company.setPlanId(param.getTenantId());
|
company.setPlanId(param.getTenantId());
|
||||||
|
VersionParam versionParam = new VersionParam();
|
||||||
|
versionParam.setLimit(1L);
|
||||||
|
final PageResult<Version> result = versionService.pageRel(versionParam);
|
||||||
|
if (!CollectionUtils.isEmpty(result.getList())) {
|
||||||
|
Version version = result.getList().get(0);
|
||||||
|
company.setVersionName(version.getVersionName());
|
||||||
|
company.setVersionCode(version.getVersionCode());
|
||||||
|
}
|
||||||
companyService.updateById(company);
|
companyService.updateById(company);
|
||||||
|
|
||||||
return success("安装成功");
|
return success("安装成功");
|
||||||
}
|
}
|
||||||
return fail("安装失败");
|
return fail("安装失败");
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class RoleController extends BaseController {
|
|||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<Role>> page(RoleParam param) {
|
public ApiResult<PageResult<Role>> page(RoleParam param) {
|
||||||
PageParam<Role, RoleParam> page = new PageParam<>(param);
|
PageParam<Role, RoleParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc");
|
||||||
return success(roleService.page(page, page.getWrapper()));
|
return success(roleService.page(page, page.getWrapper()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +48,7 @@ public class RoleController extends BaseController {
|
|||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<Role>> list(RoleParam param) {
|
public ApiResult<List<Role>> list(RoleParam param) {
|
||||||
PageParam<Role, RoleParam> page = new PageParam<>(param);
|
PageParam<Role, RoleParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc");
|
||||||
return success(roleService.list(page.getOrderWrapper()));
|
return success(roleService.list(page.getOrderWrapper()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,9 +76,9 @@ public class VersionController extends BaseController {
|
|||||||
version.setUserId(loginUser.getUserId());
|
version.setUserId(loginUser.getUserId());
|
||||||
}
|
}
|
||||||
if (versionService.save(version)) {
|
if (versionService.save(version)) {
|
||||||
return success("添加成功");
|
return success("发布成功");
|
||||||
}
|
}
|
||||||
return fail("添加失败");
|
return fail("发布失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('sys:version:save')")
|
@PreAuthorize("hasAuthority('sys:version:save')")
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ public class Role implements Serializable {
|
|||||||
@ApiModelProperty("备注")
|
@ApiModelProperty("备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
@ApiModelProperty("是否删除, 0否, 1是")
|
@ApiModelProperty("是否删除, 0否, 1是")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class Version implements Serializable {
|
|||||||
private String versionName;
|
private String versionName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "版本号")
|
@ApiModelProperty(value = "版本号")
|
||||||
private Integer versionCode;
|
private String versionCode;
|
||||||
|
|
||||||
@ApiModelProperty(value = "下载链接")
|
@ApiModelProperty(value = "下载链接")
|
||||||
private String vueDownloadUrl;
|
private String vueDownloadUrl;
|
||||||
|
|||||||
Reference in New Issue
Block a user