mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-06-21 17:44:57 +08:00
feat 同步前端代码
feat 同步PC代码 feat 增加1.9DB feat 同步逻辑
This commit is contained in:
@@ -22,19 +22,4 @@ public class IndexController {
|
||||
@Resource
|
||||
IIndexService iIndexService;
|
||||
|
||||
@GetMapping("/console")
|
||||
@ApiOperation(value="控制台")
|
||||
public AjaxResult<Map<String, Object>> console() {
|
||||
Map<String, Object> map = iIndexService.console();
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
@NotLogin
|
||||
@GetMapping("/config")
|
||||
@ApiOperation(value="公共配置")
|
||||
public AjaxResult<Map<String, Object>> config() {
|
||||
Map<String, Object> map = iIndexService.config();
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.mdd.admin.controller.adminapi;
|
||||
|
||||
import com.mdd.admin.service.IIndexService;
|
||||
import com.mdd.common.aop.NotLogin;
|
||||
import com.mdd.common.core.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("adminapi/config")
|
||||
@Api(tags = "主页数据管理")
|
||||
public class ConfigController {
|
||||
|
||||
@Resource
|
||||
IIndexService iIndexService;
|
||||
@NotLogin
|
||||
@GetMapping("/getConfig")
|
||||
@ApiOperation(value="公共配置")
|
||||
public AjaxResult<Map<String, Object>> getConfig() {
|
||||
Map<String, Object> map = iIndexService.config();
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mdd.admin.controller.system;
|
||||
package com.mdd.admin.controller.adminapi;
|
||||
|
||||
import com.mdd.common.aop.NotLogin;
|
||||
import com.mdd.common.aop.NotPower;
|
||||
import com.mdd.admin.service.ISystemLoginService;
|
||||
import com.mdd.admin.validate.system.SystemAdminLoginsValidate;
|
||||
import com.mdd.admin.vo.system.SystemCaptchaVo;
|
||||
import com.mdd.admin.vo.system.SystemLoginVo;
|
||||
import com.mdd.common.aop.NotLogin;
|
||||
import com.mdd.common.aop.NotPower;
|
||||
import com.mdd.common.core.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -16,9 +16,9 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/system")
|
||||
@RequestMapping("adminapi/login")
|
||||
@Api(tags = "系统登录管理")
|
||||
public class SystemLoginController {
|
||||
public class LoginController {
|
||||
|
||||
@Resource
|
||||
ISystemLoginService iSystemLoginService;
|
||||
@@ -20,4 +20,6 @@ public interface IIndexService {
|
||||
*/
|
||||
Map<String, Object> config();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -66,19 +66,24 @@ public class IndexServiceImpl implements IIndexService {
|
||||
@Override
|
||||
public Map<String, Object> config() {
|
||||
Map<String, String> website = ConfigUtils.get("website");
|
||||
String copyright = ConfigUtils.get("website", "copyright", "");
|
||||
String copyright = ConfigUtils.get("copyright", "config", "");
|
||||
|
||||
String captchaStatus = YmlUtils.get("like.captcha.status");
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("loginCaptcha", StringUtils.isNotNull(captchaStatus) && captchaStatus.equals("true"));
|
||||
map.put("webName", website.getOrDefault("name", ""));
|
||||
map.put("webLogo", UrlUtils.toAbsoluteUrl(website.getOrDefault("logo", "")));
|
||||
map.put("webFavicon", UrlUtils.toAbsoluteUrl(website.getOrDefault("favicon", "")));
|
||||
map.put("webBackdrop", UrlUtils.toAbsoluteUrl(website.getOrDefault("backdrop", "")));
|
||||
map.put("ossDomain", UrlUtils.domain());
|
||||
map.put("copyright", ListUtils.stringToListAsMapStr(copyright));
|
||||
|
||||
// 文件域名
|
||||
map.put("oss_domain", UrlUtils.domain());
|
||||
//map.put("loginCaptcha", StringUtils.isNotNull(captchaStatus) && captchaStatus.equals("true"));
|
||||
// 网站名称
|
||||
map.put("web_name", website.getOrDefault("name", ""));
|
||||
// 网站图标
|
||||
map.put("web_favicon", UrlUtils.toAbsoluteUrl(website.getOrDefault("web_favicon", "")));
|
||||
// 网站logo
|
||||
map.put("web_logo", UrlUtils.toAbsoluteUrl(website.getOrDefault("web_logo", "")));
|
||||
// 登录页
|
||||
map.put("login_image", UrlUtils.toAbsoluteUrl(website.getOrDefault("login_image", "")));
|
||||
// 版权信息
|
||||
map.put("copyright_config", ListUtils.stringToListAsMapStr(copyright));
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.mdd.common.cache;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mdd.common.entity.system.SystemConfig;
|
||||
import com.mdd.common.mapper.system.SystemConfigMapper;
|
||||
import com.mdd.common.entity.Config;
|
||||
import com.mdd.common.mapper.ConfigMapper;
|
||||
import com.mdd.common.util.*;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -22,13 +22,13 @@ public class ConfigCache {
|
||||
* 设置缓存配置
|
||||
*/
|
||||
public static void set() {
|
||||
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
||||
ConfigMapper model = SpringUtils.getBean(ConfigMapper.class);
|
||||
// 查询全部配置项,设置缓存
|
||||
List<SystemConfig> configs = model.selectList(
|
||||
new QueryWrapper<SystemConfig>()
|
||||
List<Config> configs = model.selectList(
|
||||
new QueryWrapper<Config>()
|
||||
.select("id", "type", "name", "value")
|
||||
);
|
||||
List<String> typeList = configs.stream().map(SystemConfig::getType)
|
||||
List<String> typeList = configs.stream().map(Config::getType)
|
||||
.collect(Collectors.toList())
|
||||
.stream().distinct()
|
||||
.collect(Collectors.toList());
|
||||
@@ -37,7 +37,7 @@ public class ConfigCache {
|
||||
Map<String, Object> subMap = new LinkedHashMap<>();
|
||||
for (String typeItem : typeList) {
|
||||
subMap.clear();
|
||||
for (SystemConfig configItem : configs) {
|
||||
for (Config configItem : configs) {
|
||||
if (configItem.getType().equals(typeItem)) {
|
||||
subMap.put(configItem.getName(), configItem.getValue());
|
||||
}
|
||||
@@ -60,7 +60,9 @@ public class ConfigCache {
|
||||
Map<String, String> configType = MapUtils.jsonToMap(configs.toString());
|
||||
if (!StringUtils.isEmpty(configType)) {
|
||||
Map<String, String> configData = MapUtils.jsonToMap(configType.get(type));
|
||||
return configData.get(name);
|
||||
if (StringUtils.isNotNull(configData)) {
|
||||
return configData.get(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -12,7 +12,7 @@ public class GlobalConfig {
|
||||
public static Boolean isAddressEnabled = false;
|
||||
|
||||
// 当前代码版本
|
||||
public static String version = "v1.5.0";
|
||||
public static String version = "v1.9.0";
|
||||
|
||||
// 系统加密字符
|
||||
public static String secret = "UVTIyzCy";
|
||||
|
||||
@@ -5,8 +5,8 @@ import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
|
||||
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.mdd.common.entity.system.SystemConfig;
|
||||
import com.mdd.common.mapper.system.SystemConfigMapper;
|
||||
import com.mdd.common.entity.Config;
|
||||
import com.mdd.common.mapper.ConfigMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
|
||||
@@ -30,7 +30,7 @@ import java.util.Map;
|
||||
public class WxMnpConfiguration {
|
||||
|
||||
@Resource
|
||||
private final SystemConfigMapper systemConfigMapper;
|
||||
private final ConfigMapper systemConfigMapper;
|
||||
|
||||
/**
|
||||
* 微信小程序配置
|
||||
@@ -82,13 +82,13 @@ public class WxMnpConfiguration {
|
||||
* @return Map<String, String>
|
||||
*/
|
||||
private Map<String, String> getChannelConfig(String type) {
|
||||
List<SystemConfig> configs = systemConfigMapper.selectList(
|
||||
new QueryWrapper<SystemConfig>()
|
||||
List<Config> configs = systemConfigMapper.selectList(
|
||||
new QueryWrapper<Config>()
|
||||
.select("id", "type", "name", "value")
|
||||
.eq("type", type));
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
for (SystemConfig config : configs) {
|
||||
for (Config config : configs) {
|
||||
map.put(config.getName(), config.getValue());
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
|
||||
import com.mdd.common.entity.setting.DevPayConfig;
|
||||
import com.mdd.common.entity.system.SystemConfig;
|
||||
import com.mdd.common.entity.Config;
|
||||
import com.mdd.common.enums.PaymentEnum;
|
||||
import com.mdd.common.mapper.setting.DevPayConfigMapper;
|
||||
import com.mdd.common.mapper.system.SystemConfigMapper;
|
||||
import com.mdd.common.mapper.ConfigMapper;
|
||||
import com.mdd.common.util.MapUtils;
|
||||
import com.mdd.common.util.StringUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -29,7 +29,7 @@ public class WxPayConfiguration {
|
||||
DevPayConfigMapper devPayConfigMapper;
|
||||
|
||||
@Resource
|
||||
SystemConfigMapper systemConfigMapper;
|
||||
ConfigMapper systemConfigMapper;
|
||||
|
||||
/**
|
||||
* 微信小程序支付配置
|
||||
@@ -45,7 +45,7 @@ public class WxPayConfiguration {
|
||||
.eq("way", PaymentEnum.WX_PAY.getCode())
|
||||
.last("limit 1"));
|
||||
|
||||
SystemConfig systemConfig = systemConfigMapper.selectOne(new QueryWrapper<SystemConfig>()
|
||||
Config systemConfig = systemConfigMapper.selectOne(new QueryWrapper<Config>()
|
||||
.eq("type", "mp_channel")
|
||||
.eq("name", "appId")
|
||||
.last("limit 1"));
|
||||
@@ -84,7 +84,7 @@ public class WxPayConfiguration {
|
||||
.eq("way", PaymentEnum.WX_PAY.getCode())
|
||||
.last("limit 1"));
|
||||
|
||||
SystemConfig systemConfig = systemConfigMapper.selectOne(new QueryWrapper<SystemConfig>()
|
||||
Config systemConfig = systemConfigMapper.selectOne(new QueryWrapper<Config>()
|
||||
.eq("name", "appId")
|
||||
.eq("type", "oa_channel")
|
||||
.last("limit 1"));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mdd.common.entity.system;
|
||||
package com.mdd.common.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -10,7 +10,7 @@ import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("系统配置实体")
|
||||
public class SystemConfig implements Serializable {
|
||||
public class Config implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -27,9 +27,6 @@ public class SystemConfig implements Serializable {
|
||||
@ApiModelProperty("值")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty("备注信息")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Long createTime;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.mdd.common.mapper;
|
||||
|
||||
import com.mdd.common.core.basics.IBaseMapper;
|
||||
import com.mdd.common.entity.Config;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConfigMapper extends IBaseMapper<Config> {
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.mdd.common.mapper.system;
|
||||
|
||||
import com.mdd.common.core.basics.IBaseMapper;
|
||||
import com.mdd.common.entity.system.SystemConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 系统配置
|
||||
*/
|
||||
@Mapper
|
||||
public interface SystemConfigMapper extends IBaseMapper<SystemConfig> {
|
||||
}
|
||||
@@ -2,8 +2,8 @@ package com.mdd.common.util;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mdd.common.cache.ConfigCache;
|
||||
import com.mdd.common.entity.system.SystemConfig;
|
||||
import com.mdd.common.mapper.system.SystemConfigMapper;
|
||||
import com.mdd.common.entity.Config;
|
||||
import com.mdd.common.mapper.ConfigMapper;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -27,14 +27,14 @@ public class ConfigUtils {
|
||||
return cache;
|
||||
}
|
||||
|
||||
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
||||
List<SystemConfig> configs = model.selectList(
|
||||
new QueryWrapper<SystemConfig>()
|
||||
ConfigMapper model = SpringUtils.getBean(ConfigMapper.class);
|
||||
List<Config> configs = model.selectList(
|
||||
new QueryWrapper<Config>()
|
||||
.select("id", "type"+"", "name", "value")
|
||||
.eq("type", type));
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
for (SystemConfig config : configs) {
|
||||
for (Config config : configs) {
|
||||
map.put(config.getName(), config.getValue());
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ public class ConfigUtils {
|
||||
return cache;
|
||||
}
|
||||
|
||||
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
||||
SystemConfig config = model.selectOne(
|
||||
new QueryWrapper<SystemConfig>()
|
||||
ConfigMapper model = SpringUtils.getBean(ConfigMapper.class);
|
||||
Config config = model.selectOne(
|
||||
new QueryWrapper<Config>()
|
||||
.select("id", "type", "name", "value")
|
||||
.eq("name", name)
|
||||
.eq("type", type));
|
||||
@@ -81,9 +81,9 @@ public class ConfigUtils {
|
||||
return cache;
|
||||
}
|
||||
|
||||
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
||||
SystemConfig config = model.selectOne(
|
||||
new QueryWrapper<SystemConfig>()
|
||||
ConfigMapper model = SpringUtils.getBean(ConfigMapper.class);
|
||||
Config config = model.selectOne(
|
||||
new QueryWrapper<Config>()
|
||||
.select("id", "type", "name", "value")
|
||||
.eq("type", type)
|
||||
.eq("name", name));
|
||||
@@ -110,10 +110,10 @@ public class ConfigUtils {
|
||||
return MapUtils.jsonToMap(cache);
|
||||
}
|
||||
|
||||
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
||||
ConfigMapper model = SpringUtils.getBean(ConfigMapper.class);
|
||||
|
||||
SystemConfig config = model.selectOne(
|
||||
new QueryWrapper<SystemConfig>()
|
||||
Config config = model.selectOne(
|
||||
new QueryWrapper<Config>()
|
||||
.select("id", "type", "name", "value")
|
||||
.eq("type", type)
|
||||
.eq("name", name));
|
||||
@@ -139,9 +139,9 @@ public class ConfigUtils {
|
||||
* @param val 值
|
||||
*/
|
||||
public static void set(String type, String name, String val) {
|
||||
SystemConfigMapper model = SpringUtils.getBean(SystemConfigMapper.class);
|
||||
SystemConfig config = model.selectOne(
|
||||
new QueryWrapper<SystemConfig>()
|
||||
ConfigMapper model = SpringUtils.getBean(ConfigMapper.class);
|
||||
Config config = model.selectOne(
|
||||
new QueryWrapper<Config>()
|
||||
.eq("type", type)
|
||||
.eq("name", name));
|
||||
|
||||
@@ -150,7 +150,7 @@ public class ConfigUtils {
|
||||
config.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
model.updateById(config);
|
||||
} else {
|
||||
SystemConfig systemConfig = new SystemConfig();
|
||||
Config systemConfig = new Config();
|
||||
systemConfig.setType(type);
|
||||
systemConfig.setName(name);
|
||||
systemConfig.setValue(val);
|
||||
|
||||
Reference in New Issue
Block a user