|
@@ -0,0 +1,34 @@
|
|
|
+package com.fs.api.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
+import com.fs.core.utils.OrderCodeUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+
|
|
|
+@Api("公共接口")
|
|
|
+@RestController
|
|
|
+@RequestMapping(value="/app/common")
|
|
|
+public class CommonController {
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/genOrderCode")
|
|
|
+ public R genOrderCode() {
|
|
|
+
|
|
|
+ String orderCode= OrderCodeUtils.genOrderSn();
|
|
|
+ if(StringUtils.isNotEmpty(orderCode)){
|
|
|
+ return R.ok().put("orderCode",orderCode);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return R.error("订单号生成失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|