Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fit-finance
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fitness-server
fit-finance
Commits
7f2eb0c8
Commit
7f2eb0c8
authored
Feb 26, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:auth
parent
38f8acf6
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
186 additions
and
38 deletions
+186
-38
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApi.java
+17
-11
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApiFallback.java
+19
-11
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/BrandMerchantApplyRequest.java
+1
-1
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/BrandMerchantAuthSubChannelRequest.java
+36
-0
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/BrandMerchantBindXcxAppIdRequest.java
+1
-1
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/BrandMerchantGetApplyRequest.java
+1
-1
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/BrandMerchantGetRequest.java
+1
-1
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/BrandMerchantPageApplyRequest.java
+1
-1
api/src/main/java/com/jiejing/fitness/finance/api/merchant/vo/BrandMerchantAuthSubChannelVO.java
+38
-0
app/src/main/java/com/jiejing/fitness/finance/app/controller/merchant/BrandMerchantController.java
+23
-11
service/src/main/java/com/jiejing/fitness/finance/service/merchant/BrandMerchantService.java
+14
-0
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
+14
-0
service/src/main/java/com/jiejing/fitness/finance/service/rpc/MerchantRpcService.java
+20
-0
No files found.
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApi.java
View file @
7f2eb0c8
...
@@ -2,12 +2,14 @@ package com.jiejing.fitness.finance.api.merchant;
...
@@ -2,12 +2,14 @@ package com.jiejing.fitness.finance.api.merchant;
import
com.jiejing.common.model.JsonResult
;
import
com.jiejing.common.model.JsonResult
;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.fitness.finance.api.merchant.request.ApplyBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BindBrandMerchantXcxAppIdRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantAuthSubChannelRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantBindXcxAppIdRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantGetApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.PageBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantGetRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantPageApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantAuthSubChannelVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -27,26 +29,30 @@ public interface BrandMerchantApi {
...
@@ -27,26 +29,30 @@ public interface BrandMerchantApi {
@ApiOperation
(
value
=
"品牌入驻商户"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"品牌入驻商户"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/apply"
)
@PostMapping
(
value
=
"/private/brandMerchant/apply"
)
JsonResult
<
Void
>
apply
(
ApplyBrandMerchant
Request
request
);
JsonResult
<
Void
>
apply
(
BrandMerchantApply
Request
request
);
@ApiOperation
(
value
=
"查询品牌当前绑定的商户"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"查询品牌当前绑定的商户"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/get"
)
@PostMapping
(
value
=
"/private/brandMerchant/get"
)
JsonResult
<
BrandMerchantVO
>
get
(
GetBrandMerchan
tRequest
request
);
JsonResult
<
BrandMerchantVO
>
get
(
BrandMerchantGe
tRequest
request
);
@ApiOperation
(
value
=
"查询品牌进件申请记录"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"查询品牌进件申请记录"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/getApply"
)
@PostMapping
(
value
=
"/private/brandMerchant/getApply"
)
JsonResult
<
BrandMerchantApplyVO
>
getApply
(
GetBrandMerchan
tApplyRequest
request
);
JsonResult
<
BrandMerchantApplyVO
>
getApply
(
BrandMerchantGe
tApplyRequest
request
);
@ApiOperation
(
value
=
"分页查询品牌进件申请记录"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"分页查询品牌进件申请记录"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/pageApply"
)
@PostMapping
(
value
=
"/private/brandMerchant/pageApply"
)
JsonResult
<
PageVO
<
BrandMerchantApplyVO
>>
pageApply
(
PageBrandMerchant
ApplyRequest
request
);
JsonResult
<
PageVO
<
BrandMerchantApplyVO
>>
pageApply
(
BrandMerchantPage
ApplyRequest
request
);
@ApiOperation
(
value
=
"绑定微信小程序appId"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"绑定微信小程序appId"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/bindXcxAppId"
)
@PostMapping
(
value
=
"/private/brandMerchant/bindXcxAppId"
)
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
B
indBrandMerchant
XcxAppIdRequest
request
);
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
B
randMerchantBind
XcxAppIdRequest
request
);
@ApiOperation
(
value
=
"校验微信小程序appId绑定结果"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"校验微信小程序appId绑定结果"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/checkBindXcxAppId"
)
@PostMapping
(
value
=
"/private/brandMerchant/checkBindXcxAppId"
)
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
);
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
BrandMerchantBindXcxAppIdRequest
request
);
@ApiOperation
(
value
=
"授权子渠道"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/authSubChannel"
)
JsonResult
<
BrandMerchantAuthSubChannelVO
>
authSubChannel
(
BrandMerchantAuthSubChannelRequest
request
);
}
}
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApiFallback.java
View file @
7f2eb0c8
...
@@ -2,12 +2,14 @@ package com.jiejing.fitness.finance.api.merchant;
...
@@ -2,12 +2,14 @@ package com.jiejing.fitness.finance.api.merchant;
import
com.jiejing.common.model.JsonResult
;
import
com.jiejing.common.model.JsonResult
;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.fitness.finance.api.merchant.request.ApplyBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BindBrandMerchantXcxAppIdRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantAuthSubChannelRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantBindXcxAppIdRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantGetApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.PageBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantGetRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantPageApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantAuthSubChannelVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
feign.hystrix.FallbackFactory
;
import
feign.hystrix.FallbackFactory
;
...
@@ -24,33 +26,39 @@ public class BrandMerchantApiFallback implements FallbackFactory<BrandMerchantAp
...
@@ -24,33 +26,39 @@ public class BrandMerchantApiFallback implements FallbackFactory<BrandMerchantAp
public
BrandMerchantApi
create
(
Throwable
throwable
)
{
public
BrandMerchantApi
create
(
Throwable
throwable
)
{
return
new
BrandMerchantApi
()
{
return
new
BrandMerchantApi
()
{
@Override
@Override
public
JsonResult
<
Void
>
apply
(
ApplyBrandMerchant
Request
request
)
{
public
JsonResult
<
Void
>
apply
(
BrandMerchantApply
Request
request
)
{
return
JsonResult
.
rpcError
();
return
JsonResult
.
rpcError
();
}
}
@Override
@Override
public
JsonResult
<
BrandMerchantVO
>
get
(
GetBrandMerchan
tRequest
request
)
{
public
JsonResult
<
BrandMerchantVO
>
get
(
BrandMerchantGe
tRequest
request
)
{
return
JsonResult
.
rpcError
();
return
JsonResult
.
rpcError
();
}
}
@Override
@Override
public
JsonResult
<
BrandMerchantApplyVO
>
getApply
(
GetBrandMerchan
tApplyRequest
request
)
{
public
JsonResult
<
BrandMerchantApplyVO
>
getApply
(
BrandMerchantGe
tApplyRequest
request
)
{
return
JsonResult
.
rpcError
();
return
JsonResult
.
rpcError
();
}
}
@Override
@Override
public
JsonResult
<
PageVO
<
BrandMerchantApplyVO
>>
pageApply
(
PageBrandMerchant
ApplyRequest
request
)
{
public
JsonResult
<
PageVO
<
BrandMerchantApplyVO
>>
pageApply
(
BrandMerchantPage
ApplyRequest
request
)
{
return
JsonResult
.
rpcError
();
return
JsonResult
.
rpcError
();
}
}
@Override
@Override
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
B
indBrandMerchant
XcxAppIdRequest
request
)
{
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
B
randMerchantBind
XcxAppIdRequest
request
)
{
return
JsonResult
.
rpcError
();
return
JsonResult
.
rpcError
();
}
}
@Override
@Override
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
)
{
BrandMerchantBindXcxAppIdRequest
request
)
{
return
JsonResult
.
rpcError
();
}
@Override
public
JsonResult
<
BrandMerchantAuthSubChannelVO
>
authSubChannel
(
BrandMerchantAuthSubChannelRequest
request
)
{
return
JsonResult
.
rpcError
();
return
JsonResult
.
rpcError
();
}
}
};
};
...
...
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
ApplyBrandMerchant
Request.java
→
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
BrandMerchantApply
Request.java
View file @
7f2eb0c8
...
@@ -27,7 +27,7 @@ import lombok.NoArgsConstructor;
...
@@ -27,7 +27,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@ApiModel
(
description
=
"申请品牌商户请求信息"
)
@ApiModel
(
description
=
"申请品牌商户请求信息"
)
public
class
ApplyBrandMerchant
Request
{
public
class
BrandMerchantApply
Request
{
@ApiModelProperty
(
value
=
"场馆ID"
,
required
=
true
)
@ApiModelProperty
(
value
=
"场馆ID"
,
required
=
true
)
@NotNull
(
message
=
"场馆ID不能为空"
)
@NotNull
(
message
=
"场馆ID不能为空"
)
...
...
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/BrandMerchantAuthSubChannelRequest.java
0 → 100644
View file @
7f2eb0c8
package
com
.
jiejing
.
fitness
.
finance
.
api
.
merchant
.
request
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelEnums
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
javax.validation.constraints.NotNull
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author chengyubing
* @since 2024/2/26 13:58
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
description
=
"品牌商户授权子渠道"
)
public
class
BrandMerchantAuthSubChannelRequest
{
@ApiModelProperty
(
value
=
"品牌ID"
,
required
=
true
)
@NotNull
(
message
=
"品牌ID不能为空"
)
private
Long
brandId
;
@ApiModelProperty
(
value
=
"子渠道"
,
required
=
true
)
@NotNull
(
message
=
"子渠道不能为空"
)
private
SubChannelEnums
subChannel
;
@ApiModelProperty
(
value
=
"子渠道认证类型"
,
required
=
true
)
@NotNull
(
message
=
"子渠道认证类型不能为空"
)
private
SubChannelAuthTypeEnums
authType
;
}
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/B
indBrandMerchant
XcxAppIdRequest.java
→
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/B
randMerchantBind
XcxAppIdRequest.java
View file @
7f2eb0c8
...
@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
...
@@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@ApiModel
(
description
=
"品牌商户绑定小程序appId"
)
@ApiModel
(
description
=
"品牌商户绑定小程序appId"
)
public
class
B
indBrandMerchant
XcxAppIdRequest
{
public
class
B
randMerchantBind
XcxAppIdRequest
{
@ApiModelProperty
(
value
=
"品牌ID"
,
required
=
true
)
@ApiModelProperty
(
value
=
"品牌ID"
,
required
=
true
)
@NotNull
(
message
=
"品牌ID不能为空"
)
@NotNull
(
message
=
"品牌ID不能为空"
)
...
...
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
GetBrandMerchan
tApplyRequest.java
→
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
BrandMerchantGe
tApplyRequest.java
View file @
7f2eb0c8
...
@@ -19,7 +19,7 @@ import lombok.NoArgsConstructor;
...
@@ -19,7 +19,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@ApiModel
(
description
=
"申请品牌商户记录请求信息"
)
@ApiModel
(
description
=
"申请品牌商户记录请求信息"
)
public
class
GetBrandMerchan
tApplyRequest
{
public
class
BrandMerchantGe
tApplyRequest
{
@ApiModelProperty
(
value
=
"申请ID"
,
required
=
true
)
@ApiModelProperty
(
value
=
"申请ID"
,
required
=
true
)
@NotNull
(
message
=
"申请ID不能为空"
)
@NotNull
(
message
=
"申请ID不能为空"
)
...
...
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
GetBrandMerchan
tRequest.java
→
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
BrandMerchantGe
tRequest.java
View file @
7f2eb0c8
...
@@ -19,7 +19,7 @@ import lombok.NoArgsConstructor;
...
@@ -19,7 +19,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@ApiModel
(
description
=
"申请品牌商户请求信息"
)
@ApiModel
(
description
=
"申请品牌商户请求信息"
)
public
class
GetBrandMerchan
tRequest
{
public
class
BrandMerchantGe
tRequest
{
@ApiModelProperty
(
value
=
"品牌ID"
,
required
=
true
)
@ApiModelProperty
(
value
=
"品牌ID"
,
required
=
true
)
@NotNull
(
message
=
"品牌ID不能为空"
)
@NotNull
(
message
=
"品牌ID不能为空"
)
...
...
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
PageBrandMerchant
ApplyRequest.java
→
api/src/main/java/com/jiejing/fitness/finance/api/merchant/request/
BrandMerchantPage
ApplyRequest.java
View file @
7f2eb0c8
...
@@ -20,7 +20,7 @@ import lombok.NoArgsConstructor;
...
@@ -20,7 +20,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@ApiModel
(
description
=
"分页查询申请品牌商户请求信息Request"
)
@ApiModel
(
description
=
"分页查询申请品牌商户请求信息Request"
)
public
class
PageBrandMerchant
ApplyRequest
{
public
class
BrandMerchantPage
ApplyRequest
{
@ApiModelProperty
(
value
=
"商户简称"
)
@ApiModelProperty
(
value
=
"商户简称"
)
private
String
shortName
;
private
String
shortName
;
...
...
api/src/main/java/com/jiejing/fitness/finance/api/merchant/vo/BrandMerchantAuthSubChannelVO.java
0 → 100644
View file @
7f2eb0c8
package
com
.
jiejing
.
fitness
.
finance
.
api
.
merchant
.
vo
;
import
com.jiejing.paycenter.common.enums.common.OpenStateEnums
;
import
com.jiejing.paycenter.common.enums.merchant.AuthPhaseEnums
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author chengyubing
* @since 2024/2/26 14:37
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel
(
description
=
"品牌商户认证子渠道VO"
)
public
class
BrandMerchantAuthSubChannelVO
{
@ApiModelProperty
(
value
=
"申请单"
)
private
String
applyNo
;
@ApiModelProperty
(
value
=
"授权状态"
)
private
OpenStateEnums
state
;
@ApiModelProperty
(
value
=
"认证阶段"
)
private
AuthPhaseEnums
authPhase
;
@ApiModelProperty
(
value
=
"授权二维码"
)
private
String
authQrCode
;
@ApiModelProperty
(
value
=
"失败原因"
)
private
String
failMessage
;
}
app/src/main/java/com/jiejing/fitness/finance/app/controller/merchant/BrandMerchantController.java
View file @
7f2eb0c8
...
@@ -4,12 +4,14 @@ import com.jiejing.common.model.JsonResult;
...
@@ -4,12 +4,14 @@ import com.jiejing.common.model.JsonResult;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.common.utils.convert.BeanUtil
;
import
com.jiejing.common.utils.convert.BeanUtil
;
import
com.jiejing.fitness.finance.api.merchant.BrandMerchantApi
;
import
com.jiejing.fitness.finance.api.merchant.BrandMerchantApi
;
import
com.jiejing.fitness.finance.api.merchant.request.ApplyBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BindBrandMerchantXcxAppIdRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantAuthSubChannelRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantBindXcxAppIdRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantGetApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.PageBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantGetRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.BrandMerchantPageApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantAuthSubChannelVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.service.merchant.BrandMerchantService
;
import
com.jiejing.fitness.finance.service.merchant.BrandMerchantService
;
...
@@ -35,7 +37,7 @@ public class BrandMerchantController implements BrandMerchantApi {
...
@@ -35,7 +37,7 @@ public class BrandMerchantController implements BrandMerchantApi {
@ApiOperation
(
value
=
"品牌入驻商户"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"品牌入驻商户"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/apply"
)
@PostMapping
(
value
=
"/private/brandMerchant/apply"
)
@Override
@Override
public
JsonResult
<
Void
>
apply
(
@RequestBody
@Valid
ApplyBrandMerchant
Request
request
)
{
public
JsonResult
<
Void
>
apply
(
@RequestBody
@Valid
BrandMerchantApply
Request
request
)
{
ApplyBrandMerchantParams
params
=
BeanUtil
.
map
(
request
,
ApplyBrandMerchantParams
.
class
);
ApplyBrandMerchantParams
params
=
BeanUtil
.
map
(
request
,
ApplyBrandMerchantParams
.
class
);
brandMerchantService
.
apply
(
params
);
brandMerchantService
.
apply
(
params
);
return
JsonResult
.
success
();
return
JsonResult
.
success
();
...
@@ -44,14 +46,14 @@ public class BrandMerchantController implements BrandMerchantApi {
...
@@ -44,14 +46,14 @@ public class BrandMerchantController implements BrandMerchantApi {
@ApiOperation
(
value
=
"查询品牌当前绑定的商户"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"查询品牌当前绑定的商户"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/get"
)
@PostMapping
(
value
=
"/private/brandMerchant/get"
)
@Override
@Override
public
JsonResult
<
BrandMerchantVO
>
get
(
@RequestBody
@Valid
GetBrandMerchan
tRequest
request
)
{
public
JsonResult
<
BrandMerchantVO
>
get
(
@RequestBody
@Valid
BrandMerchantGe
tRequest
request
)
{
return
JsonResult
.
success
(
brandMerchantService
.
getMerchant
(
request
.
getBrandId
()));
return
JsonResult
.
success
(
brandMerchantService
.
getMerchant
(
request
.
getBrandId
()));
}
}
@ApiOperation
(
value
=
"查询品牌进件申请记录"
,
tags
=
{
TAG
})
@ApiOperation
(
value
=
"查询品牌进件申请记录"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/getApply"
)
@PostMapping
(
value
=
"/private/brandMerchant/getApply"
)
@Override
@Override
public
JsonResult
<
BrandMerchantApplyVO
>
getApply
(
@RequestBody
@Valid
GetBrandMerchan
tApplyRequest
request
)
{
public
JsonResult
<
BrandMerchantApplyVO
>
getApply
(
@RequestBody
@Valid
BrandMerchantGe
tApplyRequest
request
)
{
return
JsonResult
.
success
(
brandMerchantService
.
getApply
(
request
.
getId
()));
return
JsonResult
.
success
(
brandMerchantService
.
getApply
(
request
.
getId
()));
}
}
...
@@ -59,7 +61,7 @@ public class BrandMerchantController implements BrandMerchantApi {
...
@@ -59,7 +61,7 @@ public class BrandMerchantController implements BrandMerchantApi {
@PostMapping
(
value
=
"/private/brandMerchant/pageApply"
)
@PostMapping
(
value
=
"/private/brandMerchant/pageApply"
)
@Override
@Override
public
JsonResult
<
PageVO
<
BrandMerchantApplyVO
>>
pageApply
(
public
JsonResult
<
PageVO
<
BrandMerchantApplyVO
>>
pageApply
(
@RequestBody
@Valid
PageBrandMerchant
ApplyRequest
request
)
{
@RequestBody
@Valid
BrandMerchantPage
ApplyRequest
request
)
{
PageBrandMerchantApplyParams
params
=
BeanUtil
.
map
(
request
,
PageBrandMerchantApplyParams
.
class
);
PageBrandMerchantApplyParams
params
=
BeanUtil
.
map
(
request
,
PageBrandMerchantApplyParams
.
class
);
return
JsonResult
.
success
(
brandMerchantService
.
pageApply
(
params
));
return
JsonResult
.
success
(
brandMerchantService
.
pageApply
(
params
));
}
}
...
@@ -68,7 +70,7 @@ public class BrandMerchantController implements BrandMerchantApi {
...
@@ -68,7 +70,7 @@ public class BrandMerchantController implements BrandMerchantApi {
@PostMapping
(
value
=
"/private/brandMerchant/bindXcxAppId"
)
@PostMapping
(
value
=
"/private/brandMerchant/bindXcxAppId"
)
@Override
@Override
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
@RequestBody
@Valid
B
indBrandMerchant
XcxAppIdRequest
request
)
{
@RequestBody
@Valid
B
randMerchantBind
XcxAppIdRequest
request
)
{
return
JsonResult
.
success
(
brandMerchantService
.
bindXcxAppId
(
request
.
getBrandId
(),
request
.
getAppId
()));
return
JsonResult
.
success
(
brandMerchantService
.
bindXcxAppId
(
request
.
getBrandId
(),
request
.
getAppId
()));
}
}
...
@@ -76,9 +78,19 @@ public class BrandMerchantController implements BrandMerchantApi {
...
@@ -76,9 +78,19 @@ public class BrandMerchantController implements BrandMerchantApi {
@PostMapping
(
value
=
"/private/brandMerchant/checkBindXcxAppId"
)
@PostMapping
(
value
=
"/private/brandMerchant/checkBindXcxAppId"
)
@Override
@Override
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
@RequestBody
@Valid
B
indBrandMerchant
XcxAppIdRequest
request
)
{
@RequestBody
@Valid
B
randMerchantBind
XcxAppIdRequest
request
)
{
return
JsonResult
.
success
(
return
JsonResult
.
success
(
brandMerchantService
.
checkBindXcxAppId
(
request
.
getBrandId
(),
request
.
getAppId
()));
brandMerchantService
.
checkBindXcxAppId
(
request
.
getBrandId
(),
request
.
getAppId
()));
}
}
@ApiOperation
(
value
=
"授权子渠道"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/authSubChannel"
)
@Override
public
JsonResult
<
BrandMerchantAuthSubChannelVO
>
authSubChannel
(
@RequestBody
@Valid
BrandMerchantAuthSubChannelRequest
request
)
{
return
JsonResult
.
success
(
brandMerchantService
.
authSubChannel
(
request
.
getBrandId
(),
request
.
getSubChannel
(),
request
.
getAuthType
()));
}
}
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/BrandMerchantService.java
View file @
7f2eb0c8
...
@@ -2,10 +2,13 @@ package com.jiejing.fitness.finance.service.merchant;
...
@@ -2,10 +2,13 @@ package com.jiejing.fitness.finance.service.merchant;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.common.model.PageVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantAuthSubChannelVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.service.merchant.params.ApplyBrandMerchantParams
;
import
com.jiejing.fitness.finance.service.merchant.params.ApplyBrandMerchantParams
;
import
com.jiejing.fitness.finance.service.merchant.params.PageBrandMerchantApplyParams
;
import
com.jiejing.fitness.finance.service.merchant.params.PageBrandMerchantApplyParams
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelEnums
;
import
com.jiejing.paycenter.common.event.MerchantEvent
;
import
com.jiejing.paycenter.common.event.MerchantEvent
;
import
com.jiejing.paycenter.common.event.MerchantSubChannelConfigEvent
;
import
com.jiejing.paycenter.common.event.MerchantSubChannelConfigEvent
;
...
@@ -80,4 +83,15 @@ public interface BrandMerchantService {
...
@@ -80,4 +83,15 @@ public interface BrandMerchantService {
*/
*/
void
bindXcxAppIdCallback
(
MerchantSubChannelConfigEvent
event
);
void
bindXcxAppIdCallback
(
MerchantSubChannelConfigEvent
event
);
/**
* 授权子渠道
*
* @param brandId 品牌ID
* @param subChannel 子渠道
* @param authType 授权类型
* @return 结果
*/
BrandMerchantAuthSubChannelVO
authSubChannel
(
Long
brandId
,
SubChannelEnums
subChannel
,
SubChannelAuthTypeEnums
authType
);
}
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
View file @
7f2eb0c8
...
@@ -8,6 +8,7 @@ import com.jiejing.common.model.PageVO;
...
@@ -8,6 +8,7 @@ import com.jiejing.common.model.PageVO;
import
com.jiejing.common.utils.convert.BeanUtil
;
import
com.jiejing.common.utils.convert.BeanUtil
;
import
com.jiejing.filecenter.api.resource.vo.ResourceInfoVO
;
import
com.jiejing.filecenter.api.resource.vo.ResourceInfoVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantAuthSubChannelVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.repository.entity.BrandBindWxAppIdApply
;
import
com.jiejing.fitness.finance.repository.entity.BrandBindWxAppIdApply
;
...
@@ -29,10 +30,13 @@ import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
...
@@ -29,10 +30,13 @@ import com.jiejing.fitness.finance.service.rpc.MerchantRpcService;
import
com.jiejing.fitness.finance.service.rpc.ResourceRpcService
;
import
com.jiejing.fitness.finance.service.rpc.ResourceRpcService
;
import
com.jiejing.fitness.finance.service.rpc.StudioRpcService
;
import
com.jiejing.fitness.finance.service.rpc.StudioRpcService
;
import
com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest
;
import
com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest
;
import
com.jiejing.paycenter.api.merchant.vo.AuthSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.MerchantVO
;
import
com.jiejing.paycenter.api.merchant.vo.MerchantVO
;
import
com.jiejing.paycenter.common.enums.common.OpenStateEnums
;
import
com.jiejing.paycenter.common.enums.common.OpenStateEnums
;
import
com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.ResourceTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelEnums
;
import
com.jiejing.paycenter.common.event.MerchantEvent
;
import
com.jiejing.paycenter.common.event.MerchantEvent
;
import
com.jiejing.paycenter.common.event.MerchantSubChannelConfigEvent
;
import
com.jiejing.paycenter.common.event.MerchantSubChannelConfigEvent
;
import
com.jiejing.paycenter.common.model.ResourceInfo
;
import
com.jiejing.paycenter.common.model.ResourceInfo
;
...
@@ -199,6 +203,16 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
...
@@ -199,6 +203,16 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
brandBindWxAppIdApplyRpService
.
updateById
(
toModify
);
brandBindWxAppIdApplyRpService
.
updateById
(
toModify
);
}
}
@Override
public
BrandMerchantAuthSubChannelVO
authSubChannel
(
Long
brandId
,
SubChannelEnums
subChannel
,
SubChannelAuthTypeEnums
authType
)
{
BrandToMerchant
relation
=
brandToMerchantRpService
.
getByBrandId
(
brandId
);
AuthSubChannelVO
vo
=
merchantRpcService
.
authSubChannel
(
channel
,
relation
.
getMerchantId
(),
subChannel
,
authType
);
return
BeanUtil
.
map
(
vo
,
BrandMerchantAuthSubChannelVO
.
class
);
}
private
void
doOpenMerchantSuccess
(
MerchantEvent
event
)
{
private
void
doOpenMerchantSuccess
(
MerchantEvent
event
)
{
BrandMerchantApply
apply
=
brandMerchantApplyRpService
.
getByIdForUpdate
(
BrandMerchantApply
apply
=
brandMerchantApplyRpService
.
getByIdForUpdate
(
Long
.
parseLong
(
event
.
getApplyNo
())).
orElseThrow
(()
->
new
BizException
(
FinanceErrorEnums
.
NOT_EXIST
));
Long
.
parseLong
(
event
.
getApplyNo
())).
orElseThrow
(()
->
new
BizException
(
FinanceErrorEnums
.
NOT_EXIST
));
...
...
service/src/main/java/com/jiejing/fitness/finance/service/rpc/MerchantRpcService.java
View file @
7f2eb0c8
...
@@ -5,14 +5,18 @@ import com.jiejing.common.model.JsonResult;
...
@@ -5,14 +5,18 @@ import com.jiejing.common.model.JsonResult;
import
com.jiejing.paycenter.api.merchant.MerchantApi
;
import
com.jiejing.paycenter.api.merchant.MerchantApi
;
import
com.jiejing.paycenter.api.merchant.MerchantQueryApi
;
import
com.jiejing.paycenter.api.merchant.MerchantQueryApi
;
import
com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest
;
import
com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest
;
import
com.jiejing.paycenter.api.merchant.request.AuthSubChannelRequest
;
import
com.jiejing.paycenter.api.merchant.request.ConfigSubChannelRequest
;
import
com.jiejing.paycenter.api.merchant.request.ConfigSubChannelRequest
;
import
com.jiejing.paycenter.api.merchant.request.GetMerchantByIdRequest
;
import
com.jiejing.paycenter.api.merchant.request.GetMerchantByIdRequest
;
import
com.jiejing.paycenter.api.merchant.request.UploadRequest
;
import
com.jiejing.paycenter.api.merchant.request.UploadRequest
;
import
com.jiejing.paycenter.api.merchant.vo.ApplyMerchantResultVO
;
import
com.jiejing.paycenter.api.merchant.vo.ApplyMerchantResultVO
;
import
com.jiejing.paycenter.api.merchant.vo.AuthSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.ConfigSubChannelVO
;
import
com.jiejing.paycenter.api.merchant.vo.MerchantVO
;
import
com.jiejing.paycenter.api.merchant.vo.MerchantVO
;
import
com.jiejing.paycenter.api.merchant.vo.UploadVO
;
import
com.jiejing.paycenter.api.merchant.vo.UploadVO
;
import
com.jiejing.paycenter.common.enums.common.OpenStateEnums
;
import
com.jiejing.paycenter.common.enums.common.OpenStateEnums
;
import
com.jiejing.paycenter.common.enums.merchant.AuthPhaseEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelConfigTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelConfigTypeEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelEnums
;
import
com.jiejing.paycenter.common.enums.merchant.SubChannelEnums
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -68,4 +72,20 @@ public class MerchantRpcService {
...
@@ -68,4 +72,20 @@ public class MerchantRpcService {
return
result
.
getResult
();
return
result
.
getResult
();
}
}
public
AuthSubChannelVO
authSubChannel
(
String
channel
,
Long
merchantId
,
SubChannelEnums
subChannel
,
SubChannelAuthTypeEnums
authType
)
{
JsonResult
<
AuthSubChannelVO
>
result
=
merchantApi
.
authSubChannel
(
AuthSubChannelRequest
.
builder
()
.
channelNo
(
channel
)
.
merchantId
(
merchantId
)
.
subChannel
(
subChannel
)
.
authType
(
authType
)
.
build
());
if
(!
result
.
getSuccess
())
{
return
AuthSubChannelVO
.
builder
()
.
state
(
OpenStateEnums
.
FAIL
)
.
authPhase
(
AuthPhaseEnums
.
APPLY_COMMIT_FAIL
)
.
failMessage
(
result
.
getMessage
()).
build
();
}
return
result
.
getResult
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment