Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
enterprise-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
enterprise-platform
Commits
4cf02192
Commit
4cf02192
authored
Nov 19, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信小程序登录以及手机号绑定;员工名片增加页面展示设置
parent
2ba83ed9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
82 deletions
+82
-82
enterprise-manager/src/main/java/com/mortals/xhx/busiz/controller/TestIdempotentAnnotationController.java
.../busiz/controller/TestIdempotentAnnotationController.java
+82
-82
No files found.
enterprise-manager/src/main/java/com/mortals/xhx/busiz/controller/TestIdempotentAnnotationController.java
View file @
4cf02192
package
com.mortals.xhx.busiz.controller
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
org.enhance.idempotent.demo.app.service.TestIdempotentAnnotationService
;
import
org.enhance.idempotent.demo.domain.entity.OrderEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
/**
* 测试幂等注解
*
* @author wenpan 2023/01/07 10:13
*/
@Slf4j
@RestController
(
"TestIdempotentAnnotationController.v1"
)
@RequestMapping
(
"/v1/idempotent-annotation"
)
public
class
TestIdempotentAnnotationController
{
@Autowired
private
TestIdempotentAnnotationService
testIdempotentAnnotationService
;
/**
* 测试幂等注解
* 请求URL:localhost:12345/v1/idempotent-annotation/add-order?orderNumber=TB-202301070001&orderAmount=1000&platformCode=taobao
*/
@PostMapping
(
"/add-order"
)
public
OrderEntity
addOrder
(
@RequestParam
String
orderNumber
,
@RequestParam
String
orderAmount
,
@RequestParam
String
platformCode
)
{
log
.
info
(
"======>>>>>>addOrder orderNumber is {}, orderAmount is {}, platformCode is {}"
,
orderNumber
,
orderAmount
,
platformCode
);
// 构建待新增的订单信息
OrderEntity
orderEntity
=
new
OrderEntity
();
orderEntity
.
setOrderNumber
(
orderNumber
);
orderEntity
.
setOrderAmount
(
new
BigDecimal
(
orderAmount
));
orderEntity
.
setOrderStatus
(
1
);
orderEntity
.
setPlatformCode
(
platformCode
);
// 新增订单
orderEntity
=
testIdempotentAnnotationService
.
addOrder
(
orderEntity
);
log
.
info
(
"======>>>>>>addOrder result is {}"
,
JSON
.
toJSONString
(
orderEntity
));
return
orderEntity
;
}
/**
* 测试幂等注解
* <p>
* 请求URL:localhost:12345/v1/idempotent-annotation/modify-order
* 入参:
* {
* "platformCode": "tianmao",
* "orderNumber": "TM-202301070001",
* "orderAmount": "1000",
* "orderStatus": 1,
* "orderLineEntityList": [
* {
* "orderLineNumber": "line-202301070001",
* "skuCode": "skuCode202301070001",
* "unitPrice": "200"
* },
* {
* "orderLineNumber": "line-202301070002",
* "skuCode": "skuCode202301070001",
* "unitPrice": "200"
* }
* ]
* }
* </p>
*/
@PostMapping
(
"/modify-order"
)
public
OrderEntity
modifyOrder
(
@RequestBody
OrderEntity
orderEntity
)
{
log
.
info
(
"=====>>>>>modifyOrder input params is : {}"
,
JSON
.
toJSONString
(
orderEntity
));
// 修改
orderEntity
=
testIdempotentAnnotationService
.
modifyOrder
(
orderEntity
);
log
.
info
(
"=====>>>>>modifyOrder input result is : {}"
,
JSON
.
toJSONString
(
orderEntity
));
return
orderEntity
;
}
}
//
package com.mortals.xhx.busiz.controller;
//
//
import com.alibaba.fastjson.JSON;
//
import lombok.extern.slf4j.Slf4j;
//
import org.enhance.idempotent.demo.app.service.TestIdempotentAnnotationService;
//
import org.enhance.idempotent.demo.domain.entity.OrderEntity;
//
import org.springframework.beans.factory.annotation.Autowired;
//
import org.springframework.web.bind.annotation.*;
//
//
import java.math.BigDecimal;
//
/
//
**
//
* 测试幂等注解
//
*
//
* @author wenpan 2023/01/07 10:13
//
*/
//
@Slf4j
//
@RestController("TestIdempotentAnnotationController.v1")
//
@RequestMapping("/v1/idempotent-annotation")
//
public class TestIdempotentAnnotationController {
//
//
@Autowired
//
private TestIdempotentAnnotationService testIdempotentAnnotationService;
//
//
/**
//
* 测试幂等注解
//
* 请求URL:localhost:12345/v1/idempotent-annotation/add-order?orderNumber=TB-202301070001&orderAmount=1000&platformCode=taobao
//
*/
//
@PostMapping("/add-order")
//
public OrderEntity addOrder(@RequestParam String orderNumber,
//
@RequestParam String orderAmount,
//
@RequestParam String platformCode) {
//
log.info("======>>>>>>addOrder orderNumber is {}, orderAmount is {}, platformCode is {}", orderNumber, orderAmount, platformCode);
//
// 构建待新增的订单信息
//
OrderEntity orderEntity = new OrderEntity();
//
orderEntity.setOrderNumber(orderNumber);
//
orderEntity.setOrderAmount(new BigDecimal(orderAmount));
//
orderEntity.setOrderStatus(1);
//
orderEntity.setPlatformCode(platformCode);
//
//
// 新增订单
//
orderEntity = testIdempotentAnnotationService.addOrder(orderEntity);
//
//
log.info("======>>>>>>addOrder result is {}", JSON.toJSONString(orderEntity));
//
return orderEntity;
//
}
//
//
/**
//
* 测试幂等注解
//
* <p>
//
* 请求URL:localhost:12345/v1/idempotent-annotation/modify-order
//
* 入参:
//
* {
//
* "platformCode": "tianmao",
//
* "orderNumber": "TM-202301070001",
//
* "orderAmount": "1000",
//
* "orderStatus": 1,
//
* "orderLineEntityList": [
//
* {
//
* "orderLineNumber": "line-202301070001",
//
* "skuCode": "skuCode202301070001",
//
* "unitPrice": "200"
//
* },
//
* {
//
* "orderLineNumber": "line-202301070002",
//
* "skuCode": "skuCode202301070001",
//
* "unitPrice": "200"
//
* }
//
* ]
//
* }
//
* </p>
//
*/
//
@PostMapping("/modify-order")
//
public OrderEntity modifyOrder(@RequestBody OrderEntity orderEntity) {
//
log.info("=====>>>>>modifyOrder input params is : {}", JSON.toJSONString(orderEntity));
//
// 修改
//
orderEntity = testIdempotentAnnotationService.modifyOrder(orderEntity);
//
log.info("=====>>>>>modifyOrder input result is : {}", JSON.toJSONString(orderEntity));
//
return orderEntity;
//
}
//
//
}
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