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
38f8acf6
Commit
38f8acf6
authored
Feb 26, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:bind appId
parent
16ded966
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
7 deletions
+33
-7
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApi.java
+6
-1
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApiFallback.java
+8
-1
app/src/main/java/com/jiejing/fitness/finance/app/controller/merchant/BrandMerchantController.java
+13
-3
service/src/main/java/com/jiejing/fitness/finance/service/merchant/BrandMerchantService.java
+2
-1
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
+4
-1
No files found.
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApi.java
View file @
38f8acf6
...
...
@@ -8,6 +8,7 @@ import com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantApplyReq
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.PageBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -42,6 +43,10 @@ public interface BrandMerchantApi {
@ApiOperation
(
value
=
"绑定微信小程序appId"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/bindXcxAppId"
)
JsonResult
<
Void
>
bindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
);
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
);
@ApiOperation
(
value
=
"校验微信小程序appId绑定结果"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/checkBindXcxAppId"
)
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
);
}
api/src/main/java/com/jiejing/fitness/finance/api/merchant/BrandMerchantApiFallback.java
View file @
38f8acf6
...
...
@@ -8,6 +8,7 @@ import com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantApplyReq
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.PageBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.stereotype.Component
;
...
...
@@ -43,7 +44,13 @@ public class BrandMerchantApiFallback implements FallbackFactory<BrandMerchantAp
}
@Override
public
JsonResult
<
Void
>
bindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
)
{
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
)
{
return
JsonResult
.
rpcError
();
}
@Override
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
BindBrandMerchantXcxAppIdRequest
request
)
{
return
JsonResult
.
rpcError
();
}
};
...
...
app/src/main/java/com/jiejing/fitness/finance/app/controller/merchant/BrandMerchantController.java
View file @
38f8acf6
...
...
@@ -10,6 +10,7 @@ import com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantApplyReq
import
com.jiejing.fitness.finance.api.merchant.request.GetBrandMerchantRequest
;
import
com.jiejing.fitness.finance.api.merchant.request.PageBrandMerchantApplyRequest
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantApplyVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantBindXcxAppIdVO
;
import
com.jiejing.fitness.finance.api.merchant.vo.BrandMerchantVO
;
import
com.jiejing.fitness.finance.service.merchant.BrandMerchantService
;
import
com.jiejing.fitness.finance.service.merchant.params.ApplyBrandMerchantParams
;
...
...
@@ -66,9 +67,18 @@ public class BrandMerchantController implements BrandMerchantApi {
@ApiOperation
(
value
=
"绑定微信小程序appId"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/bindXcxAppId"
)
@Override
public
JsonResult
<
Void
>
bindXcxAppId
(
@RequestBody
@Valid
BindBrandMerchantXcxAppIdRequest
request
)
{
brandMerchantService
.
bindXcxAppId
(
request
.
getBrandId
(),
request
.
getAppId
());
return
JsonResult
.
success
();
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
bindXcxAppId
(
@RequestBody
@Valid
BindBrandMerchantXcxAppIdRequest
request
)
{
return
JsonResult
.
success
(
brandMerchantService
.
bindXcxAppId
(
request
.
getBrandId
(),
request
.
getAppId
()));
}
@ApiOperation
(
value
=
"校验微信小程序appId绑定结果"
,
tags
=
{
TAG
})
@PostMapping
(
value
=
"/private/brandMerchant/checkBindXcxAppId"
)
@Override
public
JsonResult
<
BrandMerchantBindXcxAppIdVO
>
checkBindXcxAppId
(
@RequestBody
@Valid
BindBrandMerchantXcxAppIdRequest
request
)
{
return
JsonResult
.
success
(
brandMerchantService
.
checkBindXcxAppId
(
request
.
getBrandId
(),
request
.
getAppId
()));
}
}
service/src/main/java/com/jiejing/fitness/finance/service/merchant/BrandMerchantService.java
View file @
38f8acf6
...
...
@@ -60,8 +60,9 @@ public interface BrandMerchantService {
*
* @param brandId 品牌Id
* @param appId appId
* @return 结果
*/
void
bindXcxAppId
(
Long
brandId
,
String
appId
);
BrandMerchantBindXcxAppIdVO
bindXcxAppId
(
Long
brandId
,
String
appId
);
/**
* 绑定小程序AppId结果
...
...
service/src/main/java/com/jiejing/fitness/finance/service/merchant/impl/BrandMerchantServiceImpl.java
View file @
38f8acf6
...
...
@@ -158,7 +158,7 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
}
@Override
public
void
bindXcxAppId
(
Long
brandId
,
String
appId
)
{
public
BrandMerchantBindXcxAppIdVO
bindXcxAppId
(
Long
brandId
,
String
appId
)
{
BrandToMerchant
relation
=
brandToMerchantRpService
.
getByBrandId
(
brandId
);
BrandBindWxAppIdApply
latest
=
brandBindWxAppIdApplyRpService
.
getLatestSuccessByMerchantIdAndAppId
(
relation
.
getMerchantId
(),
appId
);
...
...
@@ -174,6 +174,9 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
BrandBindWxAppIdApply
toModify
=
MerchantConvert
.
convertBrandBindWxAppIdApply
(
apply
,
vo
.
getState
(),
vo
.
getFailMessage
());
brandBindWxAppIdApplyRpService
.
updateById
(
toModify
);
return
BrandMerchantBindXcxAppIdVO
.
builder
().
state
(
vo
.
getState
()).
failMessage
(
vo
.
getFailMessage
())
.
build
();
}
@Override
...
...
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