| @@ -11,10 +11,7 @@ import me.chanjar.weixin.open.bean.result.*; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.List; | import java.util.List; | ||||
| @@ -51,9 +48,9 @@ public class WechatWeappSetController { | |||||
| " \"downloaddomain\":[\"https://www.qq.com\",\"https://www.qq.com\"],\n" + | " \"downloaddomain\":[\"https://www.qq.com\",\"https://www.qq.com\"],\n" + | ||||
| " }") | " }") | ||||
| @PostMapping("/modifyDomain") | @PostMapping("/modifyDomain") | ||||
| public ResultData modifyDomain(String appId, String action, | |||||
| List<String> requestDomain, List<String> wsrequestdomain, | |||||
| List<String> uploaddomain, List<String> downloaddomain) { | |||||
| public ResultData modifyDomain(@RequestParam(value = "appId") String appId, @RequestParam(value = "action") String action, | |||||
| @RequestParam(value = "requestDomain") List<String> requestDomain, @RequestParam(value = "wsrequestdomain") List<String> wsrequestdomain, | |||||
| @RequestParam(value = "uploaddomain") List<String> uploaddomain, @RequestParam(value = "downloaddomain") List<String> downloaddomain) { | |||||
| try { | try { | ||||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | ||||
| WxOpenMaDomainResult openRet = openMaService.modifyDomain(action, | WxOpenMaDomainResult openRet = openMaService.modifyDomain(action, | ||||
| @@ -67,9 +64,13 @@ public class WechatWeappSetController { | |||||
| return new ResultData(Result.ERROR); | return new ResultData(Result.ERROR); | ||||
| } | } | ||||
| @ApiOperation(value = "设置小程序业务域名", notes = "extInfo参考https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html") | |||||
| @ApiOperation(value = "设置小程序业务域名", notes = "{\n" + | |||||
| " \"action\":\"add\",\n" + | |||||
| " \"webviewdomain\":[\"https://www.qq.com\",\"https://m.qq.com\"]\n" + | |||||
| " }") | |||||
| @PostMapping("/setWebViewDomain") | @PostMapping("/setWebViewDomain") | ||||
| public ResultData setWebViewDomain(String appId, String action, List<String> urlList) { | |||||
| public ResultData setWebViewDomain(@RequestParam(value = "appId") String appId, @RequestParam(value = "action") String action, | |||||
| @RequestParam(value = "urlList") List<String> urlList) { | |||||
| try { | try { | ||||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | ||||
| String openRet = openMaService.setWebViewDomain(action, urlList); | String openRet = openMaService.setWebViewDomain(action, urlList); | ||||