mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 添加会员接口
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.jsowell.web.controller.pile;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.jsowell.common.annotation.Log;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.domain.AjaxResult;
|
||||
@@ -12,7 +11,6 @@ import com.jsowell.pile.domain.MemberGroup;
|
||||
import com.jsowell.pile.dto.MemberGroupDTO;
|
||||
import com.jsowell.pile.service.MemberGroupService;
|
||||
import com.jsowell.pile.util.UserUtils;
|
||||
import com.jsowell.pile.vo.base.LoginUserDetailVO;
|
||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||
import com.jsowell.pile.vo.web.MemberGroupVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -122,7 +120,20 @@ public class MemberGroupController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/addMember")
|
||||
public AjaxResult addMember(@RequestBody MemberGroupDTO dto) {
|
||||
return toAjax(memberGroupService.addMember(dto));
|
||||
AjaxResult ajaxResult;
|
||||
try {
|
||||
int i = memberGroupService.addMember(dto);
|
||||
if (i > 0) {
|
||||
ajaxResult = AjaxResult.success();
|
||||
} else {
|
||||
ajaxResult = AjaxResult.error();
|
||||
}
|
||||
} catch (BusinessException e) {
|
||||
ajaxResult = AjaxResult.error(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
ajaxResult = AjaxResult.error("添加会员失败");
|
||||
}
|
||||
return ajaxResult;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user