mall:完善 cloud 的 api 调用

This commit is contained in:
YunaiV
2023-10-24 12:24:02 +08:00
parent 110b3476a8
commit b133cfa2a8
38 changed files with 239 additions and 136 deletions

View File

@@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.api.notify.notify;
package cn.iocoder.yudao.module.system.api.notify;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
import cn.iocoder.yudao.module.system.service.notify.NotifySendService;
import org.springframework.validation.annotation.Validated;

View File

@@ -0,0 +1,46 @@
package cn.iocoder.yudao.module.system.api.social;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxJsapiSignatureRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoRespDTO;
import cn.iocoder.yudao.module.system.convert.social.SocialClientConvert;
import cn.iocoder.yudao.module.system.service.social.SocialClientService;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* 社交应用的 API 实现类
*
* @author 芋道源码
*/
@RestController
@Validated
public class SocialClientApiImpl implements SocialClientApi {
@Resource
private SocialClientService socialClientService;
@Override
public CommonResult<String> getAuthorizeUrl(Integer socialType, Integer userType, String redirectUri) {
return success(socialClientService.getAuthorizeUrl(socialType, userType, redirectUri));
}
@Override
public CommonResult<SocialWxJsapiSignatureRespDTO> createWxMpJsapiSignature(Integer userType, String url) {
WxJsapiSignature signature = socialClientService.createWxMpJsapiSignature(userType, url);
return success(SocialClientConvert.INSTANCE.convert(signature));
}
@Override
public CommonResult<SocialWxPhoneNumberInfoRespDTO> getWxMaPhoneNumberInfo(Integer userType, String phoneCode) {
WxMaPhoneNumberInfo info = socialClientService.getWxMaPhoneNumberInfo(userType, phoneCode);
return success(SocialClientConvert.INSTANCE.convert(info));
}
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.system.convert.social;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxJsapiSignatureRespDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxPhoneNumberInfoRespDTO;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper
public interface SocialClientConvert {
SocialClientConvert INSTANCE = Mappers.getMapper(SocialClientConvert.class);
SocialWxJsapiSignatureRespDTO convert(WxJsapiSignature bean);
SocialWxPhoneNumberInfoRespDTO convert(WxMaPhoneNumberInfo bean);
}