Commit 4cf02192 authored by 廖旭伟's avatar 廖旭伟

微信小程序登录以及手机号绑定;员工名片增加页面展示设置

parent 2ba83ed9
package com.mortals.xhx.busiz.controller; //package com.mortals.xhx.busiz.controller;
//
import com.alibaba.fastjson.JSON; //import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.enhance.idempotent.demo.app.service.TestIdempotentAnnotationService; //import org.enhance.idempotent.demo.app.service.TestIdempotentAnnotationService;
import org.enhance.idempotent.demo.domain.entity.OrderEntity; //import org.enhance.idempotent.demo.domain.entity.OrderEntity;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; //import org.springframework.web.bind.annotation.*;
//
import java.math.BigDecimal; //import java.math.BigDecimal;
//
/** ///**
* 测试幂等注解 // * 测试幂等注解
* // *
* @author wenpan 2023/01/07 10:13 // * @author wenpan 2023/01/07 10:13
*/ // */
@Slf4j //@Slf4j
@RestController("TestIdempotentAnnotationController.v1") //@RestController("TestIdempotentAnnotationController.v1")
@RequestMapping("/v1/idempotent-annotation") //@RequestMapping("/v1/idempotent-annotation")
public class TestIdempotentAnnotationController { //public class TestIdempotentAnnotationController {
//
@Autowired // @Autowired
private TestIdempotentAnnotationService testIdempotentAnnotationService; // private TestIdempotentAnnotationService testIdempotentAnnotationService;
//
/** // /**
* 测试幂等注解 // * 测试幂等注解
* 请求URL:localhost:12345/v1/idempotent-annotation/add-order?orderNumber=TB-202301070001&orderAmount=1000&platformCode=taobao // * 请求URL:localhost:12345/v1/idempotent-annotation/add-order?orderNumber=TB-202301070001&orderAmount=1000&platformCode=taobao
*/ // */
@PostMapping("/add-order") // @PostMapping("/add-order")
public OrderEntity addOrder(@RequestParam String orderNumber, // public OrderEntity addOrder(@RequestParam String orderNumber,
@RequestParam String orderAmount, // @RequestParam String orderAmount,
@RequestParam String platformCode) { // @RequestParam String platformCode) {
log.info("======>>>>>>addOrder orderNumber is {}, orderAmount is {}, platformCode is {}", orderNumber, orderAmount, platformCode); // log.info("======>>>>>>addOrder orderNumber is {}, orderAmount is {}, platformCode is {}", orderNumber, orderAmount, platformCode);
// 构建待新增的订单信息 // // 构建待新增的订单信息
OrderEntity orderEntity = new OrderEntity(); // OrderEntity orderEntity = new OrderEntity();
orderEntity.setOrderNumber(orderNumber); // orderEntity.setOrderNumber(orderNumber);
orderEntity.setOrderAmount(new BigDecimal(orderAmount)); // orderEntity.setOrderAmount(new BigDecimal(orderAmount));
orderEntity.setOrderStatus(1); // orderEntity.setOrderStatus(1);
orderEntity.setPlatformCode(platformCode); // orderEntity.setPlatformCode(platformCode);
//
// 新增订单 // // 新增订单
orderEntity = testIdempotentAnnotationService.addOrder(orderEntity); // orderEntity = testIdempotentAnnotationService.addOrder(orderEntity);
//
log.info("======>>>>>>addOrder result is {}", JSON.toJSONString(orderEntity)); // log.info("======>>>>>>addOrder result is {}", JSON.toJSONString(orderEntity));
return orderEntity; // return orderEntity;
} // }
//
/** // /**
* 测试幂等注解 // * 测试幂等注解
* <p> // * <p>
* 请求URL:localhost:12345/v1/idempotent-annotation/modify-order // * 请求URL:localhost:12345/v1/idempotent-annotation/modify-order
* 入参: // * 入参:
* { // * {
* "platformCode": "tianmao", // * "platformCode": "tianmao",
* "orderNumber": "TM-202301070001", // * "orderNumber": "TM-202301070001",
* "orderAmount": "1000", // * "orderAmount": "1000",
* "orderStatus": 1, // * "orderStatus": 1,
* "orderLineEntityList": [ // * "orderLineEntityList": [
* { // * {
* "orderLineNumber": "line-202301070001", // * "orderLineNumber": "line-202301070001",
* "skuCode": "skuCode202301070001", // * "skuCode": "skuCode202301070001",
* "unitPrice": "200" // * "unitPrice": "200"
* }, // * },
* { // * {
* "orderLineNumber": "line-202301070002", // * "orderLineNumber": "line-202301070002",
* "skuCode": "skuCode202301070001", // * "skuCode": "skuCode202301070001",
* "unitPrice": "200" // * "unitPrice": "200"
* } // * }
* ] // * ]
* } // * }
* </p> // * </p>
*/ // */
@PostMapping("/modify-order") // @PostMapping("/modify-order")
public OrderEntity modifyOrder(@RequestBody OrderEntity orderEntity) { // public OrderEntity modifyOrder(@RequestBody OrderEntity orderEntity) {
log.info("=====>>>>>modifyOrder input params is : {}", JSON.toJSONString(orderEntity)); // log.info("=====>>>>>modifyOrder input params is : {}", JSON.toJSONString(orderEntity));
// 修改 // // 修改
orderEntity = testIdempotentAnnotationService.modifyOrder(orderEntity); // orderEntity = testIdempotentAnnotationService.modifyOrder(orderEntity);
log.info("=====>>>>>modifyOrder input result is : {}", JSON.toJSONString(orderEntity)); // log.info("=====>>>>>modifyOrder input result is : {}", JSON.toJSONString(orderEntity));
return orderEntity; // return orderEntity;
} // }
//
} //}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment