parent
413f75f402
commit
96858fae21
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.mall.system.rest.request.errorcode;
|
||||
package cn.iocoder.mall.system.rest.response.errorcode;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.mall.system.rpc.api.errorcode;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.system.rpc.response.errorcode.ErrorCodeResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ErrorCode RPC 接口
|
||||
* @author ding
|
||||
*/
|
||||
public interface ErrorCodeRPC {
|
||||
|
||||
CommonResult<List<ErrorCodeResponse>> getErrorCode();
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.mall.system.rpc.convert.errorcode;
|
||||
|
||||
import cn.iocoder.mall.system.biz.bo.errorcode.ErrorCodeBO;
|
||||
import cn.iocoder.mall.system.rpc.response.errorcode.ErrorCodeResponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ErrorCodeConvert {
|
||||
|
||||
ErrorCodeConvert INSTANCE = Mappers.getMapper(ErrorCodeConvert.class);
|
||||
|
||||
List<ErrorCodeResponse> convert(List<ErrorCodeBO> bean);
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.mall.system.rpc.rpc.errorcode;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.system.biz.bo.errorcode.ErrorCodeBO;
|
||||
import cn.iocoder.mall.system.biz.service.errorcode.ErrorCodeService;
|
||||
import cn.iocoder.mall.system.rpc.api.errorcode.ErrorCodeRPC;
|
||||
import cn.iocoder.mall.system.rpc.convert.errorcode.ErrorCodeConvert;
|
||||
import cn.iocoder.mall.system.rpc.convert.user.UserConvert;
|
||||
import cn.iocoder.mall.system.rpc.response.errorcode.ErrorCodeResponse;
|
||||
import org.apache.dubbo.config.annotation.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ding
|
||||
*/
|
||||
@Service(version = "${dubbo.provider.ErrorCodeRPC.version}", validation = "true")
|
||||
public class ErrorCodeRPCImpl implements ErrorCodeRPC {
|
||||
|
||||
@Autowired
|
||||
private ErrorCodeService errorCodeService;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ErrorCodeResponse>> getErrorCode() {
|
||||
List<ErrorCodeBO> list = errorCodeService.getErrorCodeListAll();
|
||||
return CommonResult.success(ErrorCodeConvert.INSTANCE.convert(list));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue