增加渠道设置
This commit is contained in:
parent
f5814b242a
commit
00a9b9ede0
|
|
@ -19,7 +19,7 @@ public class H5Controller {
|
||||||
IChannelH5Service iChannelH5Service;
|
IChannelH5Service iChannelH5Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5渠道配置详情
|
* H5渠道设置详情
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @return Object
|
* @return Object
|
||||||
|
|
@ -31,13 +31,13 @@ public class H5Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5渠道配置保存
|
* H5渠道设置保存
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param param 参数
|
* @param param 参数
|
||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
@Log(title = "H5渠道保存")
|
@Log(title = "H5渠道设置保存")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public Object save(@RequestBody Map<String, String> param) {
|
public Object save(@RequestBody Map<String, String> param) {
|
||||||
iChannelH5Service.save(param);
|
iChannelH5Service.save(param);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ public class MpController {
|
||||||
IChannelMpService iChannelMpService;
|
IChannelMpService iChannelMpService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序渠道配置详情
|
* 微信小程序渠道设置详情
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @return Object
|
* @return Object
|
||||||
|
|
@ -31,13 +31,13 @@ public class MpController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序渠道配置保存
|
* 微信小程序渠道设置保存
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param param 参数
|
* @param param 参数
|
||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
@Log(title = "微信小程序渠道保存")
|
@Log(title = "微信小程序渠道设置保存")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public Object save(@RequestBody Map<String, String> param) {
|
public Object save(@RequestBody Map<String, String> param) {
|
||||||
iChannelMpService.save(param);
|
iChannelMpService.save(param);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,13 @@
|
||||||
package com.mdd.admin.controller.channel;
|
package com.mdd.admin.controller.channel;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.mdd.admin.config.aop.Log;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import com.mdd.admin.service.channel.IChannelH5Service;
|
||||||
|
import com.mdd.admin.service.channel.IChannelOaService;
|
||||||
|
import com.mdd.common.core.AjaxResult;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信公众号渠道设置
|
* 微信公众号渠道设置
|
||||||
|
|
@ -9,4 +15,34 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("api/channel/oa")
|
@RequestMapping("api/channel/oa")
|
||||||
public class OaController {
|
public class OaController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IChannelOaService iChannelOaService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号渠道设置详情
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public Object detail() {
|
||||||
|
Map<String, Object> map = iChannelOaService.detail();
|
||||||
|
return AjaxResult.success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号渠道设置保存
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @param param 参数
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
@Log(title = "公众号渠道设置保存")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public Object save(@RequestBody Map<String, String> param) {
|
||||||
|
iChannelOaService.save(param);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public class WxController {
|
||||||
IChannelWxService iChannelWxService;
|
IChannelWxService iChannelWxService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5渠道配置详情
|
* 开放平台渠道设置详情
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @return Object
|
* @return Object
|
||||||
|
|
@ -32,13 +32,13 @@ public class WxController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H5渠道配置保存
|
* 开放平台渠道设置保存
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param param 参数
|
* @param param 参数
|
||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
@Log(title = "微信开放平台渠道保存")
|
@Log(title = "开放平台渠道设置保存")
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
public Object save(@RequestBody Map<String, String> param) {
|
public Object save(@RequestBody Map<String, String> param) {
|
||||||
iChannelWxService.save(param);
|
iChannelWxService.save(param);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,25 @@
|
||||||
package com.mdd.admin.service.channel;
|
package com.mdd.admin.service.channel;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号渠道设置服务接口类
|
||||||
|
*/
|
||||||
public interface IChannelOaService {
|
public interface IChannelOaService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号设置详情
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @return Map<String, String>
|
||||||
|
*/
|
||||||
|
Map<String, Object> detail();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号设置保存
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
*/
|
||||||
|
void save(Map<String, String> param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,50 @@
|
||||||
package com.mdd.admin.service.channel.impl;
|
package com.mdd.admin.service.channel.impl;
|
||||||
|
|
||||||
public class ChannelOaServiceImpl {
|
import com.mdd.admin.service.channel.IChannelOaService;
|
||||||
|
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 ChannelOaServiceImpl implements IChannelOaService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公众号渠道设置详情
|
||||||
|
*
|
||||||
|
* @author fzr
|
||||||
|
* @return Map<String, Object>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> detail() {
|
||||||
|
Map<String, String> config = ConfigUtil.get("oa_channel");
|
||||||
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("name", config.getOrDefault("name", ""));
|
||||||
|
map.put("primaryId", config.getOrDefault("primaryId", ""));
|
||||||
|
map.put("qrCode", UrlUtil.toAbsoluteUrl(config.getOrDefault("qrCode", "")));
|
||||||
|
map.put("appId", config.getOrDefault("appId", ""));
|
||||||
|
map.put("appSecret", config.getOrDefault("appSecret", ""));
|
||||||
|
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", "qrCode", UrlUtil.toRelativeUrl(param.getOrDefault("qrCode", "")));
|
||||||
|
ConfigUtil.set("mp_channel", "appId", param.getOrDefault("appId", ""));
|
||||||
|
ConfigUtil.set("mp_channel", "appSecret", param.getOrDefault("appSecret", ""));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue