|
@@ -1,16 +1,16 @@
|
|
package com.ruoyi.web.controller.platform;
|
|
package com.ruoyi.web.controller.platform;
|
|
|
|
|
|
-import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
-import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
-import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
|
+import com.ruoyi.common.core.domain.R;
|
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
import com.ruoyi.system.domain.MerchantUser;
|
|
import com.ruoyi.system.domain.MerchantUser;
|
|
import com.ruoyi.system.service.MerchantUserService;
|
|
import com.ruoyi.system.service.MerchantUserService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.UUID;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 商户信息Controller
|
|
* 商户信息Controller
|
|
*
|
|
*
|
|
@@ -26,21 +26,28 @@ public class MerchantUserController extends BaseController {
|
|
/**
|
|
/**
|
|
* 查询商户信息列表
|
|
* 查询商户信息列表
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('system:user:list')")
|
|
|
|
- @GetMapping("/list")
|
|
|
|
- public TableDataInfo list(MerchantUser merchantUser) {
|
|
|
|
- return null;
|
|
|
|
|
|
+ @PostMapping("/allList")
|
|
|
|
+ public R<List<MerchantUser>> list() {
|
|
|
|
+ List<MerchantUser> list = merchantUserService.list();
|
|
|
|
+ return R.ok(list);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 新增商户信息
|
|
* 新增商户信息
|
|
*/
|
|
*/
|
|
- @PreAuthorize("@ss.hasPermi('system:user:add')")
|
|
|
|
- @Log(title = "商户信息", businessType = BusinessType.INSERT)
|
|
|
|
- @PostMapping
|
|
|
|
- public AjaxResult add(@RequestBody MerchantUser merchantUser) {
|
|
|
|
- return null;
|
|
|
|
|
|
+ @PostMapping("/add")
|
|
|
|
+ public R<Boolean> add(@RequestBody MerchantUser param) {
|
|
|
|
+ if (param.getId() != null) {
|
|
|
|
+ param.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ }else {
|
|
|
|
+ param.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ //随机生成6位商户标识
|
|
|
|
+ String uuid = UUID.randomUUID().toString().replace("-", "").substring(0, 6);
|
|
|
|
+ param.setMerchantCode(uuid);
|
|
|
|
+ }
|
|
|
|
+ return R.ok(merchantUserService.saveOrUpdate(param));
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|