增加渠道设置接口
This commit is contained in:
parent
896c06c657
commit
77c4ef41ae
|
|
@ -0,0 +1,47 @@
|
|||
package com.mdd.admin.controller.channel;
|
||||
|
||||
import com.mdd.admin.config.aop.Log;
|
||||
import com.mdd.admin.service.channel.IChannelH5Service;
|
||||
import com.mdd.common.core.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* H5渠道设置
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/channel/h5")
|
||||
public class H5Controller {
|
||||
|
||||
@Resource
|
||||
IChannelH5Service iChannelH5Service;
|
||||
|
||||
/**
|
||||
* H5渠道配置详情
|
||||
*
|
||||
* @author fzr
|
||||
* @return Object
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public Object detail() {
|
||||
Map<String, Object> map = iChannelH5Service.detail();
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* H5渠道配置保存
|
||||
*
|
||||
* @author fzr
|
||||
* @param param 参数
|
||||
* @return Object
|
||||
*/
|
||||
@Log(title = "H5渠道保存")
|
||||
@PostMapping("/save")
|
||||
public Object save(@RequestBody Map<String, String> param) {
|
||||
iChannelH5Service.save(param);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.mdd.admin.controller.channel;
|
||||
|
||||
import com.mdd.admin.config.aop.Log;
|
||||
import com.mdd.admin.service.channel.IChannelMpService;
|
||||
import com.mdd.common.core.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信小程序渠道设置
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/channel/mp")
|
||||
public class MpController {
|
||||
|
||||
@Resource
|
||||
IChannelMpService iChannelMpService;
|
||||
|
||||
/**
|
||||
* 微信小程序渠道配置详情
|
||||
*
|
||||
* @author fzr
|
||||
* @return Object
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public Object detail() {
|
||||
Map<String, Object> map = iChannelMpService.detail();
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序渠道配置保存
|
||||
*
|
||||
* @author fzr
|
||||
* @param param 参数
|
||||
* @return Object
|
||||
*/
|
||||
@Log(title = "微信小程序渠道保存")
|
||||
@PostMapping("/save")
|
||||
public Object save(@RequestBody Map<String, String> param) {
|
||||
iChannelMpService.save(param);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.mdd.admin.controller.channel;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 微信公众号渠道设置
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/channel/oa")
|
||||
public class OaController {
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.mdd.admin.controller.channel;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 微信开发平台渠道设置
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/channel/wx")
|
||||
public class WxController {
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.mdd.admin.service.channel;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* H5渠道设置服务接口类
|
||||
*/
|
||||
public interface IChannelH5Service {
|
||||
|
||||
/**
|
||||
* H5设置详情
|
||||
*
|
||||
* @author fzr
|
||||
* @return Map<String, String>
|
||||
*/
|
||||
Map<String, Object> detail();
|
||||
|
||||
/**
|
||||
* H5设置保存
|
||||
*
|
||||
* @author fzr
|
||||
*/
|
||||
void save(Map<String, String> param);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.mdd.admin.service.channel;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信小程序渠道服务接口类
|
||||
*/
|
||||
public interface IChannelMpService {
|
||||
|
||||
/**
|
||||
* 微信小程序设置详情
|
||||
*
|
||||
* @author fzr
|
||||
* @return Map<String, String>
|
||||
*/
|
||||
Map<String, Object> detail();
|
||||
|
||||
/**
|
||||
* 微信小程序设置保存
|
||||
*
|
||||
* @author fzr
|
||||
*/
|
||||
void save(Map<String, String> param);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.mdd.admin.service.channel;
|
||||
|
||||
public interface IChannelOaService {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.mdd.admin.service.channel;
|
||||
|
||||
public interface IChannelWxService {
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.mdd.admin.service.channel.impl;
|
||||
|
||||
import com.mdd.admin.service.channel.IChannelH5Service;
|
||||
import com.mdd.common.utils.ConfigUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* H5渠道设置服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class ChannelH5ServiceImpl implements IChannelH5Service {
|
||||
|
||||
/**
|
||||
* H5渠道配置详情
|
||||
*
|
||||
* @author fzr
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> detail() {
|
||||
Map<String, String> config = ConfigUtil.get("h5_channel");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("status", Integer.parseInt(config.getOrDefault("status", "0")));
|
||||
map.put("close", Integer.parseInt(config.getOrDefault("close", "0")));
|
||||
map.put("url", config.getOrDefault("url", ""));
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* H5渠道配置保存
|
||||
*
|
||||
* @author fzr
|
||||
* @param param 参数
|
||||
*/
|
||||
@Override
|
||||
public void save(Map<String, String> param) {
|
||||
ConfigUtil.set("h5_channel", "status", param.getOrDefault("status", "0"));
|
||||
ConfigUtil.set("h5_channel", "close", param.getOrDefault("close", "0"));
|
||||
ConfigUtil.set("h5_channel", "url", param.getOrDefault("url", "0"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.mdd.admin.service.channel.impl;
|
||||
|
||||
import com.mdd.admin.service.channel.IChannelMpService;
|
||||
import com.mdd.common.utils.ConfigUtil;
|
||||
import com.mdd.common.utils.UrlUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信小程序渠道服务实现类
|
||||
*/
|
||||
@Service
|
||||
public class ChannelMpServiceImpl implements IChannelMpService {
|
||||
|
||||
/**
|
||||
* 微信小程序渠道详情
|
||||
*
|
||||
* @author fzr
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> detail() {
|
||||
Map<String, String> config = ConfigUtil.get("mp_channel");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("name", config.getOrDefault("name", ""));
|
||||
map.put("primaryId", config.getOrDefault("primaryId", ""));
|
||||
map.put("appId", config.getOrDefault("appId", ""));
|
||||
map.put("appSecret", config.getOrDefault("appSecret", ""));
|
||||
map.put("qrCode", UrlUtil.toAbsoluteUrl(config.getOrDefault("qrCode", "")));
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序渠道保存
|
||||
*
|
||||
* @author fzr
|
||||
* @param param 参数
|
||||
*/
|
||||
@Override
|
||||
public void save(Map<String, String> param) {
|
||||
ConfigUtil.set("mp_channel", "name", param.getOrDefault("name", ""));
|
||||
ConfigUtil.set("mp_channel", "primaryId", param.getOrDefault("primaryId", ""));
|
||||
ConfigUtil.set("mp_channel", "appId", param.getOrDefault("appId", ""));
|
||||
ConfigUtil.set("mp_channel", "appSecret", param.getOrDefault("appSecret", ""));
|
||||
ConfigUtil.set("mp_channel", "qrCode", UrlUtil.toRelativeUrl(param.getOrDefault("qrCode", "")));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.mdd.admin.service.channel.impl;
|
||||
|
||||
public class ChannelOaServiceImpl {
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.mdd.admin.service.channel.impl;
|
||||
|
||||
public class ChannelWxServiceImpl {
|
||||
}
|
||||
Loading…
Reference in New Issue